cognis-graph
A state-aware graph execution engine for building complex AI agents and cyclic workflows.
Purpose
cognis-graph implements a Pregel-inspired superstep executor for executing graphs where nodes communicate via shared state. It is designed for building agents that require loops, complex decision trees, and persistent state across execution steps.
Key Features
- Typed State: Define your graph state as a Rust struct with per-field "reducers" (e.g., append to list, take last value).
- Cyclic Execution: Support for loops and conditional edges, enabling ReAct-style agent loops.
- Checkpointers: Built-in support for persisting graph state to memory, SQLite, or Postgres, allowing workflows to be paused and resumed.
- Runnable Integration: A compiled graph implements the
Runnable<S, S>trait, making it compatible with the rest of the Cognis ecosystem. - Audit Logs: Detailed execution tracking for debugging and observability.
Usage
Add this to your Cargo.toml:
[]
= "0.1.0"
Basic Example: A Simple State Machine
use *;
use ;
async