Invisible events. Replayable graphs. An append-only execution-graph event model and deterministic reducer — provider-agnostic, storage is a port.
Project description
AxionGraph (Python)
Invisible events. Replayable graphs.
AxionGraph is an append-only event model and deterministic reducer for execution graphs. It records graph events from agents, tools, workflows, and connectors, then folds them into portable graph state for storage, replay, testing, and visualization.
This is the Python mirror of axiongraph on npm;
the two cores are kept in lockstep by shared cross-language parity fixtures.
from axiongraph import reduce_all
events = [
{"id": "evt_01", "runId": "run_01", "seq": 1, "ts": "2026-06-02T12:00:00.000Z",
"type": "node_created", "node": {"id": "agent_research", "kind": "agent", "label": "Research Agent"}},
{"id": "evt_02", "runId": "run_01", "seq": 2, "ts": "2026-06-02T12:00:01.000Z",
"type": "node_created", "node": {"id": "tool_web", "kind": "tool", "label": "Web Search"}},
{"id": "evt_03", "runId": "run_01", "seq": 3, "ts": "2026-06-02T12:00:02.000Z",
"type": "edge_created",
"edge": {"id": "edge_01", "kind": "called_tool", "from": "agent_research", "to": "tool_web", "status": "completed"}},
]
state = reduce_all("run_01", events)
print(len(state.nodes)) # 2
print(len(state.edges)) # 1
Core ideas
- Append-only events are the source of truth; graph state is derived by folding them.
- The reducer is pure and deterministic — identical event logs fold to byte-identical state.
- A monotonic
seqper run defines order; wall-clocktsis advisory. - Node/edge
kindis an open taxonomy; supply aGraphVocabularyto reject unknown kinds. - Storage is a port (
GraphStore); rendering and realtime transport are consumer concerns. - Event/payload shapes use the same wire keys as the TypeScript package (
runId,from) so the same events flow across both runtimes.
One package, opt-in extras
AxionGraph ships as a single axiongraph distribution. The core API is the top-level import;
optional backends are installed as extras (pip install axiongraph[...]). The local stores
need no extra — sqlite3 is in the standard library.
| Import | Description |
|---|---|
axiongraph |
Event model, deterministic reducer, canonicalizer, vocabulary machinery, and the GraphStore port. |
axiongraph.store_local |
Zero-service reference adapters: an in-memory store and a sqlite3-backed durable store. |
Install
pip install axiongraph # or: uv add axiongraph
Storing and replaying events
from axiongraph.store_local import SqliteStore # or InMemoryStore
store = SqliteStore("./run.db") # ":memory:" by default
await store.append(events) # idempotent on (runId, seq)
state = await store.snapshot("run_01")
Both InMemoryStore and SqliteStore satisfy the same GraphStore protocol and are
interchangeable; any future adapter that passes the shared contract suite drops in the same way.
Development
Python 3.11+ and uv. The repo is an internal package set
(packages/core, packages/store-local) assembled by hatchling into the one axiongraph
distribution.
uv sync --dev
uv run ruff check . && uv run ruff format --check .
uv run ty check
uv run pytest
Status
Early development. The reducer and reference stores are implemented and pass the same parity fixtures as the TypeScript package.
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 axiongraph-0.0.1.tar.gz.
File metadata
- Download URL: axiongraph-0.0.1.tar.gz
- Upload date:
- Size: 8.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a115ee1fb2accb4e77de71430a1b583cebd1895e1c6a0433b2d68c965d394313
|
|
| MD5 |
1538b72c4860a680ebef9a912488bf4d
|
|
| BLAKE2b-256 |
13f145441c84cb0dea72fccb666a7af6071d46916dee9dde69e950eab205284d
|
File details
Details for the file axiongraph-0.0.1-py3-none-any.whl.
File metadata
- Download URL: axiongraph-0.0.1-py3-none-any.whl
- Upload date:
- Size: 12.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0296600a1df3c45f76278f470a354b3dd526f55bc4926633c9fb081dca46388d
|
|
| MD5 |
9972d85fcb85bf14b78b267ab85657ba
|
|
| BLAKE2b-256 |
e0fd433287f9b245d47e3baf597d90fb3e7c6dec3ce3abbeeb121f0edb1718d1
|