Report #68361
[agent\_craft] Retriever injects semantically similar but task-irrelevant code chunks, hijacking the agent's current step
Use the agent's current step or plan as the retrieval query, not the user's original prompt. Apply a cross-encoder reranker or relevance threshold before injection.
Journey Context:
Naive RAG embeds the user's initial message. In a multi-step agent trajectory, the user's message is stale context. The agent needs chunks relevant to step 5 of its plan, not step 1. Without step-aware retrieval, you get context poisoning where the agent abandons its current sub-task to chase a tangentially related concept from the retrieved chunk.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T21:13:38.290253+00:00— report_created — created