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 and hybrid search.
Installation
pip install axiom-trace
For development:
git clone https://github.com/your-username/axiom-trace.git
cd axiom-trace
pip install -e ".[dev]"
Quick Start
Python SDK
from axiom_trace import AxiomTrace
# Create or open a vault
with AxiomTrace("./my_vault") as trace:
# Record an event
frame_id = trace.record({
"session_id": "550e8400-e29b-41d4-a716-446655440000",
"event_type": "thought",
"actor": {"type": "agent", "id": "my-agent"},
"content": {
"text": "Analyzing user request...",
"rationale_summary": "Breaking down the problem"
},
"metadata": {"model_name": "gpt-4"}
})
# Query the vault
results = trace.query("user request", limit=5)
# Verify integrity
status = trace.verify_integrity()
print(f"Integrity OK: {status['ok']}")
With Memvid Cloud (Optional)
For enhanced semantic search, create a .env file:
# Copy the example and add your key
cp .env.example .env
Then edit .env:
MEMVID_API_KEY=your-api-key-here
Or pass it directly in code:
trace = AxiomTrace("./my_vault", memvid_api_key="your-api-key")
Observer Pattern
from axiom_trace import AxiomTrace, session, observe, set_global_trace
trace = AxiomTrace("./my_vault")
set_global_trace(trace)
# Context manager for sessions
with session(session_id="my-session") as obs:
obs.record_user_input("What is the weather?")
obs.record_thought("Need to call weather API", "Determining tool to use")
obs.record_tool_call("weather_api", {"city": "NYC"})
obs.record_tool_output("weather_api", {"temp": 72, "condition": "sunny"})
obs.record_final_result("The weather in NYC is 72°F and sunny!")
# Decorator for automatic tracing
@observe(session_id="my-session")
def search_database(query: str) -> list:
return ["result1", "result2"]
CLI
# Record an event from JSON file
axiom record --vault ./my_vault --event event.json
# Query the vault
axiom query --vault ./my_vault --prompt "weather" --limit 5
# Export a session to Markdown
axiom export --vault ./my_vault --session <uuid> --out session.md
# Verify vault integrity
axiom verify --vault ./my_vault
# Show statistics
axiom stats --vault ./my_vault
Event Types
| Type | Description |
|---|---|
thought |
Agent reasoning (requires rationale_summary) |
tool_call |
Tool invocation (requires tool_name in metadata) |
tool_output |
Tool result (requires tool_name in metadata) |
user_input |
User message |
final_result |
Final response |
system_event |
System notifications |
error |
Error with stack trace |
Vault Structure
my_vault/
├── vault.manifest.json # Metadata + head hash
├── vault.lock # Write lock
├── vault.mv2 # Memvid index (optional)
├── frames.jsonl # Append-only frame storage
└── axiom.log # Internal logs
Integrity Verification
Axiom Trace uses SHA-256 hash chains for tamper detection:
result = trace.verify_integrity()
# {
# "ok": True,
# "checked_frames": 150,
# "head_hash": "abc123...",
# "error": None
# }
Detects:
- Modified frame content
- Deleted frames
- Reordered frames
- Manifest tampering
Environment Variables
| Variable | Description |
|---|---|
MEMVID_API_KEY |
API key for Memvid cloud features (enhanced semantic search) |
Publishing (for maintainers)
The package is automatically published to PyPI when you create a GitHub release:
- Go to GitHub → Releases → "Create a new release"
- Tag with version (e.g.,
v1.1.0) - Publish release
The GitHub Actions workflow handles building and uploading to PyPI.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file axiom_trace-1.1.0.tar.gz.
File metadata
- Download URL: axiom_trace-1.1.0.tar.gz
- Upload date:
- Size: 22.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
abf5ac776dd58b65fb15f6fc9c45674d5989c53b235c4dad95fc7b73276c585a
|
|
| MD5 |
f861ff253bcd9a1998529a05fba726e0
|
|
| BLAKE2b-256 |
d64cab1275020703f6604711418c0b82a122b8724af3053fee7de882c279851e
|
Provenance
The following attestation bundles were made for axiom_trace-1.1.0.tar.gz:
Publisher:
publish.yml on atharvayeola/axiom-trace
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
axiom_trace-1.1.0.tar.gz -
Subject digest:
abf5ac776dd58b65fb15f6fc9c45674d5989c53b235c4dad95fc7b73276c585a - Sigstore transparency entry: 806208919
- Sigstore integration time:
-
Permalink:
atharvayeola/axiom-trace@b9378335130509c7ba0e0b775c3045e53bad3cda -
Branch / Tag:
- Owner: https://github.com/atharvayeola
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b9378335130509c7ba0e0b775c3045e53bad3cda -
Trigger Event:
release
-
Statement type:
File details
Details for the file axiom_trace-1.1.0-py3-none-any.whl.
File metadata
- Download URL: axiom_trace-1.1.0-py3-none-any.whl
- Upload date:
- Size: 19.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d7e89ce84dd816d5417e29056002d437ee869f5f6815cf9bdcf6675d4d77c97d
|
|
| MD5 |
b538a1522198981666b04952925fb6e2
|
|
| BLAKE2b-256 |
7dda9529f3de1cf30b2b16a01db5ecf98e5be9841e6c897042d7aca5fd814777
|
Provenance
The following attestation bundles were made for axiom_trace-1.1.0-py3-none-any.whl:
Publisher:
publish.yml on atharvayeola/axiom-trace
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
axiom_trace-1.1.0-py3-none-any.whl -
Subject digest:
d7e89ce84dd816d5417e29056002d437ee869f5f6815cf9bdcf6675d4d77c97d - Sigstore transparency entry: 806209018
- Sigstore integration time:
-
Permalink:
atharvayeola/axiom-trace@b9378335130509c7ba0e0b775c3045e53bad3cda -
Branch / Tag:
- Owner: https://github.com/atharvayeola
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b9378335130509c7ba0e0b775c3045e53bad3cda -
Trigger Event:
release
-
Statement type: