Skip to main content

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.

Release files for agenttrace-py 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agenttrace-py 0.1.2
File Size Uploaded
agenttrace_py-0.1.2.tar.gz 5.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for agenttrace-py 0.1.2
File Interpreter ABI Platform
agenttrace_py-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 11.3 kB

Release files / agenttrace_py-0.1.2.tar.gz

Download URL agenttrace_py-0.1.2.tar.gz
Size 5.1 kB
Tags Source
SHA-256 checksum
How to use checksums
c2c68681e5659d0b815bd9f47e6044d54050c237da57c449050937c4142efef2
BLAKE2b-256 checksum
How to use checksums
2cbef3969ca128b6ca9bd2a448b3440d5cc329ddd76787f34376285654f9d3df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.1

Release files / agenttrace_py-0.1.2-py3-none-any.whl

Download URL agenttrace_py-0.1.2-py3-none-any.whl
Size 6.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c08ddf08c5ebeb44ed9ae1912f46ab2c0dfcf7dc5f93ab409502f1783088f10b
BLAKE2b-256 checksum
How to use checksums
32d6f3c93c7af916ebcf60c958d5f796325ac20b70c0894ead8d099ad8639f05
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.1

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page