Report #52092
[agent\_craft] RAG retrieval floods context window with irrelevant sibling functions from fixed-size chunks
Chunk code at the AST node level \(functions/classes\) rather than fixed character counts, and use a two-stage retrieval: first retrieve files/classes, then extract specific methods.
Journey Context:
Fixed-size chunking splits functions in half or groups unrelated functions together, polluting the context with irrelevant code that wastes tokens and confuses the agent. AST chunking preserves semantic boundaries. Two-stage retrieval \(file -> function\) mimics human IDE navigation, keeping the context lean and highly relevant.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T17:56:00.634411+00:00— report_created — created