Skip to main content

Overview

Laminar is an open-source, OpenTelemetry-native observability platform for AI agents. If you already trace your agent with LangSmith, the Laminar LangSmith bridge records the same runs in Laminar with one option on Laminar.initialize(), so you can compare both tools on your own runs before deciding anything:
  • No code changes. Your traceable functions, LangSmith OpenAI and Anthropic wrappers, and LangChain or LangGraph code stay as they are.
  • LangSmith is unaffected. LangSmith receives exactly the runs it received before, sent the same way. Laminar reads its own copy of each run inside your process and sends it to Laminar separately.
  • Reversible. Remove the option and Laminar stops recording the runs.
LangSmith is LangChain’s tracing and evaluation platform. Its SDK sends runs to LangSmith’s API instead of using OpenTelemetry. The bridge picks up every run the LangSmith SDK sends and translates it into Laminar spans:
  • Every LangSmith run: traceable functions, the OpenAI and Anthropic wrappers, LangChain and LangGraph runs, and runs you create with RunTree.
  • LLM calls with prompts, responses, tool definitions, tool calls, model, token counts, and cost, in Laminar’s message format so they render in the transcript view.
  • Tool runs as tool spans, and failed runs as errors.
  • Session id, user id, tags, and trace metadata, mapped onto the Laminar trace.
  • Runs that start inside a Laminar observe span nest under it.
Supported versions: Python langsmith 0.4.15 or later with lmnr 0.9.4 or later, and the TypeScript langsmith package 0.3.60 or later with @lmnr-ai/lmnr 0.9.9 or later.

Getting started

1

Install

You already have langsmith in your project. Add Laminar:
2

Set environment variables

Keep your LangSmith settings as they are and add your Laminar project API key:
3

Initialize Laminar with the LangSmith bridge

Call Laminar.initialize() with bridges: ["langsmith"] at startup. It works whether LangSmith is imported before or after this call:
agent.ts
4

Run your agent as usual

Your LangSmith-traced agent keeps reporting to LangSmith, and the same runs now also land in Laminar. The session_id and user_id metadata become the Laminar session and user:
agent.ts
5

Flush Laminar before your script exits

Laminar sends spans in batches in the background, so a long-running server needs nothing extra. A script, CLI, or serverless function that exits right after the agent finishes must flush Laminar first:
agent.ts
If the process keeps running after this point, for example between serverless invocations, call await Laminar.flush() instead: it sends pending spans and keeps Laminar running.

What the bridges option changes in Laminar

  • Laminar’s own LLM and LangChain instrumentations are turned off, so a call that LangSmith already records isn’t recorded a second time. Instrumentations that LangSmith doesn’t cover stay on, for example browser session recording. In Python, the LangGraph instrumentation stays on too and adds the graph’s nodes and edges to the trace. If you pass an explicit instruments (Python) or instrumentModules (TypeScript), Laminar uses exactly what you list and logs a warning about any overlap with the bridge.
  • LangSmith runs nest under Laminar spans. A traceable function or LangGraph run called inside Laminar’s own observe appears as a child of that span in Laminar.
  • In Python, Laminar keeps its tracer provider separate from the global OpenTelemetry provider, so LangSmith’s optional OpenTelemetry modes keep sending to LangSmith.

What Laminar records from LangSmith

Laminar records the runs as LangSmith sends them, after LangSmith’s own settings are applied:
  • Redaction carries over. Inputs and outputs that you hide with hide_inputs / hide_outputs (hideInputs / hideOutputs in TypeScript), the LANGSMITH_HIDE_INPUTS / LANGSMITH_HIDE_OUTPUTS variables, or an anonymizer arrive in Laminar hidden the same way.
  • Sampling carries over. Runs that LANGSMITH_TRACING_SAMPLING_RATE drops are not recorded in Laminar either.
  • Tracing must be on. With LANGSMITH_TRACING unset or false, LangSmith creates no runs, so Laminar has nothing to record.
  • Attachments are not recorded. Files attached to a run go to LangSmith only.
  • A run appears in Laminar when it ends. A run that fails with an exception ends with an error (in Python this includes Ctrl-C and sys.exit()). A run that is still open when you call Laminar.shutdown() or when the process exits, for example a generator the caller stopped reading, is recorded at that moment with the span attribute langsmith.run.incomplete set to true. LangSmith shows the same run as still running. In TypeScript this also covers Ctrl-C and SIGTERM when your app doesn’t handle them; if it does, call await Laminar.shutdown() in the handler. A process killed outright (kill -9, out of memory, os._exit() in Python, SIGTERM without a handler in Python) or ended with process.exit() in TypeScript can’t record its open runs.
LangChain and LangGraph runs are recorded the way Laminar’s LangChain integration records them:
  • Spans carry the run names you see in LangSmith: the graph, each node, each tool, and each model call.
  • LLM spans hold the messages, tool definitions, response, model, token usage, and cost. Tool and retriever spans keep their full input and output.
  • Chain and graph node spans don’t record the graph state, which repeats on every step. Only a few small keys such as max_steps or token_usage are kept.
  • Internal steps such as RunnableSequence and RunnableLambda inside a chain get no span of their own: their children appear under the nearest step that has one.
  • LangGraph’s thread_id becomes the Laminar session. In Python, the graph’s nodes and edges also power the LangGraph view.
  • Metadata you set on the root run becomes trace metadata. The keys that LangSmith, LangChain, and LangGraph add themselves, such as ls_provider or langgraph_node, are left out.

See what happened in a trace

Open a bridged run in Laminar and you land on the transcript view: the user prompt at the top, each model turn as a conversation line, and every tool call inline with its arguments and result. The bridge rewrites LangSmith’s runs into Laminar’s message format, so an LLM turn with tool calls reads as a conversation rather than a raw JSON payload.
LangSmith-bridged agent trace in Laminar, transcript view with tool calls

Transcript view of a LangSmith-traced agent bridged into Laminar: the travel_agent run with its session and user, two gpt-5-mini turns, and the get_weather and convert_currency tool calls.

More on the trace UX: Viewing traces.

When you’re ready to use Laminar only

The bridge lets you evaluate Laminar without committing up front. Once you decide to use Laminar only, remove the LangSmith-specific code at your own pace:
  1. Remove the bridges option. Laminar’s own instrumentations turn back on, so Laminar.initialize() with the defaults traces the OpenAI SDK and LangChain. In TypeScript you may need additional setup, see LangChain and LangGraph.
  2. Replace the LangSmith wrappers with the plain provider clients, and swap traceable for Laminar’s own observe.
  3. Set LANGSMITH_TRACING=false or remove your LangSmith settings.
Until then, your LangSmith setup keeps working unchanged.

Track outcomes with Signals

Traces answer what happened on this run. Signals answer the cross-trace question: how often does the agent skip a tool it should have called, when does it loop, which runs end without answering the user. A Signal pairs a plain-language instruction with a JSON output schema. Laminar runs it live on new traces (Triggers) or backfills it across history (Jobs) and records a structured event every time it matches. From there you query, cluster, and alert on events across every trace.
Every new project ships with an Issues Signal that records the errors your agent makes on any trace over 1000 tokens. Open it from the Signals section of the sidebar to see its clusters as soon as your bridged traces arrive.

Query across traces

  • SQL editor for ad-hoc queries across traces, spans, signals, and evals.
  • SQL API for programmatic access from scripts and pipelines.
  • CLI (lmnr-cli sql query) for terminal-driven queries and piping JSON into shell tools or coding agents.
  • MCP server to query Laminar directly from Claude Code, Cursor, or Codex.

Troubleshooting

  • Confirm LMNR_PROJECT_API_KEY is set in the same process that runs the agent.
  • The bridge is opt-in. Installing langsmith doesn’t enable it: pass bridges=["langsmith"] (Python) or bridges: ["langsmith"] (TypeScript) to Laminar.initialize().
  • Confirm LangSmith tracing is on (LANGSMITH_TRACING=true). Laminar records only the runs LangSmith sends.
  • Check the supported versions in the note at the top of this page. Laminar logs a warning when the installed LangSmith SDK is too old for the bridge.
  • In TypeScript, a script that exits right after the agent finishes must flush Laminar first, as shown in the setup above.
Laminar records what LangSmith sends, after LangSmith’s redaction. If you hide inputs or outputs from LangSmith, they’re hidden in Laminar too. Chain and graph node spans from LangChain and LangGraph also leave out the graph state, as described in What Laminar records from LangSmith.
The bridge turns off Laminar’s overlapping instrumentations only when you don’t pass instruments (Python) or instrumentModules (TypeScript). If you pass them, remove the providers that you call through LangSmith’s wrappers or LangChain.
When your code runs through tsx, Laminar can record LangChain and LangGraph runs only after one turn of the Node.js event loop has passed since Laminar.initialize(). If a script invokes a model or a graph immediately after initializing, its first runs can appear in Laminar without their input. traceable functions and LangSmith’s OpenAI and Anthropic wrappers are recorded in full either way, and so is every run in a server, which starts long after initialization.Run the script with plain node, which runs TypeScript files directly on current Node.js versions, or let the event loop turn once before the first call:
Laminar records a LangSmith run when the run ends, so spans that Laminar’s own observe creates inside a traceable function nest under the closest Laminar span instead of under the run. Runs started inside a Laminar span nest correctly.
Set base_url and the ports of your instance when initializing. For a local OSS deployment:

What’s next

Viewing traces

Read the transcript view, filter, and search across traces.

Signals

Detect behaviors and failures across every run, then query, cluster, and alert on them.

SQL editor and MCP server

Query traces programmatically from the UI, API, or your IDE.

Tracing structure

Use Laminar’s own observe, sessions, metadata, and tags once you migrate off LangSmith.

LangChain / LangGraph

Trace LangChain chains and LangGraph graphs.

deepagents

Trace deepagents runs, subagents, and tool calls.

Langfuse

Keep Langfuse and send the same spans to Laminar too.

OpenAI

Trace the OpenAI SDK directly in TypeScript and Python.

Anthropic

Trace the Anthropic SDK directly in TypeScript and Python.

All integrations

Browse every provider, framework, coding agent, and browser integration Laminar supports.