Notes

LangSmith

Ask an agent why it did something and you get a plausible story. The only reliable answer sits in the record of what actually happened: every prompt sent, every tool call, every result that came back. LangSmith is the platform built to keep that record and make it readable.

What a trace holds
A run arrives as a tree of nested spans — the top-level request, each model call beneath it, each tool invocation beneath that — and every span carries its exact inputs and outputs, token counts, latency and any error. That structure turns "the agent went in circles" into a specific finding: the same search call at steps four, six and eight with the same arguments, because the result was never written back into the state. Tracing works whether or not the agent is built on LangChain; the SDK instruments plain functions too.

From debugging to evaluation
The more valuable half comes after the bug. A trace that exposed a failure is saved as a dataset example, so the next version is tested against it automatically — by evaluators checking an output against a reference, a judge model scoring stated criteria, or a human verdict collected from a review queue. Production runs feed the same loop, monitored for cost, latency and error rate, with the interesting ones promoted into the test set.

Why it matters
An agent is nondeterministic and multi-step, so the two habits that work on ordinary software — read the stack trace, rerun it — do not apply. Observability is how a loop that behaves differently every time becomes something you improve on purpose instead of by guesswork.

LangSmith is an observability and evaluation platform for language-model applications. It records each run as a tree of spans — every prompt, tool call, result, token count and latency — making a nondeterministic multi-step run inspectable after the fact. Traces can be promoted into datasets and scored by automated evaluators, reference checks or human review, so debugging feeds directly into regression testing. It instruments agents on any framework, not only LangChain.

When a plane lands safely, nobody looks at the flight recorder. When something goes wrong, it is the only thing worth having. LangSmith is a flight recorder for AI assistants.

These systems take many steps to finish a job, and they do not take the same steps twice. So when one behaves oddly — gets stuck repeating itself, or gives a strange answer — asking it what happened is useless. LangSmith keeps the actual record: every question it put to the model, every tool it used, every answer it got back.

Developers read that record to find the step that went wrong, then keep the example to check that their fix holds.