Skip to main content

Local version control for AI agent behavior.

Project description

Trace

Trace is local version control for AI agent behavior. It captures structured agent runs, compares behavior across runs, and restores the configuration that produced a trusted run.

import trace_sdk as trace

@trace.track(agent="planner", config={"model": "mock-v1"})
def run_agent(request):
    tools = trace.wrap_tools({"lookup": lookup})
    result = tools["lookup"](request)
    trace.decision("lookup_done", status=result["status"])
    return result

Commands

trace log
trace show <id>
trace diff <id_a> <id_b>
trace diff <id_a> <id_b> --json
trace revert <id>
trace revert <id> --agent budget_agent
trace serve
trace clear

Runs are stored in .trace/runs/. Config restored by trace revert is stored in .trace/config.json.

Development

uv sync --extra dev
uv run pytest
uv run python examples/demo_agent.py --variant stable
uv run python examples/demo_agent.py --variant drift
uv run trace log

TraceHub lives in tracehub/. Build it with npm install && npm run build; trace serve serves the built assets from tracehub/dist.

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

trace_sdk-0.3.1.tar.gz (63.2 kB view details)

Uploaded Source

Built Distribution

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

trace_sdk-0.3.1-py3-none-any.whl (66.1 kB view details)

Uploaded Python 3

File details

Details for the file trace_sdk-0.3.1.tar.gz.

File metadata

  • Download URL: trace_sdk-0.3.1.tar.gz
  • Upload date:
  • Size: 63.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for trace_sdk-0.3.1.tar.gz
Algorithm Hash digest
SHA256 c470aada28f15879451adaea272b5b84f8226a8d9a68f86073bd5a37d43f6446
MD5 a085e3de08ca6d9c608d86378c5905c6
BLAKE2b-256 4eda3e3d629eed77c053c35588d62326a038234eb6467be6a29d8d022468a52c

See more details on using hashes here.

File details

Details for the file trace_sdk-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: trace_sdk-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 66.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for trace_sdk-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9bc5692bb855560f214cefee9d7a2a7f69a6a66daf84230c0e5b14e96237b13d
MD5 cd6ff0d9fd203c383522a09620ffe808
BLAKE2b-256 162e6b330a3af7eee7dae24f3a03fcc654fe1d2823bc86e6eb56d97f37ea8f44

See more details on using hashes here.

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