Report #12596
[agent\_craft] Static few-shot examples cause API version drift and outdated coding patterns in generated code
Replace static few-shot prompts with dynamic retrieval: embed the current task, retrieve relevant examples from current codebase/docs using vector similarity, and inject those as context-specific few-shot examples
Journey Context:
Hard-coding few-shot examples in the system prompt leads to stale patterns when APIs evolve \(e.g., using deprecated OpenAI \`functions\` instead of \`tools\`\). Static examples also may mismatch the current domain. Dynamic retrieval ensures examples are current \(pulled from the same repo's recent commits\) and task-relevant. The tradeoff is latency \(embedding \+ search time\), but for coding agents, correctness trumps speed. This also scales to arbitrarily large example sets without context overflow.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T16:22:40.371268+00:00— report_created — created