Skip to main content

Universal execution tracer and semantic diff engine for LLM agent pipelines

Project description

Trazo Banner

🧵 Trazo

Universal Execution Tracer & Semantic Diff Engine for LLM Agent Pipelines.

CI PyPI version Python versions License: MIT Downloads Platforms Stars Discord

Know exactly why your agent did what it did — and how it changed.

QuickstartKey FeaturesCLI ReferenceArchitectureContributing


🧐 What is Trazo?

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.

Before Trazo:

  • 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.

After Trazo:

  • 🔍 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.

🚀 Quickstart

1. Install

pip install "trazo[ui]"

2. Instrument in 3 Lines

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?")

3. See the Magic

trazo view       # List recent runs
trazo ui         # Launch the visual DAG viewer at http://localhost:7432
Trazo UI Mockup

✨ Key Features

🔍 Automatic Instrumentation

Just 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.

🔀 Semantic Diff Engine

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]

⏮️ Time-Travel Debugging

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.

📊 Rich Terminal UI

No browser? No problem. Trazo provides a high-fidelity terminal interface using rich for inspecting traces, diffs, and logs directly in your shell.


🛠️ CLI Reference

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

🏗️ Architecture

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: contextvars ensures correct parent-child linking even in complex async/await flows.
  • Performance: The background flush worker ensures tracing overhead is negligible (< 1ms).

🏆 Why Trazo?

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

🤝 Contributing

We love contributors! Whether it's fixing a bug, adding a new integration (Anthropic, Gemini, etc.), or improving the UI.

  1. Fork the repo.
  2. pip install -e ".[dev,ui]"
  3. Create your feature branch.
  4. Open a Pull Request.

Check out our Contributing Guide for more details.


🗺️ Roadmap

  • 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

trazo-0.1.2.tar.gz (1.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

trazo-0.1.2-py3-none-any.whl (50.0 kB view details)

Uploaded Python 3

File details

Details for the file trazo-0.1.2.tar.gz.

File metadata

  • Download URL: trazo-0.1.2.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.5 cpython/3.14.4 HTTPX/0.28.1

File hashes

Hashes for trazo-0.1.2.tar.gz
Algorithm Hash digest
SHA256 1442b07deae63f161155fc5037918f337f427668b8fbfae2efdb67292b54c906
MD5 24c9aac797cf5db7713a1b7275451a91
BLAKE2b-256 42ab0c29d931ee38632d40ddfa813ae1d4b00bbcb1cc7f3ec5bb9411bf0333ca

See more details on using hashes here.

File details

Details for the file trazo-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: trazo-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 50.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.5 cpython/3.14.4 HTTPX/0.28.1

File hashes

Hashes for trazo-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3f31562cca88682d33aad7d653071ecfd8a7cabbddb686894cacf73434850426
MD5 7e82b3f21b6ae9e6da2174b25b3ebca6
BLAKE2b-256 1b89a9886b3ceb109b5198dd071d34e5dba5caa984629adc785193c169600d9f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page