A lightweight local AI agent execution recorder and replayer.
Project description
Traceloop
A lightweight Python developer tool for local AI agent execution recording and timeline replaying.
Traceloop wraps any AI agent workflow to automatically capture every step, context handoff, tool call, and failure, allowing you to browse and replay failed runs locally.
Features
- Pure Python: Minimal dependencies (
flask,click,rich). - Framework Agnostic: Works with arbitrary Python code, LangChain, raw OpenAI calls, or custom agents.
- Local JSON Storage: Runs are saved as plain JSON to
~/.traceloop/runs/. No cloud accounts or API keys required. - CLI & Web UI: Browse run timelines in your terminal or via a local web dashboard.
- Replay Capability: Step-level checkpoints allow you to inject saved inputs and re-run localized failures.
Installation
Traceloop is published on PyPI. You can install it globally via pip:
pip install traceloop-local
Alternatively, you can clone the GitHub Repository and install from source:
git clone https://github.com/Rishab87/traceloop.git
cd traceloop
pip install -e .
Quick Start
1. Instrument your Agent
Use the @tracer.run() and tracer.step() decorators to wrap your logic.
from traceloop import tracer
import time
@tracer.run()
def my_agent(query):
with tracer.step("web_search", query=query) as step:
# Simulate work
time.sleep(0.3)
results = ["Result 1", "Result 2"]
step["outputs"] = {"results": results}
with tracer.step("summarize", context=results) as step:
# Simulate a crash
raise Exception("API Rate Limit Exceeded")
if __name__ == "__main__":
try:
my_agent("What is the capital of France?")
except Exception:
pass
2. View Runs (CLI)
Listrecent runs:
traceloop list
Show a specific run timeline (with execution durations and error tracebacks):
traceloop show <run_id>
3. Web Dashboard
Launch the local timeline viewer UI:
traceloop ui
Then navigate to http://localhost:5000 to interactively expand steps and view full input/output JSON payloads.
4. Replay from Checkpoint
In a real environment, you can re-inject inputs to debug a specific failing step:
traceloop replay <run_id> --from-step 2
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file traceloop_local-0.1.1.tar.gz.
File metadata
- Download URL: traceloop_local-0.1.1.tar.gz
- Upload date:
- Size: 10.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
155daba1533feeff61af80ea2890ed643ce0114e34a834e93b5f2fdebcf6a233
|
|
| MD5 |
857461f506537bd6b7e9daa2fb0c359d
|
|
| BLAKE2b-256 |
7c721630e29f21ed98268294c0137a71973d7758917c15c46e0dfc1cc61e1867
|
Provenance
The following attestation bundles were made for traceloop_local-0.1.1.tar.gz:
Publisher:
publish.yml on Rishab87/traceloop
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
traceloop_local-0.1.1.tar.gz -
Subject digest:
155daba1533feeff61af80ea2890ed643ce0114e34a834e93b5f2fdebcf6a233 - Sigstore transparency entry: 1031282791
- Sigstore integration time:
-
Permalink:
Rishab87/traceloop@6f76ca385bf5e76d876603f5d07126dfe48b9ade -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/Rishab87
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6f76ca385bf5e76d876603f5d07126dfe48b9ade -
Trigger Event:
push
-
Statement type:
File details
Details for the file traceloop_local-0.1.1-py3-none-any.whl.
File metadata
- Download URL: traceloop_local-0.1.1-py3-none-any.whl
- Upload date:
- Size: 11.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2c8ec6fc743eb2cd09f429a88d52b060973aea0d4867d4487f4bfb88ec99bc3d
|
|
| MD5 |
06f2852b2aa4318faf9a55d59f051c53
|
|
| BLAKE2b-256 |
004713d55d44249b2d4f6a7123c9f20aaab625d1fad55d7a91c1f7a3d00306c8
|
Provenance
The following attestation bundles were made for traceloop_local-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on Rishab87/traceloop
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
traceloop_local-0.1.1-py3-none-any.whl -
Subject digest:
2c8ec6fc743eb2cd09f429a88d52b060973aea0d4867d4487f4bfb88ec99bc3d - Sigstore transparency entry: 1031282865
- Sigstore integration time:
-
Permalink:
Rishab87/traceloop@6f76ca385bf5e76d876603f5d07126dfe48b9ade -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/Rishab87
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6f76ca385bf5e76d876603f5d07126dfe48b9ade -
Trigger Event:
push
-
Statement type: