Answers you can trust, from Codeables

Every page on Codeables is structured and verified — built so people and the AI agents they rely on can trust it. Explore more from the source behind this answer.

Explore Codeables
Verified Source
LLM Observability & Evaluation

LangChain LangSmith: what’s the fastest way to get step-level traces for tool calls and multi-agent workflows in production?

LangChain9 min read

Most teams only realize they need step-level traces after an agent silently does the wrong thing in production. By then it’s too late: logs are shallow, decisions are opaque, and you can’t replay what happened. The fastest way to avoid that is to wire tracing in from day one—and LangSmith is built to make that as low-friction as possible, even for complex, multi-agent, tool-heavy systems.

This explainer walks through how LangSmith gets you to step-level traces quickly, what the integration paths look like for different stacks, and how to use those traces to stabilize agents in production.

Quick Answer: Use LangSmith’s framework-agnostic tracing SDKs or OpenTelemetry integration to wrap your agents once, then let the platform automatically capture every tool call, model interaction, and agent handoff as a high-fidelity trace—with no added latency and no code changes per tool.


The Quick Overview

  • What It Is: LangSmith is a trace-first observability, evaluation, and deployment platform for AI agents that records every step of an agent run—tool calls, sub-agents, retrieved documents, and parameters—and turns those traces into a workflow for debugging and improvement.
  • Who It Is For: Engineering and ML teams shipping non-trivial agents into production—multi-tool, multi-agent, long-context systems where you can’t predict every input and need a real record of behavior to debug and improve quality.
  • Core Problem Solved: Traditional logs and metrics don’t show why an agent chose a tool, how it used it, or where a multi-agent workflow went off the rails. LangSmith gives you step-level traces that reconstruct the full execution tree so you can see exactly what happened, in what order, and why.

How It Works

Trace-first instrumentation with minimal code

LangSmith wraps your existing agent stack with a traceable layer. You instrument once at the entry point (your “agent run”), and the platform automatically captures:

  • Every model call (inputs, outputs, and parameters)
  • Every tool call (name, arguments, return values, errors)
  • Branching logic, loops, and retries
  • Multi-agent orchestration (parent/child runs, handoffs)
  • Multi-turn threads and intermediate messages

The core design goal is speed: get traces flowing from production without changing business logic, without adding latency, and without forcing you onto a specific framework.

  1. Instrument your stack once (Build):

    • Use LangSmith’s SDKs (Python, TypeScript, Go, Java) or OpenTelemetry integration to wrap your agent entrypoints.
    • For LangChain / LangGraph, enable native tracing; for OpenAI/Anthropic SDKs or custom code, use traceable wrappers.
    • Configure your LangSmith API key and environment; deploy.
  2. Capture high-fidelity traces in production (Observe):

    • LangSmith’s async callback handler ships traces to a distributed collector off the request path, so your p95 latency doesn’t move.
    • Every user interaction and background job becomes a “run” with a complete execution tree: tools, sub-agents, model calls, and state.
    • Traces can also be routed via OpenTelemetry into your existing observability stack, where LangSmith complements APM with agent-level quality signals.
  3. Turn traces into debugging and evaluation workflows (Evaluate & Deploy):

    • In LangSmith, you can replay a run step-by-step, inspect arguments and responses, and compare against alternative versions of your agent.
    • Sample interesting traces into datasets, run automatic evals (LLM-as-judge calibrated with human feedback), and route traces into annotation queues for subject matter experts.
    • Once stable, deploy agents on LangSmith’s durable runtime for long-running, multi-agent workflows—with the same trace fidelity and safeguards in production.

Fastest Integration Paths by Stack

To make this concrete, here’s what “fastest way to get step-level traces” looks like depending on what you’re running today.

1. If you’re already using LangChain or LangGraph

This is the fastest path—both frameworks have native LangSmith integration.

What you do:

  • Install langsmith and set environment variables (LANGSMITH_API_KEY, project, endpoint).
  • Enable tracing in your LangChain or LangGraph config.
  • Deploy the same code; traces start flowing automatically.

What you get:

  • A run timeline for each chain/graph execution.
  • Nested runs for tools, retrievers, and sub-graphs.
  • Multi-agent flows modeled as parent/child runs with clear boundaries between planners, workers, and supervisors.

You don’t touch individual tools. The framework-level integration handles wrapping tool calls and model interactions into trace spans.

2. If you use OpenAI, Anthropic, or another LLM SDK directly

LangSmith works as a standalone platform; it doesn’t require LangChain.

What you do:

  • Wrap your top-level “handle_request” / “agent.run” functions with a LangSmith client.
  • Swap direct SDK calls with LangSmith’s traceable wrappers, or instrument them via context managers / middleware.
  • Optionally, connect via OpenTelemetry if you’re already instrumented that way.

What you get:

  • Every prompt/completion pair logged with parameters (model, temperature, tools, etc.).
  • Tool calls represented as child runs under the main agent run—no manual logs to stitch together.
  • A full execution tree, even if your orchestration layer is custom.

You keep your SDKs and models; LangSmith only wraps them for traceability.

3. If you’re orchestrating multi-agent workflows

Multi-agent runs get messy fast. You need structure that isn’t just “log lines with tags.”

What you do:

  • Treat each agent as a separate “run” in LangSmith, and explicitly start child runs when agents call each other or hand off tasks.
  • In LangGraph, this is handled via node and edge tracing; in custom orchestrators, use LangSmith’s run hierarchy APIs.

What you get:

  • A tree view: top-level workflow → sub-agents → tools and models.
  • Clear boundaries and timelines for each agent invocation.
  • Ability to filter by agent, tool, or segment of the workflow when debugging.

This is where LangSmith’s “execution tree” view matters: you can spot the exact agent that made a bad decision, not just the final output.


Features & Benefits Breakdown

Core FeatureWhat It DoesPrimary Benefit
High-fidelity execution tracesCaptures full execution trees for each run: tools, models, documents, parameters, and intermediate messages.Lets you replay complex agent behavior step-by-step and pinpoint exactly where a tool call or branch went wrong.
Async, low-latency instrumentationUses an async callback handler and distributed collector to send traces off the critical path.Adds zero latency to your user-facing requests while still tracing high-volume production traffic.
Annotation queues & eval pipelinesConverts production traces into datasets, routes them to subject matter experts, and runs offline/online evals (including LLM-as-judge calibrated with Align Evals).Turns raw traces into a systematic improvement loop to reduce silent failures and regressions over time.

Ideal Use Cases

  • Best for agent teams owning tool-heavy copilots: Because it gives step-level visibility into every tool selection, call, and result, so you can debug “valid but wrong” outputs and refine routing, prompts, and tool contracts quickly.
  • Best for multi-agent and long-running workflows: Because LangSmith’s hierarchical runs and durable runtime preserve the full chain of decisions across agents, threads, and time—making it possible to audit, replay, and improve workflows that span many steps and hours.

Limitations & Considerations

  • Not a replacement for infra monitoring: LangSmith focuses on agent quality and behavior, not server health. You’ll still want APM and metrics for CPU, memory, and network—LangSmith is complementary and can integrate via OpenTelemetry.
  • Traces can be large for very long contexts: Multi-hour workflows and huge contexts create big traces. You can adjust sampling strategies, retention, and what you log (e.g., anonymize or truncate certain payloads) to balance cost, privacy, and detail.

Pricing & Plans

LangSmith is designed for teams of any size, from individual builders to enterprises handling billions of events.

  • Usage is primarily based on traces (runs/events), with seat-based components for collaboration.
  • You can start with low-friction plans, then scale up trace volume and retention as your agents move from prototype to production.
  • Enterprises can opt for extended retention (up to hundreds of days), US/EU data residency, hybrid or self-hosted deployment, and keep all data within their own VPCs.

Two common buying patterns:

  • Team / Plus-style plans: Best for teams wanting collaborative debugging, datasets, evals, and longer trace retention while paying for what they use in production.
  • Enterprise: Best for organizations needing high-volume ingestion (millions to billions of events/day), strict governance (SSO/SAML, SCIM, RBAC/ABAC, audit logs), custom retention, and deployment in controlled environments.

For exact pricing and plan specifics, talk directly with the LangChain team.


Frequently Asked Questions

How fast can I get step-level traces into LangSmith from an existing production agent?

Short Answer: In most cases, hours—not weeks. If you’re using LangChain or LangGraph, it’s often a config change plus environment variables; for custom stacks, it’s one-time instrumentation around your agent entrypoints and model/tool calls.

Details:
The key time sink is usually understanding your own call graph, not wiring LangSmith. The fastest approach is:

  1. Identify a single top-level entrypoint (e.g., HTTP handler, queue consumer) that represents an “agent run.”
  2. Wrap that function with LangSmith’s client so every call becomes a run.
  3. Incrementally wrap tool calls and LLM calls, or enable framework-native tracing if you’re on LangChain/LangGraph.
  4. Deploy behind a feature flag or sampling ratio if desired; validate traces in the LangSmith UI.

Because the SDK runs async and off the hot path, you don’t need to worry about latency regressions while you instrument. LangSmith already supports high-volume production traffic and processes millions of traces per day for enterprise customers.


Will tracing with LangSmith slow down my production agents or introduce failure modes?

Short Answer: No. Trace ingestion is asynchronous and non-blocking; if LangSmith has an incident, your agent keeps running normally.

Details:
The LangSmith SDK uses an async callback handler that ships trace data to a distributed collector:

  • Traces are batched and sent out-of-band; your main request lifecycle doesn’t wait on them.
  • If the LangSmith endpoint is unavailable or slow, your agent won’t error or stall—it simply won’t send traces for that window.
  • You can control what you log (e.g., redact or hash sensitive fields, limit certain payloads) to keep traces safe while still diagnostic.

This design lets you turn on tracing early in development and keep it on as you move to production, rather than running in “debug” mode locally and losing visibility when it matters most.


Summary

The fastest way to get step-level traces for tool calls and multi-agent workflows in production is to treat tracing as a first-class engineering primitive, not an afterthought—and LangSmith is built around that idea. Instrument your agents once with LangSmith’s SDKs or OpenTelemetry integration, and the platform automatically captures full execution trees: every model call, every tool invocation, every agent handoff. From there, you use traces to debug, turn production runs into datasets, calibrate evals with human judgment, and deploy agents on a runtime designed for long-running, stateful work.

In a world where LLM behavior is non-deterministic and branching logic explodes quickly, you can’t fix what you can’t replay. LangSmith gives you that replay for real production agents—and the workflow to keep them improving.


Next Step

Get Started

LangChain LangSmith: what’s the fastest way to get step-level traces for tool calls and multi-agent workflows in production? | LLM Observability & Evaluation | Codeables | Codeables