Postgres Learns to RAG: Wikipedia Q&A using Llama 3.1 inside the database

1 pointsposted 7 hours ago
by cassandra_who

2 Comments

cassandra_who

7 hours ago

Hey HN,

We’ve been working on a demo that showcases RAG (Retrieval-Augmented Generation) using open-source models directly within Postgres. It's a Wikipedia chatbot built with PostgresML.

If you haven’t seen us here before, PostgresML is an open-source extension for Postgres that lets you perform ML/AI inside PostgreSQL. There are a number of performance benefits that come with doing machine learning in-database. It’s how our team built and scaled the ML platform at Instacart during Covid, so it’s a thesis that’s been battle tested to say the least.

Key points: * Fully open-source stack * Performs the entire RAG workflow (LLMs, vector memory, embedding generation, re-ranking, summarization) in a single SQL query * RAG performed in-database

We’re curious to hear your thoughts, especially from those who've worked with other RAG implementations or in-database ML. Any advantages/drawbacks you're seeing with this approach?

Try it out: https://postgresml.org/chatbot GitHub: https://github.com/postgresml/postgresml

Looking forward to your feedback and any questions about the technical details.

user

7 hours ago

[deleted]