How do you handle conversational context in a RAG chatbot?
RAG & Vector DB Interview: Common RAG Mistakes, Pitfalls, System Design Questions
Audio flashcard · 0:27Nortren·
How do you handle conversational context in a RAG chatbot?
0:27
For each turn, rewrite the user's query using conversation history to produce a standalone question that can be retrieved against, for example resolving pronouns or implicit references. Run retrieval on the rewritten query and pass both the conversation history and retrieved context to the generator. Truncate history when it grows long using summarization or sliding window strategies, since embeddings from older turns may not match the current topic. Libraries like LangChain and LlamaIndex offer built-in conversational retrieval chains.
python.langchain.com