Observing the Agent
AI agents are supposed to follow instructions. Somewhere along the way they also book the wrong flight, rewrite an email nobody asked them to touch, and hallucinate a fact or two. When that happens, you need to see what the agent thought, decided, and did at each step. That’s the job of an agent observability tool.
What agent observability means
An LLM agent doesn’t run a fixed code path. It reasons, calls tools, and picks its next step at runtime, and two runs on the same input can go different ways. Without a record of each step, debugging one is guesswork.
Observability tools give you that record: step-by-step traces, prompt and response logs, token and cost counts, tool call history, and per-step latency. With those you can find where a run went wrong, what it cost, and which step was slow.
What these tools let you do
Track tokens and cost per run. The tool records input tokens (system and user prompts) and output tokens for every call, then prices them with the provider’s current rates. You get per-run and cumulative spend, and you can see when an agent is being wordy enough to be worth trimming the prompt.
Price custom models. If your model isn’t one the platform knows, you can add it with your own input and output token prices, so it shows up in the same cost breakdown and you can compare it against the others.
Measure latency at each step. A slow run is usually one slow thing: a tool that takes a while to fetch data, or an external API call that hangs. Per-step timing points you at it.
Trace tool calls. Agents call calculators, databases, and web services. The trace shows which tools were called, how often, with what inputs and outputs, and how long each took.
Collect human feedback on runs. Reviewers can open a run, leave a comment, tag it, label it (“helpful”, “incomplete”, “hallucinated”), or score it. Those labels are useful later as datasets for fine-tuning or reinforcement learning.
Watch dashboards. Completed runs, failure rate, average and per-step latency, LLM call frequency, cost per run, token usage, tool usage. You can also build your own dashboard for the metrics you care about.
Try prompts in a playground. Edit a prompt, re-run it, and compare versions side by side to see how wording changes the output.
Version prompts. Save the variants that worked, track how a prompt changed over time, and mark which versions were good, so you can go back to them.
Score runs with LLM-as-a-judge. A separate model grades each output on correctness, completeness, relevance, or your own criteria, flags hallucinations, and explains the score. It scales to many more runs than a human reviewer can read.
Three tools: LangSmith, LangFuse, Phoenix
All three trace agent runs, count tokens and cost, and support evaluation. They differ in where they come from and how they’re deployed.
LangSmith
LangSmith is LangChain’s platform for tracing, debugging, and evaluating LLM apps. A trace captures inputs, outputs, tool calls, retries, and intermediate steps, and the UI shows the whole flow of a run. It’s tightly integrated with LangChain, and it also supports custom instrumentation if you’re not using LangChain.
LangFuse
LangFuse is open source. It covers logs, traces, metrics, and custom tags, works with sync and async code, and plugs into the common LLM frameworks. It’s less tied to one framework than LangSmith, and you can self-host it, which matters if your data can’t leave your own infrastructure.
Phoenix
Phoenix, from Arize AI, is also open source and leans toward evaluation, especially for RAG. Besides traces, it looks at embeddings, vector search recall, grounding, and hallucination risk, and it can take both real and synthetic traces. It fits best when you’re tracking retrieval quality across many runs over time.
(The original comparison table was a Medium embed that doesn’t carry over. Check each tool’s site above for a current feature list.)
So the choice comes down to your stack. If you’re already on LangChain and want a hosted product, LangSmith is the shortest path. If you need to self-host or stay framework-agnostic, look at LangFuse. If retrieval quality is the thing you’re debugging, Phoenix.
Originally published on Medium.