Skip to main content

Crate pe_graph

Crate pe_graph 

Source
Expand description

§pe-graph — Graph execution engine for Potential Expectations

Implements the core graph primitives that agent topologies are built on:

  • StateGraph — declarative graph definition with typed nodes and edges
  • CompiledGraph — validated, executable graph with invoke() / resume()
  • GraphConfig — execution configuration (thread ID, recursion limit, etc.)
  • Checkpointer — trait for durable state persistence
  • GraphRegistry — named storage for compiled graphs

The execution engine uses the Pregel BSP model (Bulk Synchronous Parallel): nodes execute in parallel supersteps with snapshot isolation, writes are collected and applied atomically between steps.

Depends only on pe-core plus tokio and futures for async execution.

Re-exports§

pub use checkpointer::CheckpointMeta;
pub use checkpointer::Checkpointer;
pub use checkpointer::InMemoryCheckpointer;
pub use checkpointer::PendingWrite;
pub use command::Command;
pub use compiled::CompiledGraph;
pub use compiled::ExecutionOutcome;
pub use config::GraphConfig;
pub use graph::StateGraph;
pub use matrix_hook::ConvergenceRecorder;
pub use matrix_hook::DefaultMatrixHook;
pub use matrix_hook::MatrixHook;
pub use matrix_hook::MatrixHookHandle;
pub use matrix_hook::RoutingResolver;
pub use pending_writes::PendingWrites;
pub use registry::GraphRegistry;
pub use retry::RetryPolicy;
pub use retry::with_retry;
pub use snapshot::StateSnapshot;

Modules§

checkpointer
Checkpoint persistence — trait + in-memory implementation.
command
Graph commands – how users send input back to a paused graph.
compiled
Compiled graph — the user-facing execution handle.
config
Graph execution configuration.
graph
Graph definition — StateGraph<S> builder and validation.
matrix_hook
Matrix integration hook — trait for the optional matrix layer.
pending_writes
Pending writes tracking for fault tolerance within a superstep.
phase_store
Phase state store – re-exported from pe-core for convenience.
registry
Graph registry — named storage for compiled graphs.
retry
Retry policy – per-phase retry with exponential backoff and jitter.
snapshot
State snapshots for checkpoint inspection and time travel.

Structs§

CheckpointData
Internal wrapper for checkpoint serialization.
PhaseStateStore
Stores serialized phase state for nodes, keyed by phase enum TypeId.

Enums§

PhaseStoreError
Errors from phase state serialization/deserialization.

Constants§

END
Reserved graph exit point
START
Reserved graph entry point