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

Building complex AI agent workflows often means juggling multiple LLM calls, branching logic, user interruptions, and saving progress. This project provides a Rust-native framework that lets developers design stateful, resumable agent workflows as graphs — similar to LangGraph but with Rust's performance and type safety. It handles task orchestration, conditional routing, human-in-the-loop pauses, and session persistence out of the box.

How it works

The core idea is a graph of tasks. Each task implements a simple Task trait, reads and writes shared state via a Context object, and returns a NextAction that tells the engine what to do next (continue step-by-step, run continuously, wait for input, jump to a specific task, or end). A GraphBuilder assembles tasks and edges, optionally with conditional branches based on context data. Sessions store the state of a workflow, and a FlowRunner loads a session, executes one step, and saves it back — this allows workflows to pause, wait for user input, and resume later, even across process restarts. The framework integrates with the Rig LLM ecosystem for chat history conversion and also ships with an in-memory or PostgreSQL storage backend.

Who it's for

Developers building agentic applications that need structured, reliable, and resumable LLM-driven workflows — such as conversational services, claim processing pipelines, recommendation systems, or any multi-step automation with branching and human review. It suits Rust users who want type safety and performance over Python-based alternatives, and who appreciate a clean API inspired by LangGraph.

Highlights

  • Stateful and resumable: sessions can pause at any task, wait for user input, and resume later, with optional PostgreSQL persistence.
  • Flexible execution models: mix step-by-step interactive control with fire-and-forget continuous execution in the same graph.
  • Conditional routing: branch on context data, e.g., route based on an LLM's sentiment classification.
  • Human-in-the-loop support: tasks can return WaitForInput to park the workflow until a human responds.
  • Parallel fan-out: run child tasks concurrently within one graph node and aggregate their outputs.
  • Production guardrails: per-task timeouts, max execution step limits, and optimistic locking to prevent session write conflicts.
  • Rig integration: convert chat history stored in the context directly into Rig messages for LLM calls.
  • Real-world examples: a full insurance claims service with LLM classification, approval workflows, and an HTTP API; plus a RAG recommendation service.

Related

  • Project
  • Project
  • Project
  • Project
  • Project