Universal Execution Tracer & Semantic Diff Engine for LLM Agent Pipelines.
Know exactly why your agent did what it did โ and how it changed.
Quickstart โข Key Features โข CLI Reference โข Architecture โข Contributing
Building LLM agents is easy. Debugging them is hard. When your pipeline behavior shifts, Trazo tells you why.
Trazo is a local-first, zero-dependency tracing library that captures every step of your agent's execution, tracks costs, and allows you to semantically diff two runs to see exactly what changed in your prompts, models, or outputs.
print(response)spam in your terminal.- Grepping through 100MB log files.
- Re-running expensive pipelines just to see a single intermediate output.
- Paying $$$ for cloud observability tools just to debug a local script.
- ๐ Visual DAGs: See your pipeline execution as a beautiful tree.
- ๐ Semantic Diffs: Instant comparison of two runs with similarity scores.
- โฎ๏ธ Time-Travel Replay: Re-run any specific step with original inputs.
- ๐ฐ Cost Tracking: Automated token counting and USD cost estimation.
- ๐ 100% Local: No data ever leaves your machine. SQLite powered.
pip install "trazo[ui]"import trazo as tz
tz.init() # Initialize storage
tz.instrument_ollama() # Auto-instrument local models
@tz.trace # Trace any function
def my_agent_step(query: str):
# Your logic here...
return "Result"
with tz.run("my_first_trace"):
my_agent_step("How does transformers work?")trazo view # List recent runs
trazo ui # Launch the visual DAG viewer at http://localhost:7432Just call tz.instrument_openai() or tz.instrument_ollama() at the top of your script. Trazo handles the restโcapturing inputs, outputs, tokens, and latency without touching your code.
Compare two versions of your pipeline. Trazo matches spans by name and calculates a similarity score using lightweight n-gram hashing (no ML needed) or real embeddings (optional).
trazo diff [baseline_id] [current_id]Spotted a failure in a complex chain? Use trazo replay [span_id] to re-execute just that specific step with the exact same inputs, or override them to test a fix.
No browser? No problem. Trazo provides a high-fidelity terminal interface using rich for inspecting traces, diffs, and logs directly in your shell.
| Command | Description |
|---|---|
trazo view |
List runs or inspect a specific run/span tree |
trazo diff |
Compare two runs and highlight semantic changes |
trazo replay |
Re-run a span with original or modified inputs |
trazo ui |
Start the local web dashboard (FastAPI + D3.js) |
trazo clean |
Prune old traces to save disk space |
trazo export |
Export traces to JSON or interactive HTML |
Trazo is designed to be non-blocking and local-first.
graph TD
A[Your Agent Code] -->|Event| B(TraceCollector)
B -->|Background Thread| C[SQLite WAL Mode]
C --> D[CLI Interface]
C --> E[Web UI Dashboard]
F[OpenAI / Ollama] -.->|Auto-patch| A
- Storage: SQLite with WAL mode for high concurrency.
- Context:
contextvarsensures correct parent-child linking even in complex async/await flows. - Performance: The background flush worker ensures tracing overhead is negligible (< 1ms).
| Feature | Trazo | LangSmith | Weights & Biases |
|---|---|---|---|
| Local-first | โ Yes | โ No | โ No |
| Zero Setup | โ Yes | โ No | โ No |
| Semantic Diff | โ Built-in | โ Basic | โ No |
| Cost | ๐ Free | ๐ฐ Paid | ๐ฐ Paid |
| Privacy | ๐ 100% | โ๏ธ Cloud | โ๏ธ Cloud |
We love contributors! Whether it's fixing a bug, adding a new integration (Anthropic, Gemini, etc.), or improving the UI.
- Fork the repo.
pip install -e ".[dev,ui]"- Create your feature branch.
- Open a Pull Request.
Check out our Contributing Guide for more details.
- Core Tracing & SQLite Storage
- Semantic Diff CLI
- Interactive DAG Viewer
- OpenAI & Ollama Integrations
- Anthropic & Google Gemini Integration (Coming Soon)
- GitHub Actions Integration: Fail PRs if semantic similarity drops!
- MCP Server Support: Chat with your traces in Claude Desktop.
โญ Star us on GitHub ยท ๐ฌ Join the Discord
MIT License ยฉ 2026 Vikhram S
