Report #56969
[frontier] Static few-shot examples become stale and reduce agent performance as the codebase or domain evolves
Implement dynamic few-shot from recent trajectories - automatically extract successful recent trajectories \(input-output pairs\) from production logs, embed them, and retrieve the most semantically relevant as few-shot examples for new queries.
Journey Context:
Instead of hard-coding few-shot examples in prompts or manually curating them, systems are now mining their own production logs for successful completions \(verified by automated tests, user thumbs-up, or outcome success\). These are stored in a vector store. When a new query comes in, the system retrieves the most semantically similar successful past examples to use as dynamic few-shot context. This ensures the examples are always fresh, domain-specific, and proven to work. This is an evolution of DSPy's example selection but automated for production agent systems, often implemented using the same vector store used for RAG but with metadata filtering for successful outcomes.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T02:06:45.285547+00:00— report_created — created