just came across this: GitHub - bitcrowd/rag: A library to make building performant RAG (Retrieval Augmented Generation) systems in Elixir easy.
Wow! Great find! I just wish there was an example on how to get started.
However, I found this in the docs!
https://hexdocs.pm/rag/Rag.Generation.LangChain.html
@spec generate_response(Rag.Generation.t(), LangChain.Chains.LLMChain.t()) ::
Rag.Generation.t()
Showing that it’s designed to work with Elixir LangChain. Sweet!
Hey, so this library is still under development, definitely not ready yet. As such, the code on GitHub significantly changed in comparison to version 0.1.0 on hex.
I started it this way, using langchain
as a means to generate responses in a model and provider agnostic way.
After some time I realized that it should be the other way around: I want people to be able to use rag
without langchain
for simple one off generations.
I also want it to be able to be integrated with langchain
, for ongoing conversations or any other of the features that langchain
gives you.
But rag
doesn’t need to know about langchain
to be integrated, it can simply be used to retrieve information and prepare the next message in langchain
.
I agree. For that reason, I’ve been unclear on if or how to integrate RAG into LangChain. I’m pretty sure the Python/JS libraries combine them, but they each have distinct value separate from each other. But I do want RAG to be easy to use with LangChain. Because I want it for myself as well!
I am working with vertexAI API and just came across Langchain ex. Seems to be the way to have support for all infernece endpoints. I can see that for google gemini and vertex it looks for google_ai_key. Though that can work with the google AI studio where you can generate a long lived API key that can be stored in secret but with Vertex AI it only works with gcloud auth
generated token which is time bound and in my current implementation I have to regenerate one every time I get 401. How can we pass the api_key that I generate when making call to LLM using langchain to bypass this limitation @brainlid ?
@darnahsan The API key can be set in an ENV when it doesn’t change or it can be passed in with each request using the Chat model’s config.
Thanks @brainlid I managed that going through the code and found that VertexAI doesn’t have support for File URL which was recently added to Google AI in langchain_ex. I have opened a PR for it to add support of file URL to Vertex AI up for review
PR’s to improve the docs by exposing functionality that isn’t obvious is also welcome.