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 onLaminar.initialize(), so you can compare both tools on your own runs before deciding anything:
- No code changes. Your
traceablefunctions, 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.
- Every LangSmith run:
traceablefunctions, the OpenAI and Anthropic wrappers, LangChain and LangGraph runs, and runs you create withRunTree. - 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
observespan nest under it.
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
- TypeScript
- Python
Install
langsmith in your project. Add Laminar:Set environment variables
Initialize Laminar with the LangSmith bridge
Laminar.initialize() with bridges: ["langsmith"] at startup. It works whether LangSmith is imported before or after this call:Run your agent as usual
session_id and user_id metadata become the Laminar session and user:Flush Laminar before your script exits
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) orinstrumentModules(TypeScript), Laminar uses exactly what you list and logs a warning about any overlap with the bridge. - LangSmith runs nest under Laminar spans. A
traceablefunction or LangGraph run called inside Laminar’s ownobserveappears 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/hideOutputsin TypeScript), theLANGSMITH_HIDE_INPUTS/LANGSMITH_HIDE_OUTPUTSvariables, or an anonymizer arrive in Laminar hidden the same way. - Sampling carries over. Runs that
LANGSMITH_TRACING_SAMPLING_RATEdrops are not recorded in Laminar either. - Tracing must be on. With
LANGSMITH_TRACINGunset orfalse, 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 callLaminar.shutdown()or when the process exits, for example a generator the caller stopped reading, is recorded at that moment with the span attributelangsmith.run.incompleteset totrue. LangSmith shows the same run as still running. In TypeScript this also covers Ctrl-C andSIGTERMwhen your app doesn’t handle them; if it does, callawait Laminar.shutdown()in the handler. A process killed outright (kill -9, out of memory,os._exit()in Python,SIGTERMwithout a handler in Python) or ended withprocess.exit()in TypeScript can’t record its open runs.
- 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_stepsortoken_usageare kept. - Internal steps such as
RunnableSequenceandRunnableLambdainside a chain get no span of their own: their children appear under the nearest step that has one. - LangGraph’s
thread_idbecomes 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_providerorlanggraph_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.
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.
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:- Remove the
bridgesoption. Laminar’s own instrumentations turn back on, soLaminar.initialize()with the defaults traces the OpenAI SDK and LangChain. In TypeScript you may need additional setup, see LangChain and LangGraph. - Replace the LangSmith wrappers with the plain provider clients, and swap
traceablefor Laminar’s ownobserve. - Set
LANGSMITH_TRACING=falseor remove your LangSmith settings.
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.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
I don't see any traces in Laminar
I don't see any traces in Laminar
- Confirm
LMNR_PROJECT_API_KEYis set in the same process that runs the agent. - The bridge is opt-in. Installing
langsmithdoesn’t enable it: passbridges=["langsmith"](Python) orbridges: ["langsmith"](TypeScript) toLaminar.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.
Some inputs or outputs are empty in Laminar
Some inputs or outputs are empty in Laminar
The same call shows up twice in Laminar
The same call shows up twice in Laminar
instruments (Python) or instrumentModules (TypeScript). If you pass them, remove the providers that you call through LangSmith’s wrappers or LangChain.The first LangChain run of a script has no input (TypeScript with tsx)
The first LangChain run of a script has no input (TypeScript with tsx)
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 spans inside a LangSmith run appear next to it, not under it
Laminar spans inside a LangSmith run appear next to it, not under it
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.Self-hosting Laminar
Self-hosting Laminar
base_url and the ports of your instance when initializing. For a local OSS deployment:What’s next
Viewing traces
Signals
SQL editor and MCP server
Tracing structure
observe, sessions, metadata, and tags once you migrate off LangSmith.