Building Production-Grade AI Agents with Observability, Evaluation, and Insights

langchain · Tech · 2025 · source Agentic: yes · promotional bias: high · source-backed · extracted with prompt 0.5.5 (schema v2)

Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.

Problem

Domain: Agent observability and evaluation

LangChain needed LangSmith to support teams moving from prototype agents to production systems with millions of traces, where developers must debug exact agent behavior, discover unknown production patterns, evaluate multi-turn sessions, and turn bad interactions into regression tests.

Constraints:

Architecture

LangSmith combines tracing, offline eval datasets, prompt playground/hub, production trace ingestion, Insights, threads, thread-based evals, online evals, dashboards, automation rules, and trace-to-dataset flows. Tracing captures the exact steps of agent execution. Insights automatically clusters and categorizes production traces to reveal user/product usage, agent errors, hallucinations, wrong-tool patterns, retrieval failures, and unknown question types. Threads group related traces by conversation or session so evaluators and dashboards can judge multi-turn behavior. Offline evals remain regression tests, while online evals run in real time over production traces.

Diagram confidence: reconstructed (reconstructed from prose).

flowchart LR
  production-agent["Production agent"] --> trace-ingestion["Trace ingestion"]
  production-agent --> thread-identifiers["Thread identifiers"]
  production-agent --> online-evaluators["Online evaluators"]
  trace-ingestion --> tracing-debugger["Tracing debugger"]
  trace-ingestion --> insights-engine["Insights engine"]
  trace-ingestion --> dataset-builder["Dataset builder"]
  tracing-debugger --> prompt-playground["Prompt playground"]
  prompt-playground --> prompt-hub["Prompt hub"]
  prompt-playground --> offline-eval-runner["Offline eval runner"]
  prompt-hub --> offline-eval-runner
  dataset-builder --> offline-eval-runner
  insights-engine --> insight-configuration["Insight configuration"]
  insights-engine --> product-usage-analysis["Product usage analysis"]
  insights-engine --> error-analysis["Error analysis"]
  insights-engine --> dashboards["Dashboards"]
  error-analysis --> dataset-builder
  thread-identifiers --> thread-store["Thread store"]
  thread-store --> thread-eval-runner["Thread eval runner"]
  thread-eval-runner --> online-evaluators
  thread-eval-runner --> dashboards
  online-evaluators --> dashboards
  offline-eval-runner --> dashboards
  dashboards --> automation-rules["Automation rules"]
  automation-rules --> dataset-builder
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
Production agent Customer LLM/agent application producing prompts, model calls, tool calls, traces, sessions, and user interactions. Trace ingestion, Thread identifiers, Online evaluators
Trace ingestion Collects traces from production agents and development runs into LangSmith. Production agent, Tracing debugger, Insights engine, Dataset builder
Tracing debugger Shows exact execution steps for debugging agent behavior and production observability. Trace ingestion, Prompt playground
Prompt playground Lets product and nontechnical users iterate on prompts and kick off experiments. Tracing debugger, Prompt hub, Offline eval runner
Prompt hub Stores prompt artifacts and supports prompt iteration workflows. Prompt playground, Offline eval runner
Dataset builder Turns traces and bad production interactions into evaluation datasets. Trace ingestion, Offline eval runner, Automation rules
Offline eval runner Runs datasets of known examples through metrics and evaluators for regression testing before shipping. Dataset builder, Prompt playground, Dashboards
Insights engine Automatically discovers trends, usage categories, error modes, hallucinations, wrong-tool behavior, and unknown question types from trace data. Trace ingestion, Insight configuration, Dashboards, Dataset builder
Insight configuration Lets users specify what their agent does and what insights they care about, guiding the LLM-based insight generation algorithm. Insights engine
Product usage analysis Insight mode that categorizes which product areas users engage through an embedded agent or copilot. Insights engine, Dashboards
Error analysis Insight mode that categorizes wrong tools, explicit errors, hallucinations, and frequent failure modes. Insights engine, Dashboards, Dataset builder
Thread identifiers User-defined UUIDs that group related traces into conversations, sessions, or other logical relationships. Production agent, Thread store
Thread store Maintains sequences of related traces for conversation/session-level evaluation and metrics. Thread identifiers, Thread eval runner, Dashboards
Thread eval runner Evaluates multi-turn behavior such as sentiment, tool-call trajectory, repeated tool loops, and end-to-end user experience. Thread store, Online evaluators, Dashboards
Online evaluators Run real-time production evaluations as traces arrive, including thread-level checks. Production agent, Thread eval runner, Dashboards
Dashboards Surface trace, eval, thread, cost, and analytics metrics over time. Insights engine, Offline eval runner, Thread eval runner, Online evaluators, Automation rules
Automation rules Automate workflows such as spot-checking production threads with negative feedback or moving traces/threads into datasets. Dashboards, Dataset builder

Data flow

An agent or LLM application sends traces to LangSmith, including prompts, model calls, tool calls, payloads, and session identifiers. Tracing lets engineers debug individual runs. Offline eval flows build datasets of known examples and run metrics/evaluators. Production trace streams feed Insights, which categorizes trace patterns for product usage and error analysis, and those discoveries can become new eval monitors or regression datasets. Thread UUIDs group related traces into conversations or sessions, enabling thread-level metrics, sentiment checks, tool-trajectory evals, online production evaluators, dashboards, spot-checking workflows, and automation rules.

6 supporting quotes
“tracing was one of the first things we added just like seeing the exact steps of what went into your agent and why.”transcript, stated
“offline evals where you'd create a data set and then define some metrics and run it against that. And that's like the equivalent of like unit tests and and kind of like software. Uh we added in a prompt playground because we saw a lot of demand to bring kind”transcript, stated
“thing called insights and and we can dive into it in a bit. But the high level idea is that we are going to automatically find trends for you in your traces that either indicate to you these are the types of ways your end users are interacting with your agent. These are the questions”transcript, stated
“threads are totally customizable. Um it's really just unique UU IDs that you add uh to traces, >> but it's like a sequence of repeated traces that you can stack up on top of each other and have the same context conversation some somehow related. >> Exactly.”transcript, stated
“the online evals piece comes in um is building up uh evaluators that measure your agents performance in real time as traces are coming in. Uh, and again, threads are are a really great unit to use for this because if I want to uh let's use that user sentiment example again. If I want to measure user”transcript, stated
“every time you see a bad interaction in uh production and and those can go back into an offline data set and then those offline evals serve as regression tests every single time you want to ship a new version of your application. So, it's like there there's”transcript, stated

Why this architecture

LangSmith pairs discovery and evaluation because production agents create both known risks and unknown interaction patterns. Traces give run-level debuggability, Insights bubbles up patterns teams did not predefine, thread evals capture multi-turn behavior, online evals monitor live traffic, and offline evals preserve known failures as regression tests for future versions.

5 supporting quotes
“to bring out the reliability in in your agents as you build them. And we've we've added in more and more features and we're launching a bunch of new ones this week. And so we're going to talk about that. Uh my name is Harrison. I'm the co-founder and CEO of uh Langchain and have been”transcript, stated
“insights is really about discovery and it's often about sort of like the known unknowns or the unknown unknowns.”transcript, stated
“With eval sort of know what you're hoping to find um and you can define it well up front and then you can run that over your traces. with insights. The idea is we just have a lot of this like trace data and we're trying to bubble up something interesting out”transcript, stated
“that measure your agents performance in real time as traces are coming in. Uh, and again, threads are are a really great unit to use for this because if I want to uh let's use that user sentiment example again. If I want to measure user sentiment after I just shipped”transcript, stated
“those offline evals serve as regression tests every single time you want to ship a new version of your application.”transcript, stated

Models used: LLM-based Insights algorithm · Online evaluators · Offline evaluators · LangSmith agent traces

Scale

Alternatives considered (roads not taken)

Only inspect individual traces manually

Rejected because: At millions of traces per day, customers need automated trend discovery and categorization across production traffic.

“we're we're getting these millions of traces a day. Like, how can we help people get more value over them and find more insights”transcript, stated
“insights and and we can dive into it in a bit. But the high level idea is that we are going to automatically find trends for you in your traces that either indicate to you these are the types of ways your end users are interacting with your agent. These are the questions”transcript, stated

Use evals alone for all quality work

Rejected because: Evals test known expectations, while Insights discovers patterns and unknown unknowns that teams did not define ahead of time.

“With eval sort of know what you're hoping to find um and you can define it well up front and then you can run that over your traces. with insights. The idea is we just have a lot of this like trace data and we're trying to bubble up something interesting out”transcript, stated
“we're trying to bubble up something interesting out of it and discover patterns out of it. And then oftentimes once you know of those patterns then you can go translate them into eval uh if if there's for example some like failure mode that you want to have”transcript, stated

Evaluate only single turns or single traces

Rejected because: Sentiment, tool-call trajectories, repeated tool loops, and full user experience require thread-level context.

“if you want to evaluate uh end to end user interaction, so something like what was user sentiment across this entire thread”transcript, stated
“and then and then dig into the tool calls are made. is agent getting stuck somewhere and and doing the same tool call over and over again. So um it's complimementaryary to kind of single turn evals um but it's a different lens of looking at things. >> So so we've talked about evals for threads. One”transcript, stated

Replace offline evals with A/B or online testing only

Rejected because: The team argues offline evals remain useful as regression tests, even though they cannot fully cover production behavior.

3 supporting quotes
“out with a with a with a spicier question. There's been some takes online recently that like evals are dead. All you need is kind of like AB testing and online testing. How do you guys think about that? >> It it's a provocative take that doesn't like it seems way too black and white to me.”transcript, stated
“is going to behave the way you want them to. And therefore offline evals are useless. And that just seems like um one it's super domain dependent like it depends on exactly what your agent is doing. I think in some cases agents are very narrow and you can't actually”transcript, stated
“like there there's nothing that binary about it. And it seems sort of obvious to me that like some form of offline emails is always going to be useful. And then yeah, the there's also like people say emails are dead. I think they're usually referring to offline emails. Online”transcript, stated

Assume the same trace structure as chatbot conversations

Rejected because: Modern agents include background agents and arbitrary payloads, so Insights had to generalize beyond chat history.

“What an agent looks like today is is sort of like very diverse and increasingly diversifying. It's not just chat bots anymore. There's sort of like background agents that are, you know, there's no like chat history for for us to really be looking at to”transcript, stated
“What an agent looks like today is is sort of like very diverse and increasingly diversifying. It's not just chat bots anymore. There's sort of like background agents that are, you know, there's no like chat history for for us to really be looking”transcript, stated

Patterns

observability-tracing (operations)

LangSmith traces exact agent execution steps so teams can debug and observe production LLM applications.

“tracing was one of the first things we added just like seeing the exact steps of what went into your agent and why.”transcript, stated
“And now we see a lot of folks going into production um and so we have you know tracing very related to kind of like production observability.”transcript, stated

eval-driven-development (evaluation)

LangSmith supports offline datasets, online evaluators, thread evals, and regression tests for shipping new versions of agent applications.

“offline evals where you'd create a data set and then define some metrics and run it against that.”transcript, stated
“those offline evals serve as regression tests every single time you want to ship a new version of your application.”transcript, stated

llm-as-judge (evaluation)

Evaluators are applied to traces and threads to score sentiment, tool trajectories, performance, and production behavior.

“building up uh evaluators that measure your agents performance in real time as traces are coming in.”transcript, stated
“Um or if you're running evaluations across threads, you want to see that data over time and plan it over time. So we'll be doing a lot of work to uh introduce new kind of agent thread level metrics into our dashboards.”transcript, stated

data-quality-loop (learning)

Bad production interactions and discovered failure modes are converted into datasets and future regression evals.

“every time you see a bad interaction in uh production and and those can go back into an offline data set”transcript, stated
“then you can go translate them into eval uh if if there's for example some like failure mode that you want to have a better monitor on going forward.”transcript, stated

prompt-versioning (development)

Prompt playground and prompt hub allow product and nontechnical stakeholders to iterate on prompts and kick off experiments.

“we saw a lot of demand to bring kind of like product and other nontechnical people into the product”transcript, stated
“Uh we added in a prompt playground because we saw a lot of demand to bring kind of like product and other nontechnical people into the product um and have them iterate on prompts and even kick off experiments. And so we have a prompt playground and prompt hub now.”transcript, stated

observability-tracing (insights)

Insights categorizes production traces into usage and error patterns so teams can find unknown unknowns at scale.

“we are going to automatically find trends for you in your traces”transcript, stated
“is making a mistake where it is using the wrong tools where it is explicitly erroring whatever it may be and can you like categorize those types of failure modes for us and and give us examples of where those are happening that's another good example are these like customizable like if I want to”transcript, stated

Tradeoffs

Use Insights for discovery and evals for known checks.

Chose A two-layer loop where unknown patterns become future evals over Treating discovery and evaluation as the same job.

Rationale: Insights finds unknown patterns in traces; evals then monitor specific known behaviors or failures.

“insights is really about discovery and it's often about sort of like the known unknowns or the unknown unknowns.”transcript, stated
“once you know of those patterns then you can go translate them into eval”transcript, stated

Evaluate complete threads when interaction quality spans multiple traces.

Chose Thread-level evals and metrics over Only single-trace evals.

Rationale: Whole-session checks capture sentiment, tool trajectories, loops, and user journeys that are invisible in isolated turns.

“threads are totally customizable. Um it's really just unique UU IDs that you add uh to traces”transcript, stated
“it's complimementaryary to kind of single turn evals um but it's a different lens of looking at things.”transcript, stated

Keep offline evals despite incomplete coverage.

Chose Offline regression sets plus online evals over A/B testing and online testing only.

Rationale: Offline evals cannot guarantee full production coverage, but they still protect known important behaviors when shipping new versions.

“just because you can't get complete coverage of every type of interaction doesn't mean it's not still worth enumerating the types of interactions that you know of”transcript, stated
“Online emails are also a thing. Online emails, I think, are especially useful”transcript, stated

Make Insights configurable rather than fully automatic.

Chose Built-in modes plus user-exposed algorithm knobs over Opaque automatic categorization.

Rationale: Users know their agent domain and can guide the insight algorithm toward relevant patterns.

“there's a few sort of like built-in modes like this product usage and error analysis mode.”transcript, stated
“we also expose a lot of the knobs of this algorithm to you as the Langmith user”transcript, stated

Turn production failures into regression data.

Chose Trace/thread-to-dataset flows over One-off manual debugging of each bad interaction.

Rationale: Once a bad production interaction is known, it should guard future releases rather than only fixing the immediate incident.

“Second thing is we have you know this whole flow of you go from traces to a data set or you go from traces to maybe you havememes that are reviewing data um and we want to enable that over threads as well.”transcript, stated
“those offline evals serve as regression tests every single time you want to ship a new version”transcript, stated

Gotchas (what bit them)

Trace volume hides the important patterns.

Root cause: Production customers have millions of traces per day, making manual inspection insufficient for usage and error discovery.

Resolution: Add Insights to automatically categorize user behavior and agent failure modes across traces.

“I've got so much rich information in Langmith. Can you tell me something interesting about how my users are interacting with my agent?”transcript, stated
“automatically identify the places where my agent is making a mistake where it is using the wrong tools”transcript, stated

Insights over arbitrary agent payloads are harder than chatbot analytics.

Root cause: Agents now include background agents and non-chat payloads without a simple conversation history.

Resolution: Generalize the category-discovery algorithm beyond chatbot conversations and let users provide agent-specific context.

“Well, um I think the hardest part was and is that um we are sort of dealing with arbitrary agent payload. What an agent looks like today is is sort of like very diverse and increasingly diversifying.”transcript, stated
“there's no like chat history for for us to really be looking at”transcript, stated

Single-turn evals miss session-level failures.

Root cause: Sentiment, repeated tool calls, progress toward goals, and frustration emerge over multiple related traces.

Resolution: Use threads as the evaluation unit for conversations or user sessions.

“what was user sentiment across this entire thread, did the user express frustration?”transcript, stated
“Or if you want to evaluate things like um tool calls, the trajectory of what tool calls are like within a conversation, uh you need to have kind of end toend view of that conversation and then and then dig into the tool calls are made.”transcript, stated

Offline evals cannot cover real production behavior completely.

Root cause: Users attempt interactions that differ from what product builders anticipated.

Resolution: Combine offline evals with online evaluators over production data and continuously backfill new bad interactions into datasets.

“the things that your users are trying to do don't always match up with the things that you intended”transcript, stated
“online eval because they run on real time over your over your production data.”transcript, stated

Discovery output still needs domain guidance.

Root cause: Insights is itself an LLM-based application and produces better results when given clear instructions and context.

Resolution: Expose configuration knobs for agent description and desired insight types.

“like with any LM based application, the key is giving it sort of good instructions and the context it needs.”transcript, stated
“greater clarity and specificity with which you can uh uh give that information, the better and more interesting insights”transcript, stated

Evaluation

LangSmith evaluates agents through offline datasets and metrics, online evaluators over live production traces, thread-level evaluators for multi-turn sessions, dashboarded thread/cost metrics, and trace-to-dataset regression loops. Insights is explicitly positioned as discovery that informs later eval creation rather than as a direct substitute for evals.

Metrics: Offline eval metrics over known datasets · Online evaluator scores over production traces · User sentiment across threads · Repeated tool-call loops · Tool-call trajectory quality · Cost per user interaction · Failure-mode frequency · Product-feature usage through copilots · Negative user feedback spot-checks · Regression test pass/fail for new versions

5 supporting quotes
“And then and then we built up kind of like offline evals where you'd create a data set and then define some metrics and run it against that. And that's like the equivalent of like unit tests and and kind of like software.”transcript, stated
“But if you want to evaluate uh end to end user interaction, so something like what was user sentiment across this entire thread, did the user express frustration? You really need to build up context and have an entire entire thread.”transcript, stated
“is agent getting stuck somewhere and and doing the same tool call over and over again.”transcript, stated
“So if you're bubbling up and looking at the level of threads, things you might care about is like what is the cost of each user interaction. Um or if you're running evaluations across threads, you want to see that data over time and plan it over time.”transcript, stated
“evaluators that measure your agents performance in real time as traces are coming in.”transcript, stated

Outcomes

The source repeatedly cites customers with agents in production and millions of traces per day, and positions the new features around extracting value from production traces rather than only prototype datasets.

5 supporting quotes
“We're launching this new thing called insights and and we can dive into it in a bit. But the high level idea is that we are going to automatically find trends for you in your traces that either indicate to you these are the types of ways your end users are interacting with your agent.”transcript, stated
“which parts of our product they're using the co-pilot for the most.”transcript, stated
“where my agent is making a mistake where it is using the wrong tools where it is explicitly erroring”transcript, stated
“to see that data over time and plan it over time. So we'll be doing a lot of work to uh introduce new kind of agent thread level metrics into our dashboards. Second thing is we have you know this whole flow of you go from traces to a data set or you go from traces to maybe you havememes that are”transcript, stated
“More and more things going into production is great for the industry as a whole and there's you know there's a lot of unknowns when you launch an agent into production and we just want to decrease the the number of unknowns and hopefully insights and some of the threaded evals can help do that.”transcript, stated