Using LangSmith with LangGraph enables robust observability in multi-agent systems, especially when teams (like research teams using tools such as Tavily) are coordinated via a supervisor agent. Observability ensures transparency, debuggability, and traceability of workflows across the graph.
- Debug execution flows across agents and tools.
- Visualize agent decisions, tool calls, and responses.
- Track latency, success/failure, and metadata.
- Compare behavior across runs or task types.
LangSmith provides real-time and retrospective insight by logging:
- Prompt inputs and outputs.
- Tool invocations and results.
- Decision branching within the graph.
In this example:
- A user submits a query.
- A Supervisor routes it to a Research Team, which uses Tavily to retrieve information.
- Output is returned to the Supervisor for evaluation.
graph TD
A[User Input] --> B[Supervisor Agent]
B --> C{Task Type?}
C -- Research --> D[Research Team]
D --> E[Tool: Tavily Search]
E --> F[Research Summary]
F --> G[Supervisor Eval]
G --> H[Final Output to User]
from langsmith import traceable
@traceable(name="research_team")
def research_team(query):
# Call Tavily, process result
...
@traceable(name="supervisor")
def supervisor_router(user_input):
if "research" in user_input:
return research_team(user_input)
...
- View structured traces with nodes:
supervisor_router
research_team
- Tavily tool invocation
- Filter by tags, runtime, or errors.
- Identify slow tools or agents.
- Understand decision bottlenecks.
- Ensure prompt consistency.
- Export trace data for QA or reporting.
LangSmith turns your LangGraph from a black box into a traceable, auditable system β key for reliable, iterative development.