Skip to main content

Deterministic execution and replay layer for AI Agents

Project description

AgentTrace Python SDK

The deterministic execution and replay layer for AI Agents.

Stop guessing why your agents crash in production. AgentTrace records every LLM call, tool execution, and intermediate state—letting you rewind time, fork the execution, and test fixes instantly.

Installation

pip install agenttrace

Quick Start (The "Thin" SDK)

AgentTrace works as a thin data-collection layer. Simply decorate your main entry point, and use with agenttrace.step() to log intermediate actions. The SDK automatically bundles the events and syncs them securely to your dashboard.

import agenttrace

# 1. Initialize with your API Key
agenttrace.init(api_key="at_live_...")

# 2. Add the @agenttrace.run decorator to track the entire execution
@agenttrace.run(name="checkout_agent")
def main():
    
    # 3. Log an LLM call or thought process
    with agenttrace.step("Planning Phase", type="thought"):
        plan = "Validating the order."
        
    # 4. Log a tool execution
    with agenttrace.step("Validate Order", type="tool_call", input={"order_id": 123}):
        # Your custom tool code here
        result = {"status": "valid"}
        agenttrace.set_result(result)
        
    return {"success": True}

if __name__ == "__main__":
    main()

When main() finishes, the complete trace is uploaded securely and becomes available in your AgentTrace dashboard for debugging and forking.

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

agenttrace_py-0.1.0.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

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

agenttrace_py-0.1.0-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: agenttrace_py-0.1.0.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.1

File hashes

Hashes for agenttrace_py-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b8e5351d0aca3f56a26a6489d91bd3807c6ea8bb755daada7507db076edfb9cd
MD5 10c38af0bd9e70902afb6de6e19b5c5d
BLAKE2b-256 54b6859c041c5a784c34f9f3523ef1ec5d229b36bb0fdd8d31512e848a25d59d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: agenttrace_py-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.1

File hashes

Hashes for agenttrace_py-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 084d53419157c755eccb64cf6efc4ac8468f3f4d3e558808ffe90ec49588659d
MD5 c9eec6085e47a6e43580ed3feb630590
BLAKE2b-256 ce87fda427efec4e9e0a811e5075d78987adfcb7b7b432204efc5b6440d83cd5

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