We built Korvus, an open-source RAG (Retrieval-Augmented Generation) pipeline that consolidates the entire RAG workflow - from embedding generation to text generation - into a single SQL query, significantly reducing architectural complexity and latency.
Here's some of the highlights:
- Full RAG pipeline (embedding generation, vector search, reranking, and text generation) in one SQL query
- SDKs for Python, JavaScript, and Rust (more languages planned)
- Built on PostgreSQL, leveraging pgvector and pgml
- Open-source, with support for open models
- Designed for high performance and scalability
Korvus utilizes Postgres' advanced features to perform complex RAG operations natively within the database. We're also the developers of PostgresML, so we're big advocates of in-database machine learning. This approach eliminates the need for external services and API calls, potentially reducing latency by orders of magnitude compared to traditional microservice architectures. It's how our founding team built and scaled the ML platform at Instacart.
We're eager to get feedback from the community and welcome contributions. Check out our GitHub repo for more details, and feel free to hit us up in our Discord!
IMHO it would be much clearer if you just used the normal %s for the "outer" string and left the implicit f-string syntax as it is, e.g.
{
"role": "user",
# this is not an f-string, is rather replaced by TODO FIXME
"content": "Given the context\n:{CONTEXT}\nAnswer the question: %s" % query,
},
The way the example (in both the readme and the docs) is written, it seems to imply I can put my own fileds as siblings to the chat key and they, too, will be resolved results = await collection.rag(
{
"EXAMPLE": {
"uh-huh": True
},
"CONTEXT": {
"vector_search": {
"query": {
"fields": {"text": {"query": query}},
},
"document": {"keys": ["id"]},
"limit": 1,
},
"aggregate": {"join": "\n"},
},
"chat": {
"messages": [{"content": "Given Context:\n{CONTEXT}\nAn Example:\n{EXAMPLE}"
}
One could not fault the user for thinking such a thing since the *API* docs say "see the *GUIDE*" :-( https://postgresml.org/docs/open-source/korvus/api/collectio...I spent too long reading Python docs because I haven't touched the language since 2019. Happy to help develop a Ruby SDK!
Can it run the LLM on a GPU?
This was my first reaction, too.
Perhaps there's something about data locality that makes it good for certain use cases?
> I still prefer to clearly explicit embedding, LLM generation, etc.
The bit that I usually need to control is how the retrieved results are formatted in the prompt. In order to make the context as information dense as possible, I might strip out certain words/l and/or symbols. But it depends on the query, so it can't be done at ingestion time.
You mention pulling models from huggingface for document embedding. Is it possible to pass an hf token to use private models?
I train domain and language-specific[0] embedding and conversational models and if I can use them in Korvus I'll most likely switch to it overnight.
What am I missing? Honest question. I want to likes this :)
I see you offer re-ranking using local models, will there be build-in support for making re-ranking calls to external services such as cohere in the future?
One question: Can I use an external model (ie get the raw RAG snippets, or prompt text)? Or does it have to be the one specified in Korvus?
> Korvus is an all-in-one, open-source RAG (Retrieval-Augmented Generation) pipeline...