Skip to main content

Invisible events. Replayable graphs. An append-only execution-graph event model and deterministic reducer — provider-agnostic, storage is a port.

Project description

AxionGraph (Python)

AxionGraph logo

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 seq per run defines order; wall-clock ts is advisory.
  • Node/edge kind is an open taxonomy; supply a GraphVocabulary to 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

axiongraph-0.0.3.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

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

axiongraph-0.0.3-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file axiongraph-0.0.3.tar.gz.

File metadata

  • Download URL: axiongraph-0.0.3.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.18 {"installer":{"name":"uv","version":"0.11.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for axiongraph-0.0.3.tar.gz
Algorithm Hash digest
SHA256 a7cf7234a7085e48f1166c4ade22827abe454972d24d6a1adb4b5a725b54dc6e
MD5 15876737b07264c9d8515ea3efa642d2
BLAKE2b-256 9d2f30f4bbc46d8b508af4a5c51be6aa7badac39b95bce64e62d959922e75dc5

See more details on using hashes here.

File details

Details for the file axiongraph-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: axiongraph-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 13.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.18 {"installer":{"name":"uv","version":"0.11.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for axiongraph-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 dd50d81d3c14c6af0896f0cb58280b47b7eb03df8dbf288a495af7448c568d35
MD5 fe134628b3a777358427735d62c91546
BLAKE2b-256 273d280f04f77be710e10cbcadcca1a65d80427a46d1109f2eccbdb0cf773888

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