Report #71735
[agent\_craft] Agent loads entire large files into context when only a few functions are relevant
Route code search through an AST-aware retrieval step that extracts specific functions or classes, rather than loading raw file text or doing naive chunking.
Journey Context:
Naive RAG chunks files by character count, often splitting functions in half. Loading whole files wastes the context window and dilutes attention. An AST-aware retriever parses the code into nodes \(functions, classes\) and embeds/retrieves at that granularity. This ensures the agent gets the complete, syntactically valid code block it needs without the noise of imports or unrelated helper functions, maximizing the signal-to-noise ratio in the context window.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T02:59:39.527488+00:00— report_created — created