a-agmon/rs-graph-llm
High-performance framework for building interactive workflow systems in Rust. Designed for complex workflows and multi-agent systems
What it solves
graph-flow provides a way to build complex, stateful AI agent workflows in Rust. It solves the difficulty of managing long-running agent processes that need to pause for human input, branch based on LLM decisions, or resume after a system restart, all while maintaining type safety and high performance.
How it works
The framework uses a graph-based execution engine where workflows are composed of Tasks (nodes) and Edges (connections).
- State Management: A thread-safe
Contextstores typed key-value data and chat history, which is serialized and persisted in aSession. - Execution Control: Tasks return a
NextActionto determine the flow. This allows for "step-by-step" execution (returning control to the caller after one task) or "fire-and-forget" execution (running multiple tasks in a chain until a pause is hit). - Routing: The engine supports standard edges, conditional edges (branching based on context data), and
FanOutTaskfor running multiple child tasks concurrently. - Persistence: It includes storage backends (In-memory and PostgreSQL) to ensure session state survives across process restarts.
- LLM Integration: Through an optional integration with the
Riglibrary, it simplifies managing chat history and interacting with LLM providers.
Who it’s for
Developers building production-grade AI agents in Rust who need a structured, resumable workflow engine similar to LangGraph but with Rust's performance and type guarantees.
Highlights
- Human-in-the-loop: Built-in
WaitForInputaction to park workflows until external input is provided. - Flexible Execution: Mixes interactive step-by-step execution with automated continuous chains.
- State Persistence: Native PostgreSQL support for session storage and optimistic locking to prevent race conditions.
- Parallelism:
FanOutTaskallows for concurrent execution of sub-tasks within a single node. - Type-Safe Context: A serialized, typed state store that works across async tasks and synchronous edge conditions.