LangSmith
Company Announcements

Toward goal-oriented agent improvement with LangSmith Engine

Ben Tannyhill
December 3, 2026
12
min
Go back to blog

Modern agents are increasingly taking on work directly tied to business outcomes, from resolving customer requests to producing and shipping code. Improving the agent’s ability to execute those tasks requires investigating production traces, identifying what’s getting in the way, and determining whether changes to the agent helped.

We built LangSmith Engine as a persistent agent to pursue those improvements on your behalf. It investigates production traces, identifies gaps and opportunities, and recommends changes to your agent. Engine works continuously, making suggestions as your agent evolves.

Today we're launching Engine Goals, which enables Engine to work on higher order objectives on your behalf. With Goals, you tell Engine what you want to achieve, such as "resolve more support tickets on the first try" or "get more PRs merged." Engine uses that objective to decide where to investigate and which improvements to pursue.

Engine helps you define how to measure progress, focuses its investigations on that objective, and tracks progress as your team makes changes. You get recommendations connected to the outcomes you care about, with less time spent sorting through findings to decide what matters.

How to define Goals

To get started creating a Goal, you just describe your desired outcome in natural language. You can create a Goal in LangSmith, or by sending Engine a Slack message. Engine then helps you clarify the outcome you want and identify a metric to track it. Recording the Goal's metric on individual traces connects your agent's behavior to the outcomes your team cares about, helping Engine understand what success looks like and measure progress over time.

For example, the team building Content Studio, our internal design agent at LangChain, can start with “Generated content gets used in marketing campaigns.” Engine helps connect that objective to a measurable outcome: the percentage of generated content that is posted on LinkedIn and X. You can define multiple Goals to reflect the different improvements your team is working toward, so you can improve performance, cost, or anything else you care about simultaneously.

Engine helps establish how your Goal will be measured. It checks whether the metric is already available in trace data or feedback, or could be measured by an evaluator. If that signal is missing, Engine can help instrument your agent to capture it, including opening a PR to record the outcome as feedback on the relevant traces.

Once a Goal is defined, Engine groups relevant existing recommendations under it, uses the metric to inform future investigations, and tracks progress over time as your team makes changes.

Goals improve Engine in 3 major ways:

  • Prove impact: As Engine makes recommendations towards your Goals, you can understand how progress is made towards the metrics that are most important to your team, and how Engine has assisted in that progress.
  • Deliver more focused recommendations: Goals help Engine focus its analysis on the improvements your team is pursuing, so each recommended change makes tangible progress on your priorities.
  • Explore more solutions using a clear definition of success: A Goal gives Engine context for comparing traces with different outcomes and recognizing opportunities for improvements that are specific to your agent. In our Content Studio example, that means looking beyond whether content was generated to whether it was actually used.

Engine continues to look for important findings outside your Goals. It performs that broader analysis less frequently, keeping most of its effort focused on your priorities while maintaining coverage for critical recommendations.

Goals improving our internal agents

Let's walk through how Goals improve performance in practice. Content Studio is an internal agent that creates videos, social graphics, recreated UI images, slide decks, and more from just a prompt in Slack. To improve Content Studio, we use Engine to surface recommendations in service of specified Goals.

As mentioned, the primary Goal defined by our team building Content Studio is that “Generated content gets used in marketing campaigns.” This is determined by the percentage of content created by the agent that is posted to one of our social media channels.

When the team defined this Goal, Engine found that there was no trace-level indication of whether or not the content was being used, so Engine couldn’t compare interactions that produced published content with those that did not. But it did identify that Content Studio already recorded this information elsewhere and opened a PR to attach it to the corresponding traces as feedback. This gave the team and Engine a publication signal they could use to investigate outcomes and measure progress toward the Goal.

With social media post outcomes attached to traces, Engine can group similar requests and compare the execution paths that produced published content with those that did not. This gives Engine a way to investigate which differences in Content Studio’s behavior are associated with better outcomes.

For example, Engine identified a pattern in video-generation requests: videos that went through follow-up edits were less likely to be posted, even when those edits completed without errors. That narrowed the investigation to traces with revisions and gave Engine concrete examples to compare with interactions that produced published content.

Engine found that unpublished videos often went through several rounds of small revision requests. Comparing those traces with published videos revealed a pattern: requests like “change the closing slide” triggered regeneration of the entire video. The requested change would appear, but previously approved scenes, timing, or visuals would also change, creating another round of corrections. Content Studio was completing individual requests while making it harder for users to reach a finished result, and users would abandon their projects.

Engine generated a fix that preserved the existing video project and applied revisions only to the relevant scenes, reusing approved assets and leaving unrelated sections intact. Users could refine a draft without repeatedly losing the work they wanted to keep.

Engine identified revision requests that exposed this behavior and added them as new examples to Content Studio’s existing regression dataset. It then evaluated the fix against the full dataset before it shipped, checking that the requested edits were applied, unrelated content stayed intact, and existing cases continued to pass.

Goals change how Engine investigates traces

Improving our evaluations of Engine is central to expanding its abilities. We continually identify behaviors and gaps that Engine should be able to recognize and turn them into evaluation cases. These cases let us assess the breadth of Engine's recommendations and understand where its investigations fall short.

And as we've improved Engine, we've worked to guide it toward increasingly high-yield, low cost approaches. Although Engine has considerable freedom to investigate traces, with too little guidance, it leans heavily on a few methods of analysis that uncover only a narrow range of recommendations. With too much guidance, it follows prescribed methods more efficiently but misses related opportunities outside those instructions. The challenge is to provide enough structure to make investigations efficient while leaving room for discovery.

To expand Engine’s ability to recommend improvements to an agent’s capabilities, cost, and efficiency, we developed a broader range of analytical approaches that Engine could utilize. Along the way, it became harder to describe exactly what Engine was doing under the hood. Different methods of analysis overlapped, and we hadn’t clearly articulated where one approach ended and another began.

We stepped back to catalogue the analysis methods Engine was already using. Naming and describing these approaches gave us a clearer way to evaluate their strengths, understand their limitations, and refine them to uncover a broader range of opportunities. Engine remains free to decide when and how to use those methods as an investigation unfolds.

Engine can draw on a range of analysis methods. A few examples include:

  1. Examine the use of each tool call, latency, the number of turns, and token usage to identify large changes in the agent's behavior.
  2. Analyze user messages for signs of dissatisfaction.
  3. Group execution paths to understand how an agent approaches similar requests, including cases where it takes a more complicated or expensive route.

Each method gives Engine a different perspective on the same traces, helping it identify opportunities relevant to a Goal. A cost investigation might combine changes in token usage with a comparison of execution paths. An investigation into user satisfaction might combine user feedback with a review of what the agent delivered. Engine can bring these perspectives together as the evidence develops.

Explicitly defining these methods of analysis gives us a more precise way to improve Engine. Our evaluations include many different opportunities we want the agent to recognize. When Engine identifies one opportunity but misses a related case, we can examine the analysis method it used. What did it look for, what assumptions did it make, and how could that method be adjusted to apply more generally?

We can then refine the method and evaluate it across related cases. This helps us build guidance that is specific enough for efficient investigations but general enough to support broader discovery.

A Goal gives Engine context for choosing what to investigate and how to interpret the evidence it finds. Engine can use the recorded metric to compare traces with different outcomes, grouping similar requests and execution paths to make those comparisons more useful. It can then examine where the paths diverge, read the relevant traces and code, and investigate which differences across outcomes suggest an opportunity to improve. Engine remains free to choose and combine analysis methods as the investigation develops.

Engine keeps pursuing a Goal as new traces and feedback arrive. It searches for new opportunities for improvement and tracks the Goal’s metric as your team makes changes, giving you an ongoing view of progress.

Clarification about the Goal can also continue during an investigation. When the agent’s expected behavior is unclear from the system prompt or application code, Engine can ask whether a capability should be supported, whether a behavior is intentional, or how an outcome should be interpreted. Your answers give it additional context to carry into its investigations and recommendations.

Why benchmarks fall short

Many of our customers have designed thorough offline evaluations for their agents. These evals let teams understand the impact of agent changes, prevent regressions, and check whether an agent's behavior and outputs meet their defined criteria before releasing changes. Offline evals are critical to Engine's own development.

But strong performance on evals doesn't always translate into the outcomes a team cares about in production. A coding agent may solve increasingly difficult problems from a benchmark while producing PRs that users rarely merge. A sales agent may draft prospect outreach that meets every criteria defined in evals, only for reps to rewrite or abandon it.

Offline evals provide valuable feedback about how an agent performs against a defined set of tasks, while Goals give Engine context about what success in production looks like for your agent. These signals complement each other: evals help teams ship changes with confidence, while production outcomes reveal the needs and opportunities that existing tests may not capture. By tracking feedback against a Goal, your team can ensure that the outcome you care about is improving when your most challenging evals scores are improving offline.

Conclusion

Our vision for Engine has always been a system of infinite, autonomous improvement of our agents, built on top of traces. As we've built Engine, we've continuously improved the system's ability to find optimizations of different kinds.

This is why we built Goals. Engine is the agent for agent engineering, and just as agent engineers work not only to beat their latest benchmark, but to define, track, and improve against production outcomes, Engine does too.

You can try Engine today in LangSmith. We’re offering Engine for free to all new LangSmith Plus users through the end of the year.

See what your agent is really doing

LangSmith, our agent engineering platform, helps developers debug every agent decision, eval changes, and deploy in one click.