Report #43851
[agent\_craft] Agent router selects a generalized knowledge base instead of a specific local codebase index, injecting irrelevant context
Implement a two-stage router: first classify the intent \(e.g., syntax lookup vs project architecture\), then route to the appropriate retriever. Add few-shot examples of ambiguous queries and their correct routing to the router's prompt.
Journey Context:
A single embedding model for all retrievers often fails because a general programming question \(e.g., how to use asyncio\) and a project-specific question \(e.g., where is the database connection initialized\) can have similar vector representations. Routing the project-specific question to a general docs retriever injects irrelevant context and wastes tokens. The tradeoff is the latency of an extra LLM call for intent classification, but it prevents catastrophic context dilution from the wrong knowledge base.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T04:04:27.529081+00:00— report_created — created