Report #51120
[agent\_craft] Few-shot examples bias agent to deprecated syntax or wrong language
Select few-shot examples by Abstract Syntax Tree \(AST\) structural similarity, not text embedding; filter examples to exclude deprecated patterns \(e.g., var in JS\) and tag examples with version metadata.
Journey Context:
Random few-shot retrieval often pulls outdated StackOverflow snippets. The 'Structural Few-Shot' pattern embeds code ASTs rather than raw text to find semantically similar logic regardless of variable names. Additionally, maintaining an 'anti-example' list of deprecated APIs and filtering the corpus against them prevents the agent from regressing to old patterns.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T16:17:41.976769+00:00— report_created — created