Channel-based, super-step workflow orchestration engine for the Matrx ecosystem
Actively maintained. Last release 7 days ago. A safe choice.
pip install matrx-graphmatrx-graph
Channel-based, super-step workflow orchestration engine for the Matrx ecosystem. Think of it as a typed DAG + Pregel scheduler designed for mixing deterministic nodes with agent-style nodes in the same graph, with durable checkpoints and optional human-in-the-loop interrupts.
Install
pip install matrx-graph # core engine, in-memory checkpointer
pip install "matrx-graph[postgres]" # + durable Postgres checkpointer (via matrx-orm)
pip install "matrx-graph[otel]" # + OpenTelemetry instrumentation
Python 3.13+ required. Depends on matrx-connect (for AppContext and Emitter), matrx-utils, pydantic.
For standalone Postgres, apply
matrx_graph/db/migrations/0100_baseline_post_reorg.sql, register the database
with matrx-orm, then call
matrx_graph.db.configure_standalone_db("<registered-name>"). Aidream hosts use
their generated package wiring instead.
Design pillars
- Channels + reducers, not mutable state. Nodes return partial updates; a reducer merges them into typed channels. Safe under parallel writes.
- Pregel super-steps. Each step: active nodes run in parallel via
asyncio.TaskGroup→ writes reduced into state → next wave scheduled. Predictable and debuggable. - Durable checkpoints. Every super-step produces a checkpoint. Resume, fork, or time-travel from any point.
MemoryCheckpointerfor tests,PostgresCheckpointer(viamatrx-graph[postgres]) for prod. - JSON-only channel values. Pydantic models are dumped at write. Checkpoints round-trip losslessly.
- Typed nodes. Every
NodeSpecdeclaresinput_schema,output_schema,config_schema(Pydantic). JSON Schema is auto-exported for UI form generation. - Explicit edge semantics. Data / Control / Conditional / Error / Stream edges — no guessing from topology.
- Interrupts + Send. First-class primitives for human-in-the-loop pauses and dynamic fanout.
Design principle
Choose where to be deterministic and where to delegate to an agent.
A workflow can do everything an agent can (branch, loop, dispatch tools) but is more predictable, debuggable, and cheaper. An agent can do everything a workflow can but adapts to unexpected input. exists so authors draw that line consciously per node.