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.4.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.4-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: axiongraph-0.0.4.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.4.tar.gz
Algorithm Hash digest
SHA256 7c4bad53bfb38c298a5d7a8d12090ffc5fca779684296b28e1744e892261df8e
MD5 39f6cd107cb347e7e2e3b4e37610785a
BLAKE2b-256 0b649130fd935ff8f7b87d8c0eac85fd0e309b8292998176fef1323d302f881f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: axiongraph-0.0.4-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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 4339f6f13fa8d077fde85499914db159b6544bfa2dd29fd3423fb1fc14b808a7
MD5 a6dff753e950a26bb49060cf71891d41
BLAKE2b-256 cb534a49f552d486058972a9c54f00d65df5c947dd9848269747d266b84d260e

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