juncture
A Rust implementation of LangGraph's state machine framework for building LLM agent applications.
Juncture is a Rust port of LangGraph that lets you build AI agent workflows as directed graphs, with nodes running in parallel across CPU cores for speed, type safety, and flexible deployment including WebAssembly.
Juncture is a Rust implementation of LangGraph, a Python library used to build workflows for AI language model agents. LangGraph represents a workflow as a directed graph where each node is a step that processes some shared state and passes the result along to connected nodes. Juncture brings that same model to Rust while keeping the API close enough that developers already familiar with LangGraph Python can transfer their knowledge.
The practical difference Rust brings is how nodes run. In Python, asynchronous tasks run on a single thread taking turns. In Rust with the tokio runtime, nodes can run on multiple CPU cores simultaneously. The benchmarks in the README show Juncture completing graph traversals hundreds of times faster than LangGraph Python, though the README is upfront that this rarely matters in practice: when your nodes are making calls to AI APIs, the network time dwarfs any framework overhead. The benefit of Rust here is primarily type safety, memory efficiency, and deployment flexibility.
Juncture is organized into several packages. The core package handles graph construction and execution, including a state type derived at compile time, per-field rules for merging state updates, and a macro for pausing workflows to wait for human input. A checkpoint package handles saving and resuming workflow state using in-memory storage for development and SQLite or PostgreSQL for production. A facade package adds support for calling language models from providers including OpenAI, Anthropic, and Ollama, along with a factory function for building ReAct-style agents, which are a common pattern where a model alternates between deciding what tool to call and processing the tool's result.
The library also includes two observability packages. One integrates with the OpenTelemetry standard for distributed tracing. The other provides an embedded dashboard you can open in a browser to inspect traces, token usage, and costs, with optional synchronization to a cloud service called Langfuse. The library can also compile to WebAssembly for use in browsers or edge environments.
The repository includes fifteen progressive code examples, from a minimal state machine to a multi-agent setup with tool calling and streaming.
Where it fits
- Build AI agent workflows where multiple steps run in parallel across CPU cores for maximum throughput.
- Port an existing LangGraph Python workflow to Rust for better type safety, memory efficiency, or edge/WebAssembly deployment.
- Create ReAct-style agents that alternate between choosing a tool to call and processing the result, with OpenAI, Anthropic, or Ollama models.
- Monitor AI workflow costs, token usage, and traces via a built-in browser dashboard or Langfuse cloud sync.