LangGraph - Graph-based orchestration framework for building stateful LLM applications
LangGraph provides a low-level graph orchestration framework that enables:
- Stateful, long-running agent workflows
- Conditional routing and branching
- Subgraph composition
- Cycle support for iterative processes
Core Concepts
- StateGraph: Main graph class that manages State, Nodes, and Edges
- Node: Execution unit that takes state and produces state updates
- Edge: Transition between nodes (fixed or conditional)
- State: Data structure that flows through the graph
Example
use ;
use ;
// Define state
// Create graph
let mut graph = new;
// Add nodes
graph.add_node;
// Add edges
graph.add_edge;
graph.add_edge;
// Compile and run
let compiled = graph.compile;
let result = compiled.invoke.await?;