# Building Engine v2: How LangChain approaches agent improvement
<!--
ref: @content/youtube/langchain/2026-10-07-building-engine-v2-how-langchain-approaches-agent-improvemen
tags: [agent-improvement, trace-analysis, evals, benchmarks, regression-testing, red-teaming, model-selection, langsmith]
version: 2
updated_at: 2026-11-21T19:59:17.730Z
-->

**[Watch on YouTube](https://www.youtube.com/watch?v=S3l7U7gOsyY)**


*Synthesized from Ben, a product manager at LangChain, in his talk on LangChain, 2026-10-07.*

Ben, who gives only his first name, is a product manager at LangChain working on Engine, the company's agent for developing agents; he was introduced by Harrison, who gave the keynote at the same event.

## Core Thesis
Ben argues that improving an agent that automates a long, varied lifecycle (finding failures, diagnosing, fixing, and testing) depends on building a separate benchmark for each task and on dogfooding the product on LangChain's own agents. Engine v2 extends from suggesting fixes to proving them, and from reading single traces to spotting problems visible only across many traces or over time.

## Key Insights
- **What Engine does:** it detects problematic traces, clusters them by root cause, writes a human-readable description of the issue, compares trajectories to the agent's source code to propose a fix, builds example datasets from production inputs, and tracks regressions. Launched in May, it has scanned over 70 million traces and created over 21,000 issues for customers.
- **One benchmark per task:** the tasks differ enough that each gets its own eval. A needle-in-a-haystack benchmark checks whether Engine finds traces with embedded problems; another gives it known failing traces plus existing issues and tests whether it matches them or creates new ones.
- **Benchmarks versus production:** every benchmark change must also hold up in real use. LangChain runs Engine on its own go-to-market agents (outbound requests, lead research) and Slack- or GitHub-invoked coding agents, with findings posted to Slack for those teams to rate.
- **Meta-engine:** Engine scans the traces created by Engine running on those agents, and its notifications also arrive in Slack. This is now a main way the team finds improvement opportunities.
- **Model choice:** different tasks need different intelligence; a smaller non-frontier model can be cheaper and, for simple tasks, more efficient than expensive frontier models, so the team keeps swapping models per task.
- **Tooling and results:** the team leans on LangSmith for manual trace review and for its experiment platform, which records cost and benchmark performance over time. Per Harrison's keynote, v2 reaches about twice the bug identification on Issue Bench, the primary problem-detection benchmark, and also improves on coding-standard and agent-specific fix benchmarks.
- **New problem classes in v2:** v1 caught defects visible in one trace, such as hallucination, broken tool calls, cyclical tool calls or context explosion. v2 adds trend and context detection, for example a model swap between September 1 and 14 where cost and latency fail to drop and tool calls per run quietly rise (say from 6 to 19). It also flags inefficient paths, such as an agent that takes a "side quest" through unneeded tools on about 5% of queries.
- **Tested fixes (closed beta):** Engine finds an issue, replays the offending production input against the current production agent to confirm it is persistent, deploys the proposed fix to a preview branch on the LangSmith deployment platform, reruns the breaking inputs, and then runs a wider dataset to check for regressions. The user receives a proven issue with a verified fix while staying in control; Ben calls it a first step toward continuous learning for agents.
- **Red teaming (closed beta):** Engine hypothesizes inputs that could break an agent from its system prompt and context, probes the deployed agent, groups failures into issues, and attaches fixes before customers hit them.
- **v3 direction:** wider deployment-stack coverage, a base eval set generated automatically to guard expected behaviors, and bigger proposals such as swapping the whole model with a validated claim that it is faster and cheaper on the customer's own evals. A bring-your-own-key option for Engine arrives in the next self-hosted release.

## Actionable Takeaways
1. Build a dedicated benchmark for each sub-task of an agent pipeline, not one aggregate score.
2. Run your agent-improvement tooling on your own agents and route its findings to Slack for rating.
3. Test cheaper or smaller models per task, since simple tasks often do not need a frontier model.
4. Track metrics like tool calls per run across model or prompt changes, not just individual traces.
5. Reproduce a failing input against production, apply a fix on a preview branch, rerun that input, then run a broader regression set before shipping.

## Notable Quotes
> "We are actually running an engine on top of an engine." — Ben, LangChain product manager
> "Different tasks apparently require different levels of intelligence." — Ben, LangChain product manager

---

*Related: `@content/web/huggingface/2026-11-23-cua-see-self-evolving-evals` · `@content/youtube/yifan-bth/claude-code-beat-cursor-4-2-heres-why-im-still-using-both` · `@content/youtube/eo-global/the-problem-with-ai-agents-no-one-is-talking-about-yutori-abhishek-das` · `@content/youtube/nate-herk/5000-hours-of-building-ai-in-just-17-minutes` · `@content/youtube/cole-medin/this-completely-changes-the-way-we-build-production-ai-agents-vercel-eve`*

---

*You're reading a protocol on [protocol.supply](https://protocol.supply) — hosted, searchable knowledge for AI agents. Think Agent Skills, as an API: bootstrap once (`curl -sL https://api.protocol.supply/bootstrap`), search (`/search?q=…`), fetch (`/@repo/slug`).*

*Any skill can become a protocol, and any protocol installs as a local skill — tell your agent "install this as a skill" or see [`@protocol/protocol-to-skill`](https://api.protocol.supply/@protocol/protocol-to-skill).*