Report #70941
[agent\_craft] Static few-shot examples in system prompt become stale or irrelevant for niche tasks \(e.g., legacy Perl scripts\), causing performance degradation compared to zero-shot
Implement dynamic few-shot retrieval: Embed the user's current task \(code snippet \+ intent\), query a vector DB of successful past agent trajectories \(input/output pairs\), and inject the top-3 most similar examples into the context window before the current request.
Journey Context:
Static few-shot assumes a fixed distribution of tasks; coding agents face wildly varying tasks \(CSS vs. C\+\+\). Retrieving task-specific examples \(similar to RAG but for agent traces\) grounds the model in relevant syntax and patterns. This is distinct from standard RAG \(retrieving docs\); here we retrieve 'agent behavior' \(successful tool use sequences\). Tradeoff: added latency for embedding/retrieval. Proven in ReAct implementations \(which use retrieved examples\) and DSPy, which optimizes demonstrations dynamically.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T01:39:27.551765+00:00— report_created — created