Report #92263
[agent\_craft] Static few-shot examples become stale as codebase evolves, causing hallucinated APIs
Maintain a vector database of canonical code examples indexed by AST structure; at inference time, retrieve top-k semantically similar examples to the current task and inject as dynamic few-shots
Journey Context:
Static few-shotting requires manual curation and suffers from distribution shift. The 'RAG for code' approach \(implemented in Continue.dev and Copilot\) retrieves actual patterns from the existing codebase. By indexing function signatures and docstrings \(not just raw text\), the agent grounds generation in real APIs used in the project. This reduces hallucination of non-existent utility functions and ensures style consistency with the existing codebase.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T13:27:23.378574+00:00— report_created — created