How do you implement conversational RAG with multi-turn context?
Conversational RAG maintains dialogue history to resolve coreferences and follow-up questions. Implementation: condense the current query with conversation history into a standalone query using an LLM ("Given this conversation, reformulate the latest question to be self-contained"). This standalone query then goes through normal RAG retrieval. Architecture: maintain a conversation buffer (last 5-10 turns), implement a condenser prompt that resolves pronouns and references ("What about their pricing?" becomes "What is Acme Corp's pricing for their enterprise plan?"), and cache previous retrieval results for rapid reference. Advanced patterns: maintain a conversation-level knowledge graph that accumulates facts across turns, implement topic tracking to detect conversation shifts and clear stale context, and use memory-augmented retrieval that boosts chunks related to entities mentioned in the conversation. Key challenges: context window management (prioritize recent turns and highly relevant history), latency (condensation adds one LLM call per turn), and error accumulation (incorrect condensation propagates). Solution: validate condensed queries against the original conversation before retrieval.