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

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


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.1.tar.gz (10.9 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.1-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

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

Hashes for traceloop_local-0.1.1.tar.gz
Algorithm Hash digest
SHA256 155daba1533feeff61af80ea2890ed643ce0114e34a834e93b5f2fdebcf6a233
MD5 857461f506537bd6b7e9daa2fb0c359d
BLAKE2b-256 7c721630e29f21ed98268294c0137a71973d7758917c15c46e0dfc1cc61e1867

See more details on using hashes here.

Provenance

The following attestation bundles were made for traceloop_local-0.1.1.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.1-py3-none-any.whl.

File metadata

File hashes

Hashes for traceloop_local-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2c8ec6fc743eb2cd09f429a88d52b060973aea0d4867d4487f4bfb88ec99bc3d
MD5 06f2852b2aa4318faf9a55d59f051c53
BLAKE2b-256 004713d55d44249b2d4f6a7123c9f20aaab625d1fad55d7a91c1f7a3d00306c8

See more details on using hashes here.

Provenance

The following attestation bundles were made for traceloop_local-0.1.1-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