RAG in practice: answer questions from your own documents

Build retrieval augmented generation with embeddings, pgvector, hybrid search and reranking, and measure it properly before you ship

7 ratings 1,940 students Sample

Created by Elena Petrova

  • Updated October 2026
  • English
  • Intermediate

What you will learn

  • Decide when retrieval augmented generation fits a problem
  • Parse, clean and chunk documents while preserving useful structure
  • Store and query embeddings with PostgreSQL and pgvector
  • Combine keyword and vector search and add a reranker
  • Generate grounded answers with verifiable citations
  • Evaluate retrieval and answer quality and operate RAG in production

Course content

5 sections, 24 lessons, 4h 1m total

Foundations of retrieval augmented generation 5 lessons · 53 min
  • Video: What RAG is and when to use it Preview 9 min
  • Article: Loading and cleaning documents Preview 13 min
  • Article: Chunking without losing meaning 13 min
  • Article: Embeddings and pgvector 13 min
  • Quiz: Check your understanding 5 min
Better retrieval 5 lessons · 52 min
  • Video: Keyword search still matters 10 min
  • Video: Hybrid search with rank fusion 12 min
  • Video: Reranking the top results 11 min
  • Video: Query rewriting and multi step retrieval 10 min
  • Article: Metadata filters and freshness 9 min
Generating grounded answers 5 lessons · 48 min
  • Video: Prompting for grounded answers 11 min
  • Article: Answer formats people can use 9 min
  • Video: Verifying citations in code 10 min
  • Article: Handling unanswerable questions 9 min
  • Video: Context window budgeting 9 min
Evaluating RAG properly 4 lessons · 42 min
  • Video: Building a question set with known answers 11 min
  • Video: Measuring retrieval 10 min
  • Video: Measuring answers 11 min
  • Video: Running experiments on chunking and models 10 min
Running RAG in production 5 lessons · 46 min
  • Video: Incremental indexing and deletions 10 min
  • Video: Serving Askdocs as an API 11 min
  • Video: Security and data protection 10 min
  • Video: Feedback, monitoring and cost 10 min
  • Quiz: Final check 5 min

Requirements

  • Python and basic SQL
  • Experience calling an LLM API
  • Docker for running PostgreSQL with pgvector

Description

Retrieval augmented generation, usually called RAG, is the most common way to make a language model answer questions about your own documents: handbooks, product docs, contracts, support articles. Instead of hoping the model knows the answer, you search your documents first and give the model the relevant passages to answer from.

A RAG demo takes an afternoon. A RAG system that people trust takes much more care. Most failures come from retrieval, not generation: the right passage was never found, was split in half or was buried under near duplicates. This course focuses on getting retrieval right and proving it with measurements.

What you will build

Askdocs, a question answering service over a company knowledge base of a few thousand pages, with citations, permission aware search, fresh content and an evaluation suite.

What you will learn

  • When RAG is the right approach, and when search, fine tuning or long context is better
  • Parsing and cleaning documents, including PDFs and HTML
  • Chunking strategies and keeping structure such as headings
  • Embeddings and vector search with PostgreSQL and pgvector
  • Hybrid search combining keywords and vectors, and reranking
  • Prompting for grounded answers with citations and refusals
  • Evaluating retrieval and answers separately
  • Access control, freshness, cost and monitoring in production

You should be comfortable with Python, SQL basics and calling an LLM API. Experience with any web framework helps for the final section.

Who this course is for

  • Developers building document question answering or search features
  • AI engineers whose RAG prototype is not reliable enough
  • Data engineers preparing knowledge bases for AI use

Instructor

Elena Petrova

AI engineer teaching prompting, LLM APIs and retrieval apps that work in practice

  • 4.5 instructor rating
  • 22 reviews
  • 9,111 students
  • 3 courses
  • Sample

I build applications on top of large language models: assistants, document search and internal tools that save teams real time. I have learned most of what I teach by shipping features, watching them fail in odd ways and fixing them.

My courses are hands on and vendor neutral. We use the APIs from several model providers, compare results, and write small evaluations so you can tell whether a change helped.

I care about the unglamorous parts: cost, latency, privacy and knowing when a plain search or a simple rule is better than a model.

View profile

Student reviews

4.4 7 ratings
5 star 57%
4 star 29%
3 star 14%
2 star 0%
1 star 0%
Kathrin B. Sep 28, 2026
Sample

Retrieval first is the right focus

Our RAG demo looked fine until we measured recall. This course showed us exactly where it was failing.

Tariq S. Sep 17, 2026
Sample

Permissions handled properly

Filtering by access group inside the query was exactly the guidance our security team wanted.

Ola M. Sep 5, 2026
Sample

Hybrid search plus reranking works

Adding keyword search and a reranker fixed most of our failures with product codes.

Dev P. Aug 11, 2026
Sample

pgvector explained clearly

Great to keep everything in PostgreSQL. I would like more on scaling to millions of chunks.

Bruno C. Aug 5, 2026
Sample

Practical chunking advice

Heading paths in chunks were a small change with a big effect on our results.

Samantha Y. Jul 23, 2026
Sample

The evaluation section is excellent

Separating retrieval metrics from answer metrics changed how our team debugs RAG.

Leah N. Jul 15, 2026
Sample

Dense but valuable

A lot of material in each lesson. I needed to rewatch the evaluation part, but it paid off.

$79.99 Enroll now
SampleSample catalog: the instructors, courses, reviews and stats on this site are demo content.