Build an end-to-end RAG pipeline entirely in psql using pgrag and DeepSeek
Blog post from Neon
Neon's open-source extension, pgrag, facilitates building an end-to-end Retrieval-Augmented Generation (RAG) pipeline entirely within PostgreSQL (psql) by integrating features like PDF-to-text conversion, local embedding generation, and AI API requests. The RAG pipeline operates by taking user questions, retrieving relevant information, and using this data to prompt an AI chat model for an informed response. pgrag simplifies the creation of this pipeline by allowing the entire process to be managed with SQL commands, eliminating the need for multiple programming languages and libraries. The extension includes features for text extraction from various file types, splitting text into chunks, generating embeddings using models that can run locally or through third-party APIs, and reranking document chunks to enhance response accuracy. This streamlined approach, which can be deployed directly on the Neon platform or on other PostgreSQL servers, aims to provide an efficient and user-friendly method for setting up RAG pipelines.