Skip to content

RAG in Practice — From Naive Search to Production Retrieval

Retrieval-augmented generation turns a language model from a closed book into an open one. Instead of relying on what the model memorized during training, you give it the specific documents, facts, and context it needs to answer the question in front of it. Done right, RAG is the single most reliable way to ground an LLM in reality. Done wrong, it's a slower, more expensive version of the model making things up.

Five days, from your first embedding to a production retrieval system that handles chunking, hybrid search, re-ranking, and evaluation. Every technique uses real code against real vector stores. Nothing is theoretical.

Before you start: tooling you'll need

ToolVersionPurposeInstall
Python3.10+All code examplespython.org
PostgreSQL + pgvector16+Vector store (Days 1-5)apt install postgresql-16-pgvector
An API keyEmbeddings and generationAnthropic, OpenAI, or Google
bash
pip install psycopg2-binary pgvector openai anthropic pydantic tiktoken

If you don't have PostgreSQL set up, the Practical Fundamentals course covers it in about 20 minutes. The course uses pgvector throughout because it's the most common production choice, but every technique applies to Pinecone, Weaviate, Chroma, or any vector store.

The arc

Day 1 — Embeddings & Vector Stores covers what embeddings actually are, how to generate them, and how to store and query them in pgvector. You'll build a working vector store by the end of the day.

Day 2 — Chunking & Ingestion covers the chunking problem: how to split documents so retrieval finds the right piece. Fixed-size, semantic, and recursive chunking. Overlap strategies. Metadata and filtering.

Day 3 — Retrieval Quality & Ranking covers improving retrieval: hybrid search (vector + keyword), re-ranking with cross-encoders, and evaluating retrieval quality with recall and MRR.

Day 4 — Advanced RAG Patterns covers self-querying, multi-hop retrieval, agentic RAG, and handling structured data alongside text.

Day 5 — Production RAG Systems covers indexing at scale, handling updates, caching, monitoring retrieval quality, and cost optimization.

Then you build it for real

The Capstone: Company Docs Q&A is a RAG system that answers questions from your own documentation. It handles chunking, embedding, hybrid search, re-ranking, and streaming responses with citations.