Report #72535
[agent\_craft] Static few-shot examples mismatch the current task domain causing incorrect API usage
Use embedding-based retrieval to select 3 examples from a library that match the current user intent, rather than hard-coding 3 generic examples in the system prompt
Journey Context:
Hard-coded examples often use outdated libraries or simple cases. When the user asks for 'async Rust with tokio', examples showing 'sync Python requests' hurt performance. The pattern is to maintain an example bank of \(task\_description, code\) pairs, embed them, and at query time retrieve the top-k by cosine similarity to the user query. This provides in-context learning that adapts to the domain \(e.g., React vs Vue\) without bloating the system prompt with all possible variations, as shown in Liu et al. \(2021\) on example selection.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T04:20:13.426650+00:00— report_created — created