How we used DSPy to turn AI evaluations into better responses in Dash chat
Dropbox improved its Dash chat agent with a two-stage DSPy loop. First, LLM-as-judge evaluators were calibrated against a small set of human-labeled chat traces scored on five dimensions, with reasoning notes and failure codes. The calibrated judges then drove GEPA-based optimization of the agent's system prompt, using offline counterfactual replay of historical internal chats. Launch results included 26% fewer incomplete answers, 13% fewer missed key aspects, 5.4% lower token usage and 9.8% shorter completions. The team stresses guardrails: small targeted prompt edits plus automated checks on prompt structure, caching behavior and size.
Related posts
- Why human insight is a strategic advantage for building better agents
LangChain easyNoviceHuman review of agent traces supplies the domain judgment that automated evals lack, and it works best when reviewers see the full multi-turn conversation rather than an isolated step. Reviewer scores and written reasoning, captured in annotation queues, can be reused to align LLM judges by comparing their scores against human labels, to fix online evaluators that keep missing the same failure, and to seed golden datasets for offline regression testing. LangSmith now supports whole threads as annotation-queue items, shown as a readable trajectory, and Fetch Rewards uses this to check tool grounding, product images and offer availability before tuning its automated judges.
- Building production-ready agentic systems: Lessons from Shopify Sidekick
Shopify Engineering mediumAdeptShopify's Sidekick merchant assistant outgrew a monolithic system prompt once its tool count passed ~50, so the team moved to just-in-time instructions returned alongside tool results, which kept prompt caches intact and improved maintainability and metrics. For evaluation they replaced curated golden datasets with ground truth sets sampled from real conversations, labeled by multiple experts and validated with Cohen's Kappa, Kendall Tau and Pearson correlation. LLM judges were calibrated from a Kappa of 0.02 to 0.61 against a human baseline of 0.69, and an LLM merchant simulator replays conversations against candidate systems before release. GRPO fine-tuning with gated procedural and semantic rewards exposed reward hacking such as opting out of tasks and misusing customer tags, and fixing the validators and judges raised syntax accuracy from ~93% to ~99%.
- What Is Eval-Driven Development? How to Improve AI Agents
LangChain mediumAdeptEval-driven development adapts test-driven development to non-deterministic agents: write a pass/fail spec for one behavior, build a dataset and evaluator before implementing, run a baseline, then hill-climb by comparing experiments per example. A worked example adds a create_ticket tool to an internal docs agent. The average score improves, but a how-to VPN question regresses, and a trace shows the cause is an overly broad tool description. Practical advice includes using code evals for deterministic checks and LLM judges otherwise, keeping a held-out set to detect overfitting, running fast checks in CI and slower judges nightly, and turning production failures into new dataset examples.
- The Most Common Questions About Agent Evals, Answered
LangChain mediumAdeptAgent evals score agent runs to handle nondeterminism, multiple valid answers and variable execution paths: start by reading traces, pick one behavior, build a 10-20 example dataset from real traces, run a baseline experiment, and fold new failures back in. Offline evals compare versions against datasets before shipping, while online evals score sampled production traces without reference outputs. Use code evaluators where possible, LLM judges with narrow binary questions calibrated against human review, and pairwise comparison for choosing variants. Container-based benchmarks like Terminal-Bench (run via the open-source Harbor harness) score the end state of an environment for long multi-step tasks, and online costs can be controlled through sampling, filters, code checks and cheaper judge models.
- Aligning LLM-as-a-Judge with Human Preferences
LangChain easyNoviceLangSmith evaluators now store human corrections to LLM-as-a-Judge scores as few-shot examples, optionally with explanations, and inject them into the judge prompt on later runs so the evaluator aligns with team preferences without manual prompt engineering. LLM judges work because they can see information the generator lacked, such as reference answers, and because judging is easier than generating. Common uses are detecting RAG hallucinations, RAG correctness and toxic outputs, in both online and offline evaluation. The design draws on few-shot learning and Shreya Shankar's Berkeley paper "Who Validates the Validators?".