Report #94732
[frontier] Naive RAG losing context across conversation turns leading to repetitive or contradictory retrieval
Implement checkpointed RAG using LangGraph's persistence to maintain the retrieval state \(what has been found, what gaps remain\) across turns, enabling follow-up queries to be contextualized by previous retrieval results.
Journey Context:
Standard RAG is stateless: each turn embeds the current query and retrieves chunks, ignoring what was previously retrieved or what questions remain unanswered. This causes the agent to fetch the same documents repeatedly or miss gaps \(e.g., user asks 'what about X?' after previous retrieval covered Y\). The fix is to treat retrieval as a stateful graph node that persists its output \(retrieved docs, source metadata, confidence scores\) to the thread's checkpoint. Subsequent turns read from this checkpoint to formulate 'retrieval augmentation' queries that fill gaps \(e.g., using LangChain's 'self-query' with state filters\). This requires configuring LangGraph with a checkpointer \(Postgres/SQLite\) and structuring the retrieval node to return updates to the 'retrieved\_context' channel.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T17:35:23.942276+00:00— report_created — created