<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/build-an-end-to-end-rag-pipeline-entirely-in-psql-using-pgrag-and-deepseek-vqugvfrve" -->

---
title: Build an end-to-end RAG pipeline entirely in psql using...
description: pgrag is an open-source Postgres extension that enables building a complete RAG pipeline entirely within psql, without needing a separate programming language...
canonical: https://daily.dev/posts/build-an-end-to-end-rag-pipeline-entirely-in-psql-using-pgrag-and-deepseek-vqugvfrve
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Build an end-to-end RAG pipeline entirely in psql using pgrag and DeepSeek | daily.dev
og:description: pgrag is an open-source Postgres extension that enables building a complete RAG pipeline entirely within psql, without needing a separate programming language...
og:url: https://daily.dev/posts/build-an-end-to-end-rag-pipeline-entirely-in-psql-using-pgrag-and-deepseek-vqugvfrve
og:image: https://api.daily.dev/og/posts/vQugVfrVe.png
og:image:alt: Build an end-to-end RAG pipeline entirely in psql using pgrag and DeepSeek
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Build an end-to-end RAG pipeline entirely in psql using pgrag and DeepSeek

**[Neon](https://daily.dev/sources/neontech)** · 8 min read · 0 upvotes · 0 comments

## Summary

pgrag is an open-source Postgres extension that enables building a complete RAG pipeline entirely within psql, without needing a separate programming language or external tooling. It handles PDF/Word/HTML text extraction, text chunking by character or token count, local embedding generation (using bundled BGE and Jina models), third-party embedding API calls (e.g., Voyage AI), reranking of retrieved chunks, and AI chat API calls (e.g., DeepSeek, ChatGPT). Combined with pgvector for vector indexing, the full pipeline — from document ingestion to question answering — runs as SQL queries. A walkthrough demonstrates loading PGConf EU 2023 slides as PDFs, chunking and embedding them, then querying with DeepSeek V3 for accurate, context-grounded answers. pgrag is available out of the box on Neon or can be compiled for self-hosted Postgres.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://neon.com/blog/pgrag-and-deepseek>

## Similar posts on daily.dev

- [How to Build a RAG Server on pgEdge Cloud via the API](https://daily.dev/posts/how-to-build-a-rag-server-on-pgedge-cloud-via-the-api-irhtqrhqw) · Planet PostgreSQL · 0 upvotes · 0 comments
- [Boring RAG: When similarity is just a SQL query](https://daily.dev/posts/boring-rag-when-similarity-is-just-a-sql-query-rucfrxyvu) · Red Hat Developer · 0 upvotes · 0 comments
- [How to Build a RAG Chatbot for Your Docs with Node.js, Google Gemini, and pgvector](https://daily.dev/posts/how-to-build-a-rag-chatbot-for-your-docs-with-node-js-google-gemini-and-pgvector-za3dfnltm) · freeCodeCamp · 3 upvotes · 0 comments
- [RAG with Spring AI](https://daily.dev/posts/rag-with-spring-ai-aalrsnemm) · Javarevisited · 6 upvotes · 0 comments
- [You Don't Need Embeddings for RAG](https://daily.dev/posts/you-don-t-need-embeddings-for-rag-emfjqgjs1) · TypeScript.TV · 5 upvotes · 0 comments

---

Tags: [#nlp](https://daily.dev/tags/nlp), [#postgresql](https://daily.dev/tags/postgresql), [#rag](https://daily.dev/tags/rag), [#deepseek](https://daily.dev/tags/deepseek), [#pgvector](https://daily.dev/tags/pgvector)

[View this post on daily.dev](https://daily.dev/posts/build-an-end-to-end-rag-pipeline-entirely-in-psql-using-pgrag-and-deepseek-vqugvfrve)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Build an end-to-end RAG pipeline entirely in psql using pgrag and DeepSeek","url":"https://daily.dev/posts/build-an-end-to-end-rag-pipeline-entirely-in-psql-using-pgrag-and-deepseek-vqugvfrve","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/build-an-end-to-end-rag-pipeline-entirely-in-psql-using-pgrag-and-deepseek-vqugvfrve"},"datePublished":"2026-07-09T06:57:52.305Z","dateModified":"2026-07-09T07:01:58.970Z","description":"pgrag is an open-source Postgres extension that enables building a complete RAG pipeline entirely within psql, without needing a separate programming language...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/ed3648c1683b13a1d29c66acf7854368?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/ed3648c1683b13a1d29c66acf7854368?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Neon","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Neon","logo":"https://media.daily.dev/image/upload/s--65EDghou--/f_auto/v1724339118/logos/neontech","url":"https://daily.dev/sources/neontech"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/build-an-end-to-end-rag-pipeline-entirely-in-psql-using-pgrag-and-deepseek-vqugvfrve","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"nlp,postgresql,rag,deepseek,pgvector","timeRequired":"PT8M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Neon","item":"https://daily.dev/sources/neontech"},{"@type":"ListItem","position":3,"name":"Build an end-to-end RAG pipeline entirely in psql using pgrag and DeepSeek"}]}
```

