Search topics…
Tutorials
Explore
June 6 Offline Event →
LangGraph · Module 4

Observability & Debugging

Master LangSmith Observability in LangGraph — track execution traces, optimize token costs, debug latent subtasks, and configure LLMOps metrics.

⏱ 20 Min Read Module 4 of 6 Updated: May 2026

Because LLMs are non-deterministic, debugging agent loops without proper observability tools is like driving blind. This module details integrating your graphs with LangSmith to track latency, evaluate outputs, and trace variable inputs at each step.

Day 7

LangSmith & LLMOps

Why this matters

LangSmith traces every node execution — essential for debugging non-deterministic agent flows.

LangSmith records traces for every node: inputs, outputs, latency, token usage.

  • Set LANGCHAIN_TRACING_V2=true and LANGCHAIN_API_KEY.
  • Tag runs by project/environment for staging vs production comparison.
  • LLMOps: eval datasets, regression tests on graph changes.

Common mistakes

  • Forgetting to compile the graph with a checkpointer when persistence is required.
  • List state fields without reducers — updates overwrite instead of append.
  • Infinite loops in cyclic graphs with no max iteration or termination edge.

Interview checkpoints

  • Q: Explain langsmith in LangGraph. A: One-sentence definition + one API.
  • Q: Common bug? A: State, checkpointer, or routing loop issue.

Practice

  1. Basic: Sketch a minimal langsmith example.
  2. Intermediate: Run a notebook cell demonstrating LangSmith.
  3. Advanced: Break LangSmith intentionally and read the LangSmith trace.

Recap

  • You can explain langsmith clearly.
  • You know one mistake to avoid.
  • You see how this connects to the next lesson.

Next: Debugging

Day 8

Debugging Agent Flows

Why this matters

Agent bugs often hide in routing logic; structured traces expose latency spikes and wrong tool calls.

Debug agent flows by comparing trace trees: which node ran, which tool fired, where latency spiked.

  • Common issues: wrong conditional edge, missing tool schema, runaway loops.
  • Cost debugging: count LLM calls per thread; cache retrieval where possible.

Common mistakes

  • Forgetting to compile the graph with a checkpointer when persistence is required.
  • List state fields without reducers — updates overwrite instead of append.
  • Infinite loops in cyclic graphs with no max iteration or termination edge.

Interview checkpoints

  • Q: Explain debugging in LangGraph. A: One-sentence definition + one API.
  • Q: Common bug? A: State, checkpointer, or routing loop issue.

Practice

  1. Basic: Sketch a minimal debugging example.
  2. Intermediate: Run a notebook cell demonstrating Debugging.
  3. Advanced: Break Debugging intentionally and read the LangSmith trace.

Recap

  • You can explain debugging clearly.
  • You know one mistake to avoid.
  • You see how this connects to the next lesson.

Next: MCP

← State & Persistence MCP & Agentic RAG →