See Everything Your Agent Does
Every node, tool call, token count, and timing — captured automatically and visualised in one place.
agent_trace.py
| 1 | # pip install agent-snoop[mongo,langgraph] |
| 2 | |
| 3 | import agent_snoop |
| 4 | from agent_snoop.integrations.langgraph import AgentSnoopCallbackHandler |
| 5 | from langchain_core.messages import HumanMessage |
| 6 | |
| 7 | # Reads MONGODB_URI or AGENTSNOOP_API_KEY from env |
| 8 | tracer = agent_snoop.init(agent_name="my-agent", framework="langgraph") |
| 9 | |
| 10 | query = "What is the warranty on my MacBook Pro M5?" |
| 11 | |
| 12 | handler = AgentSnoopCallbackHandler( |
| 13 | handle=tracer.trace(input=query, tags=["prod"]) |
| 14 | ) |
| 15 | |
| 16 | result = await graph.ainvoke( |
| 17 | {"messages": [HumanMessage(content=query)]}, |
| 18 | config={"callbacks": [handler]}, |
| 19 | ) |
| 20 | |
| 21 | handler.on_chain_end_final(result) # ✓ trace saved |
Python 3.9+UTF-8
Up and Running in 3 Minutes
Install & Configure Storage
Run pip install agent-snoop[mongo,langgraph], then export your MongoDB URI or liten.tech API key. No new infra required.
Wrap Your Agent
Add AgentSnoopCallbackHandler to your existing graph.ainvoke config. No rewrites, no wrappers around your business logic.
Inspect on liten.tech
Open liten.tech/traces to explore timelines, step breakdowns, token counts, and tool call outputs — for every run you've ever made.




