v0.1.0 — First public release
tracesage v0.1.0 — First public release 🎉
Production observability for LangChain & LangGraph multi-agent systems. Drop in two lines, see live execution traces in your browser. Zero infrastructure — no Docker, no Postgres, no external services.
pip install tracesage[langchain]from tracesage import TraceSage
tracer = await TraceSage.create() # one-time setup
result = await graph.ainvoke(
{"input": payload},
config={"callbacks": [tracer.handler]}, # the only line you add
)
# open http://localhost:7842/ui to watch the trace liveHighlights
- Two-line integration, never-raise safety. A LangChain
BaseCallbackHandlercaptures chain / agent / tool / LLM / chat-model / retriever events. The handler never raises and the tracer never crashes your pipeline. - Embedded UI, zero infra. In-process FastAPI server with an interactive graph + timeline at
http://localhost:7842/ui— run list, step drawer, dark/light themes, replay (1x/2x/5x), live WebSocket streaming. Storage is local SQLite + gzipped blobs. - MCP-aware. Tools loaded from MCP servers are attributed by source, so you can see which tools came from which server vs. which are hardcoded — surfaced in the topology, a "Tools by source" panel, and
GET /api/tools. - Kill switch for production.
TRACESAGE_ENABLED=falsereturns an inert tracer (no server, no DB/worker, no-op handler, near-zero overhead) — wire it in once, disable per-environment without touching your integration.TRACESAGE_START_SERVER=falsecaptures traces in prod without running the in-process UI. - Developer ergonomics.
with tracesage.trace()(sync),async with TraceSage.session(install=True),tracesage.start()background runner, a global LangChain handler (nocallbacks=wiring needed), console + Jupyter renderers, and an auto-registeredtracesage_capturepytest fixture. - CLI.
serve,export,import,stats,runs,gc,version,doctor, plus developer commandsdemo,show,watch,diff,view, andserve --open. - 30-app before/after gallery.
examples/showcase/covers customer support, RAG, multi-agent, MCP, reasoning loops, and finance/legal/insurance verticals.
Production safety
- Hard fail-stop when binding non-loopback addresses without an
auth_token. - Bearer-token HTTP auth (constant-time comparison;
/api/healthexempt), CORS preflight handled correctly, WebSocket auth via query param or subprotocol. - Path-traversal guards on blob read and write, per-run event cap + root-level sampling, bounded LRU eviction on internal maps (no leaks in long runs), and
queue.join()waits for full persistence.
Install
pip install tracesage[langchain] # core + LangChain adapter
pip install 'tracesage[mcp]' # + MCP tool-source attributionRequires Python 3.11+. tracesage is provider-agnostic (OpenAI / Anthropic / local models all traced via LangChain's callback stream).
Known limitations
Centralized multi-producer mode, OpenInference / OpenTelemetry export, cost tracking + PII redaction, and CrewAI / AutoGen / LlamaIndex adapters are planned for future releases.
📖 Full docs: https://kjgpta.github.io/tracesage/ · 📋 Changelog