Skip to content

Commit 957ab80

Browse files
chillenbergerSilasMarvinmontanalow
authored
add product to nav (#1545)
Co-authored-by: SilasMarvin <19626586+SilasMarvin@users.noreply.github.com> Co-authored-by: Montana Low <montanalow@users.noreply.github.com>
1 parent b05fd65 commit 957ab80

File tree

85 files changed

+2401
-1523
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+2401
-1523
lines changed
Loading

pgml-cms/blog/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Table of contents
22

33
* [Home](README.md)
4+
* [Korvus The All-in-One RAG Pipeline for PostgresML](introducing-korvus-the-all-in-one-rag-pipeline-for-postgresml.md)
45
* [Semantic Search in Postgres in 15 Minutes](semantic-search-in-postgres-in-15-minutes.md)
56
* [Unified RAG](unified-rag.md)
67
* [Announcing the Release of our Rust SDK](announcing-the-release-of-our-rust-sdk.md)
Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
---
2+
description: Meet Korvus, our new open-source tool that simplifies and unifies the entire RAG pipeline into a single database query.
3+
featured: true
4+
tags: [product]
5+
image: ".gitbook/assets/Blog-Image_Korvus-Release.jpg"
6+
---
7+
8+
# Introducing Korvus: The All-in-One RAG Pipeline for PostgresML
9+
10+
<div align="left">
11+
12+
<figure><img src=".gitbook/assets/image.png" alt="Author" width="100"><figcaption></figcaption></figure>
13+
14+
</div>
15+
16+
Cassandra Stumer
17+
18+
July 10, 2024
19+
20+
You’re probably all too familiar with the complexities of building and maintaining RAG pipelines. The multiple services, the API calls, the data movement. Managing and scaling efficient infrastructure is the woefully painful and un-sexy side of building any ML/AI system. It’s also the most crucial factor when it comes to delivering real-world, production applications. That’s why we perform machine learning directly in PostgreSQL.
21+
22+
After hard-earned wisdom gained scaling the ML platform at Instacart, our team is bullish on in-database machine learning winning out as the AI infrastructure of the future. We know from experience that moving the compute to your database is far more efficient, effective and scalable than continuously moving your data to the models. That’s why we built PostgresML.
23+
24+
While we’re big Postgres fans, we asked ourselves: what if we could simplify all of that for folks who need a robust, production-grade RAG pipeline, but aren’t into SQL? Korvus is our answer. It's an extension of what we've been doing with PostgresML, but abstracts away the complexity of SQL-based operations. That way, more builders and users can reap the benefits of a unified, in-database RAG pipeline.
25+
26+
Why is RAG better with Korvus? Korvus provides a high-level interface in multiple programming languages that unifies the entire RAG pipeline into a single database query. Yes, you read that right - one query to handle embedding generation, vector search, reranking, and text generation. <i>One query to rule them all</i>.
27+
28+
Here's what's under the hood: Korvus’ core operations are built on optimized SQL queries. You’ll get high-performance, customizable search capabilities with minimal infrastructure concerns – and you can do it all in Python, JavaScript or Rust.
29+
30+
!!! info
31+
32+
Open a [GitHub issue](https://github.com/postgresml/korvus/issues) to vote on support for another language and we will add it to our roadmap.
33+
34+
!!!
35+
36+
Performing RAG directly where your data resides with optimized queries not only produces a faster app for users; but also gives you the ability to inspect, understand, and even customize these queries if you need to.
37+
38+
Plus, when you build on Postgres, you can leverage its vast ecosystem of extensions. The capabilities are robust; “just use Postgres” is a common saying for a reason. There’s truly an extension for everything, and extensions like pgvector, pgml and pgvectorscale couple all the performance and scalability you'd expect from Postgres with sophisticated ML/AI operations.
39+
40+
We're releasing Korvus as open-source software, and yes, it can run locally in Docker for those of you who like to tinker. In our (admittedly biased) opinion – it’s easiest to run Korvus on our serverless cloud. The PostgresML cloud comes with GPUs, and it’s preloaded with the extensions you’ll need to get started. Plus, you won’t have to manage a database.
41+
42+
Once set up locally or in the PostgresML cloud, getting started with Korvus is easy!
43+
44+
!!! generic
45+
46+
!!! code_block
47+
48+
```python
49+
from korvus import Collection, Pipeline
50+
from rich import print
51+
import asyncio
52+
53+
# Initialize our Collection
54+
collection = Collection("semantic-search-demo")
55+
56+
# Initialize our Pipeline
57+
# Our Pipeline will split and embed the `text` key of documents we upsert
58+
pipeline = Pipeline(
59+
"v1",
60+
{
61+
"text": {
62+
"splitter": {"model": "recursive_character"},
63+
"semantic_search": {
64+
"model": "mixedbread-ai/mxbai-embed-large-v1",
65+
},
66+
},
67+
},
68+
)
69+
70+
async def main():
71+
# Add our Pipeline to our Collection
72+
await collection.add_pipeline(pipeline)
73+
74+
# Upsert our documents
75+
documents = [
76+
{
77+
"id": "1",
78+
"text": "Korvus is incredibly fast and easy to use.",
79+
},
80+
{
81+
"id": "2",
82+
"text": "Tomatoes are incredible on burgers.",
83+
},
84+
]
85+
await collection.upsert_documents(documents)
86+
87+
# Perform RAG
88+
query = "Is Korvus fast?"
89+
print(f"Querying for response to: {query}")
90+
results = await collection.rag(
91+
{
92+
"CONTEXT": {
93+
"vector_search": {
94+
"query": {
95+
"fields": {"text": {"query": query}},
96+
},
97+
"document": {"keys": ["id"]},
98+
"limit": 1,
99+
},
100+
"aggregate": {"join": "\n"},
101+
},
102+
"chat": {
103+
"model": "meta-llama/Meta-Llama-3-8B-Instruct",
104+
"messages": [
105+
{
106+
"role": "system",
107+
"content": "You are a friendly and helpful chatbot",
108+
},
109+
{
110+
"role": "user",
111+
"content": f"Given the context\n:{{CONTEXT}}\nAnswer the question briefly: {query}",
112+
},
113+
],
114+
"max_tokens": 100,
115+
},
116+
},
117+
pipeline,
118+
)
119+
print(results)
120+
121+
asyncio.run(main())
122+
```
123+
124+
!!!
125+
126+
!!! results
127+
128+
```json
129+
{
130+
'rag': ['Yes, Korvus is incredibly fast!'],
131+
'sources': {
132+
'CONTEXT': [
133+
{
134+
'chunk': 'Korvus is incredibly fast and easy to use.',
135+
'document': {'id': '1'},
136+
'rerank_score': None,
137+
'score': 0.7542821004154432
138+
}
139+
]
140+
}
141+
}
142+
```
143+
144+
!!!
145+
146+
!!!
147+
148+
Give it a spin, and let us know what you think. We're always here to geek out about databases and machine learning, so don't hesitate to reach out if you have any questions or ideas. We welcome you to:
149+
150+
- [Join our Discord server](https://discord.gg/DmyJP3qJ7U)
151+
- [Follow us on Twitter](https://twitter.com/postgresml)
152+
- [Contribute to the project on GitHub](https://github.com/postgresml/korvus)
153+
154+
We're excited to see what you'll build with Korvus. Whether you're working on advanced search systems, content recommendation engines, or any other RAG-based application, we believe Korvus can significantly streamline your architecture and boost your performance.
155+
156+
Here's to simpler architectures and more powerful queries!

pgml-cms/docs/.gitbook/assets/vpc.png

36.8 KB
Loading

pgml-cms/docs/SUMMARY.md

Lines changed: 54 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -12,44 +12,53 @@
1212
* [Move data with COPY](introduction/getting-started/import-your-data/copy.md)
1313
* [Migrate with pg_dump](introduction/getting-started/import-your-data/pg-dump.md)
1414

15-
## API
15+
## Open Source
1616

17-
* [Overview](api/overview.md)
18-
* [SQL extension](api/sql-extension/README.md)
19-
* [pgml.embed()](api/sql-extension/pgml.embed.md)
20-
* [pgml.transform()](api/sql-extension/pgml.transform/README.md)
21-
* [Fill-Mask](api/sql-extension/pgml.transform/fill-mask.md)
22-
* [Question answering](api/sql-extension/pgml.transform/question-answering.md)
23-
* [Summarization](api/sql-extension/pgml.transform/summarization.md)
24-
* [Text classification](api/sql-extension/pgml.transform/text-classification.md)
25-
* [Text Generation](api/sql-extension/pgml.transform/text-generation.md)
26-
* [Text-to-Text Generation](api/sql-extension/pgml.transform/text-to-text-generation.md)
27-
* [Token Classification](api/sql-extension/pgml.transform/token-classification.md)
28-
* [Translation](api/sql-extension/pgml.transform/translation.md)
29-
* [Zero-shot Classification](api/sql-extension/pgml.transform/zero-shot-classification.md)
30-
* [pgml.deploy()](api/sql-extension/pgml.deploy.md)
31-
* [pgml.decompose()](api/sql-extension/pgml.decompose.md)
32-
* [pgml.chunk()](api/sql-extension/pgml.chunk.md)
33-
* [pgml.generate()](api/sql-extension/pgml.generate.md)
34-
* [pgml.predict()](api/sql-extension/pgml.predict/README.md)
35-
* [Batch Predictions](api/sql-extension/pgml.predict/batch-predictions.md)
36-
* [pgml.train()](api/sql-extension/pgml.train/README.md)
37-
* [Regression](api/sql-extension/pgml.train/regression.md)
38-
* [Classification](api/sql-extension/pgml.train/classification.md)
39-
* [Clustering](api/sql-extension/pgml.train/clustering.md)
40-
* [Decomposition](api/sql-extension/pgml.train/decomposition.md)
41-
* [Data Pre-processing](api/sql-extension/pgml.train/data-pre-processing.md)
42-
* [Hyperparameter Search](api/sql-extension/pgml.train/hyperparameter-search.md)
43-
* [Joint Optimization](api/sql-extension/pgml.train/joint-optimization.md)
44-
* [pgml.tune()](api/sql-extension/pgml.tune.md)
45-
* [Client SDK](api/client-sdk/README.md)
46-
* [Collections](api/client-sdk/collections.md)
47-
* [Pipelines](api/client-sdk/pipelines.md)
48-
* [Vector Search](api/client-sdk/search.md)
49-
* [Document Search](api/client-sdk/document-search.md)
50-
* [Tutorials](api/client-sdk/tutorials/README.md)
51-
* [Semantic Search](api/client-sdk/tutorials/semantic-search.md)
52-
* [Semantic Search Using Instructor Model](api/client-sdk/tutorials/semantic-search-1.md)
17+
* [Overview](open-source/overview.md)
18+
* [PGML](open-source/pgml/README.md)
19+
* [API](open-source/pgml/api/README.md)
20+
* [pgml.embed()](open-source/pgml/api/pgml.embed.md)
21+
* [pgml.transform()](open-source/pgml/api/pgml.transform/README.md)
22+
* [Fill-Mask](open-source/pgml/api/pgml.transform/fill-mask.md)
23+
* [Question answering](open-source/pgml/api/pgml.transform/question-answering.md)
24+
* [Summarization](open-source/pgml/api/pgml.transform/summarization.md)
25+
* [Text classification](open-source/pgml/api/pgml.transform/text-classification.md)
26+
* [Text Generation](open-source/pgml/api/pgml.transform/text-generation.md)
27+
* [Text-to-Text Generation](open-source/pgml/api/pgml.transform/text-to-text-generation.md)
28+
* [Token Classification](open-source/pgml/api/pgml.transform/token-classification.md)
29+
* [Translation](open-source/pgml/api/pgml.transform/translation.md)
30+
* [Zero-shot Classification](open-source/pgml/api/pgml.transform/zero-shot-classification.md)
31+
* [pgml.transform_stream()](open-source/pgml/api/pgml.transform_stream.md)
32+
* [pgml.deploy()](open-source/pgml/api/pgml.deploy.md)
33+
* [pgml.decompose()](open-source/pgml/api/pgml.decompose.md)
34+
* [pgml.chunk()](open-source/pgml/api/pgml.chunk.md)
35+
* [pgml.generate()](open-source/pgml/api/pgml.generate.md)
36+
* [pgml.predict()](open-source/pgml/api/pgml.predict/README.md)
37+
* [Batch Predictions](open-source/pgml/api/pgml.predict/batch-predictions.md)
38+
* [pgml.train()](open-source/pgml/api/pgml.train/README.md)
39+
* [Regression](open-source/pgml/api/pgml.train/regression.md)
40+
* [Classification](open-source/pgml/api/pgml.train/classification.md)
41+
* [Clustering](open-source/pgml/api/pgml.train/clustering.md)
42+
* [Decomposition](open-source/pgml/api/pgml.train/decomposition.md)
43+
* [Data Pre-processing](open-source/pgml/api/pgml.train/data-pre-processing.md)
44+
* [Hyperparameter Search](open-source/pgml/api/pgml.train/hyperparameter-search.md)
45+
* [Joint Optimization](open-source/pgml/api/pgml.train/joint-optimization.md)
46+
* [pgml.tune()](open-source/pgml/api/pgml.tune.md)
47+
* [Korvus](open-source/korvus/README.md)
48+
* [API](open-source/korvus/api/README.md)
49+
* [Collections](open-source/korvus/api/collections.md)
50+
* [Pipelines](open-source/korvus/api/pipelines.md)
51+
* [Guides](open-source/korvus/guides/README.md)
52+
* [Constructing Pipelines](open-source/korvus/guides/constructing-pipelines.md)
53+
* [RAG](open-source/korvus/guides/rag.md)
54+
* [Vector Search](open-source/korvus/guides/vector-search.md)
55+
* [Document Search](open-source/korvus/guides/document-search.md)
56+
* [Example Apps](open-source/korvus/example-apps/README.md)
57+
* [Semantic Search](open-source/korvus/example-apps/semantic-search.md)
58+
* [PgCat](open-source/pgcat/README.md)
59+
* [Features](open-source/pgcat/features.md)
60+
* [Installation](open-source/pgcat/installation.md)
61+
* [Configuration](open-source/pgcat/configuration.md)
5362

5463
## Guides
5564

@@ -66,19 +75,16 @@
6675
* [Unified RAG](guides/unified-rag.md)
6776
* [OpenSourceAI](guides/opensourceai.md)
6877
* [Natural Language Processing](guides/natural-language-processing.md)
69-
70-
## Product
78+
* [Vector database](guides/vector-database.md)
7179

72-
* [Cloud database](product/cloud-database/README.md)
73-
* [Serverless](product/cloud-database/serverless.md)
74-
* [Dedicated](product/cloud-database/dedicated.md)
75-
* [Enterprise](product/cloud-database/plans.md)
76-
* [Vector database](product/vector-database.md)
77-
* [PgCat pooler](product/pgcat/README.md)
78-
* [Features](product/pgcat/features.md)
79-
* [Installation](product/pgcat/installation.md)
80-
* [Configuration](product/pgcat/configuration.md)
80+
## Cloud
8181

82+
* [Overview](cloud/overview.md)
83+
* [Serverless](cloud/serverless.md)
84+
* [Dedicated](cloud/dedicated.md)
85+
* [Enterprise](cloud/enterprise/README.md)
86+
* [Teams](cloud/enterprise/teams.md)
87+
* [VPC](cloud/enterprise/vpc.md)
8288

8389
## Resources
8490

0 commit comments

Comments
 (0)