LangSmith
LangSmith records every run so you can read it back step by step. You set two environment variables before running, and tracing turns on with no code change.
Last updated: 29 Sep, 2026 · LangSmith
When an answer is wrong, logs rarely show why. A trace shows each node, each model call, and what it sent and got back, so you can find the step that failed.
The debugging video sets LANGSMITH_API_KEY, read from the LANGCHAIN_API_KEY in its .env, and LANGSMITH_TRACING set to the string "true", so its runs land in the default project; LANGSMITH_PROJECT picks another. After that every invoke appears in LangSmith with no other change. For "What is machine learning" the trace shows the tool_calling_llm node and the Groq model call inside it, with the add tool bound but not used. For "What is 2 plus 2" it shows the model asking for add, the tools node running it, the result 4 going back to the model, and the final reply. The same variables turn on tracing for the support agent.
The tracing environment variables
export LANGSMITH_TRACING=true
export LANGSMITH_API_KEY=your_key
export LANGSMITH_PROJECT=support-agent # optionalWhat tracing records
- LangChain and LangGraph read those variables and trace every run on their own.
- Each run appears in LangSmith as a tree of steps you can open and read.
- The older
LANGCHAIN_TRACING_V2andLANGCHAIN_API_KEYnames still work; theLANGSMITH_names are current.
When to turn on tracing
- Finding the step where a run went wrong or got expensive.
- Watching what a live agent sends to the model.
What LangGraph this course left out
The course covered the graph API end to end. These are the LangGraph topics it did not reach, each worth reading when you meet the need.
| Topic | What it is for | Where to read |
|---|---|---|
| Functional API | @entrypoint and @task: the same persistence, memory and interrupts written as plain functions, without building a graph | Functional API |
| Node caching | A CachePolicy on a node so an expensive step is reused instead of re-run | Graph API: node caching |
| Durability modes | durability="sync"/"async"/"exit": how often a run is written to the checkpointer, trading safety for speed | Persistence: durability |
| Production checkpointers and stores | Postgres and SQLite backends that keep memory across restarts, beyond the InMemorySaver used here | Checkpointer integrations |
| MCP tools | Connecting an agent to tools served over the Model Context Protocol | Model Context Protocol |
| LangGraph Platform | Deploying to the cloud with Studio and the Assistants API, beyond the local langgraph dev shown here | Deploy to cloud |
| Deep Agents | A higher-level prebuilt for multi-agent apps, with subagents, planning and a virtual filesystem | Multi-agent |
Related
- Previous: Deploy
- Reference: LangSmith observability
- Set the variables, run any earlier lesson's graph, and open the trace.
- Name the project and confirm the run lands under it.
You understood something today that you didn't yesterday.