Skip to main content

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

git clone https://github.com/yourusername/traceloop-python.git
cd traceloop-python
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


Download files

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

Source Distribution

traceloop_local-0.1.0.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

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

traceloop_local-0.1.0-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file traceloop_local-0.1.0.tar.gz.

File metadata

  • Download URL: traceloop_local-0.1.0.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for traceloop_local-0.1.0.tar.gz
Algorithm Hash digest
SHA256 396abb27237010006d3abe2ac72047d7141dd5fad233abc97ecc065d16d56fa4
MD5 18291e2a0dc62ef57b77640d9f0a91c0
BLAKE2b-256 9401585d104654c209aee0e615c665e90878ce89ca7a62ae1b8c5b527a764115

See more details on using hashes here.

Provenance

The following attestation bundles were made for traceloop_local-0.1.0.tar.gz:

Publisher: publish.yml on Rishab87/traceloop

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file traceloop_local-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for traceloop_local-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d2d71df4757f2343dc4a74d205f2eeda0ab370332b1190534b4e41ff45ca988c
MD5 f04ecd85158e4969d07ed86fa04acd5b
BLAKE2b-256 68f24fea983667326c71fdb7e11fd6a26d36e18a2841f77a79f267009a267319

See more details on using hashes here.

Provenance

The following attestation bundles were made for traceloop_local-0.1.0-py3-none-any.whl:

Publisher: publish.yml on Rishab87/traceloop

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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