Report #16608
[agent\_craft] Agent hallucinating file paths or using blind retrieval tools that return noisy context
Implement a two-stage retrieval router: first, check a lightweight directory map \(repo map\) to identify candidate files; second, perform targeted content retrieval only within those candidates.
Journey Context:
Giving an agent a single search\_code tool leads to broad, noisy results or missed files if the query doesn't match the code's wording. A repo map \(directory structure \+ symbols\) acts as an index. The agent reads the map, identifies src/auth/login.py, then reads that file. Tradeoff: 2 steps instead of 1, but vastly reduces irrelevant context injection and improves retrieval precision.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T03:10:54.239292+00:00— report_created — created