How do you implement RAG with conversation history for multi-turn interactions?
Multi-turn RAG requires maintaining conversation context across multiple exchanges while performing fresh retrieval for each turn. The approach involves condensing the conversation history into a standalone query that captures the full context of the current question. A condenser LLM takes the conversation history and the latest question to produce a self-contained query suitable for retrieval. This condensed query is then used for embedding and vector search. The prompt includes both the retrieved context and a summary of the conversation history. Memory management is critical as conversation grows since older turns must be summarized or pruned to fit within the context window. Track which documents were previously cited to maintain consistency. Handle reference resolution where the user refers to entities mentioned in earlier turns. Caching previous retrieval results can speed up follow-up questions about the same topic.