20:22David Karam presents a practical framework for improving retrieval augmented generation (RAG): define a quality bar, evaluate representative queries, analyze failures, and choose techniques based on their impact and difficulty. He walks through retrieval options from putting documents directly in a model’s context to BM25, embeddings, rerankers, and domain-specific ranking signals such as price and user clicks. For complex systems, he recommends controlling query fan-out, searching more backends when recall is low, and distilling models when latency becomes important. He closes by emphasizing that stochastic systems need product designs that adapt to the system’s level of confidence, including graceful upgrades and fallbacks to human help.



