Skip to main content

Local-first, append-only trace vault for AI agents with cryptographic integrity

Project description

Axiom Trace

Local-first, append-only trace vault for AI agents with cryptographic integrity.

pip install axiom-trace

Quick Start (3 Lines)

from axiom_trace import trace

trace.log("Processing user request")
trace.thought("Need to fetch user data")
trace.tool("database_query", {"table": "users"})
trace.done("Found 10 users")

That's it! Traces are saved to .axiom_trace/ in your project.


View Your Traces

# Pretty print recent traces
axiom log

# Watch live (like tail -f)
axiom watch

Output:

────────────────────────────────────────────────────────────────────────────────
AXIOM TRACE LOG (4 entries)
────────────────────────────────────────────────────────────────────────────────
2026-01-09T03:56:43 system_event  Processing user request
2026-01-09T03:56:43 thought       Need to fetch user data
2026-01-09T03:56:43 tool_call     ✓ database_query
2026-01-09T03:56:43 final_result  ✓ Found 10 users
────────────────────────────────────────────────────────────────────────────────

API Reference

Quick Trace Methods

Method When to Use Example
trace.log(msg) Simple log message trace.log("Starting")
trace.thought(reasoning) Agent is thinking/deciding trace.thought("Need API call")
trace.tool(name, args) Calling a tool/function trace.tool("search", {"q": "..."})
trace.done(result) Task completed trace.done("Success!")
trace.error(msg, exc) Something failed trace.error("Failed", e)
trace.input(text) User said something trace.input("What's the weather?")

Auto-Trace Decorator

from axiom_trace import auto_trace

@auto_trace
def fetch_user(user_id: int):
    return db.get(user_id)

# Automatically captures: function name, args, result, timing, exceptions

Agent-Friendly Fields

Traces include fields designed for AI agent retrospection:

trace.record({
    "event_type": "tool_call",
    "content": {
        "input": "User asked: Build REST API",      # What prompted this
        "output": "Created api/users.py",           # What was produced
        "reasoning": "Need CRUD endpoints"          # Why this action
    },
    "success": True,                                # Did it work?
    "artifacts": ["api/users.py"],                  # Files created
    "caused_by": "previous-frame-id"                # Causality chain
})

Memvid Cloud (Optional)

For enhanced semantic search, add your Memvid API key:

# In your project's .env file
MEMVID_API_KEY=mv2_your_key_here

Axiom Trace automatically loads from .env when you import it.


CLI Commands

Command Description
axiom log Pretty print recent traces
axiom watch Live trace monitoring
axiom query --prompt "..." Search traces semantically
axiom verify Check hash chain integrity
axiom stats Show vault statistics
axiom export --session ID Export session to Markdown

Advanced: Full API

For more control, use the AxiomTrace class directly:

from axiom_trace import AxiomTrace

with AxiomTrace(vault_dir="./my_vault") as ax:
    # Record with full control
    ax.record({
        "event_type": "thought",
        "content": {
            "text": "Analyzing request",
            "rationale_summary": "Need to understand intent"
        }
    })
    
    # Query with semantic search
    results = ax.query("user request", limit=5)
    
    # Verify integrity
    status = ax.verify_integrity()

Vault Structure

.axiom_trace/
├── frames.jsonl           # Your traces (one JSON per line)
├── vault.manifest.json    # Metadata + head hash
├── vault_index.json       # Search index
└── vault.mv2              # Memvid video index

Why Axiom Trace?

  • Local-first - Data stays on your machine
  • Append-only - Can't delete or modify past traces
  • Tamper-evident - SHA-256 hash chain detects modifications
  • Agent-friendly - Fields designed for AI retrospection
  • Zero config - Works out of the box

License

MIT

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

axiom_trace-1.4.1.tar.gz (21.5 kB view details)

Uploaded Source

Built Distribution

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

axiom_trace-1.4.1-py3-none-any.whl (26.7 kB view details)

Uploaded Python 3

File details

Details for the file axiom_trace-1.4.1.tar.gz.

File metadata

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

File hashes

Hashes for axiom_trace-1.4.1.tar.gz
Algorithm Hash digest
SHA256 692f0f640c3c5999ec6e69001e96dfc4c7ab9fdf49044bb1ceb4fc06f0262125
MD5 ecf15f50426cb5d06ba53f16aa9880a3
BLAKE2b-256 d610b1d3122d686c3f4e3343dbf3c0423653250e9b3f17fcd9e695bc69505573

See more details on using hashes here.

Provenance

The following attestation bundles were made for axiom_trace-1.4.1.tar.gz:

Publisher: publish.yml on atharvayeola/axiom-trace

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

File details

Details for the file axiom_trace-1.4.1-py3-none-any.whl.

File metadata

  • Download URL: axiom_trace-1.4.1-py3-none-any.whl
  • Upload date:
  • Size: 26.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for axiom_trace-1.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 face7fef1a353138af5955d7738126f8dd092d0f9d5d5cd21d2710f3b30aa209
MD5 874633c82b6796933ce8284d75b39c7f
BLAKE2b-256 76eec58302ea4c71c2096749dd6fffa38363bbb6c30db4276124a3d95e5a5c9c

See more details on using hashes here.

Provenance

The following attestation bundles were made for axiom_trace-1.4.1-py3-none-any.whl:

Publisher: publish.yml on atharvayeola/axiom-trace

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