TraceAct is a lightweight Python package for action-level tracing. It records the full story of what happens when a function runs — every step taken, resource touched, event recorded, and failure encountered — so you or your agent can understand what actually happened. Zero runtime dependencies.
| Repo | What it is |
|---|---|
| traceact | The core package: @traced_action decorator, sinks (JSONL, SQLite, HTTP, OTLP), TraceLog query interface, distributed trace propagation, and the bundled local viewer |
| demo | A runnable Flask app exercising every sink and feature, for trying TraceAct before wiring it into your own project |
pip install traceactfrom traceact import traced_action, configure, TraceConfig, JsonlSink
configure(
config=TraceConfig(sink_mode="blocking"),
sinks=[JsonlSink("data/traces.jsonl")],
)
@traced_action(action="note.create", kind="app", actor="user")
def create_note(title, body):
...traceact view data/traces.jsonlFull API and configuration reference: USAGE.md.
Built by Mo Shehu.