Part 8 · Embeddings · ingestion · hybrid search · pgvector · evaluation · advanced RAG
Retrieval-augmented generation
Grounding model answers in your own documents: from embeddings and chunking to hybrid retrieval, permissions, evaluation and graph-based retrieval.
L4 · Applied AI engineer
RAG (retrieval-augmented generation) is the most common production pattern in applied AI: find the relevant pieces of your own data, put them in the context, and have the model answer from them, with citations.
It's also where many AI projects quietly fail: retrieval misses the right passage, the wrong tenant's document leaks in, or nobody measures quality. This part builds the pipeline step by step and ends with how to evaluate and debug it.
Say: "An unevaluated RAG system is a demo."
Lessons in this part
- 8.1Embeddings and vector searchWhat embeddings are, similarity metrics, approximate nearest-neighbour indexes, and the limits of dense retrieval.L4 · Applied AI engineer5 min
- 8.2Ingestion and chunkingGetting documents in cleanly: parsing, metadata, structure-aware chunking, deduplication, versioning, updates and deletion.L4 · Applied AI engineer5 min
- 8.3Hybrid search and re-rankingCombining dense and lexical retrieval with Reciprocal Rank Fusion, then re-ranking with cross-encoders or late-interaction models.L4 · Applied AI engineer5 min
- 8.4Vector stores and pgvectorChoosing a vector store, modelling chunks in Postgres with pgvector, filtered search, and tenant-safe retrieval with row-level security.L4 · Applied AI engineer5 min
- 8.5Evaluating and debugging RAGThe end-to-end pipeline, separate metrics for retrieval and generation, a debugging method that isolates the failing stage, and hallucination containment.L4 · Applied AI engineer5 min
- 8.6Advanced RAG: query rewriting, graphs and agentic retrievalQuery transformation, metadata and temporal filters, knowledge-graph retrieval for multi-hop questions, and letting an agent decide what to retrieve.L4 · Applied AI engineer5 min