Why chat history changes the retrieval problem

Welcome! I'm Param, and in this workshop we are going to turn a full PDF book into an AI tutor that actually remembers your conversation. By the end, you will have a retrieval chain that handles follow-up questions, grounds every answer in real chunks, and reloads from disk in under a second.

Here is the failure mode. You ship a RAG demo. A user asks "what is a retriever?" and the answer is great. Then they ask "and how does it score results?" and the retriever searches for the literal text "how does it score results", which matches nothing useful, because the word "retriever" only exists in the previous turn.

Naive RAG versus conversational RAG

The conversational path rewrites the follow-up into a standalone query before retrieval.

Two reasons. First, the history is full of answer text, which pollutes the query vector with language from previous responses. Second, the history grows unbounded, and after a few turns the retriever is embedding a paragraph instead of a focused question. A standalone question rewrite keeps the query short, specific, and grounded in what the user actually wants next.

Quiz: Quiz

Loading practice…

AI prompt: Try it: rewrite a follow-up into a standalone query

Loading practice…