Burr vs LangGraph
Stateful agent frameworks compared: declarative state machine vs graph-based computation
Overview
Stateful agent frameworks compared: declarative state machine vs graph-based computation
Verdict
Stateful agent frameworks compared: declarative state machine vs graph-based computation
Details
Burr vs LangGraph
Overview
Burr and LangGraph are both Python frameworks for building stateful AI agents, but they take fundamentally different approaches to agent architecture. Burr emphasizes a declarative, state-machine-based approach with built-in observability, while LangGraph provides a graph-based, cyclical computation model with fine-grained control over agent execution.
Comparison Table
| Feature | Burr | LangGraph |
|---|---|---|
| Programming Model | State machine (actions + transitions) | Graph-based (nodes + edges) |
| State Management | Built-in, automatic | Explicit, manual |
| Observability | Built-in (traces, logs, metrics) | Requires LangSmith integration |
| Learning Curve | Gentle, Pythonic | Steeper, more concepts |
| Testing | Built-in testing framework | Manual testing required |
| A/B Testing | Built-in support | Not built-in |
| Streaming | Native support | Supported |
| Human-in-the-loop | Via hooks | Via interrupt/resume |
| Community | Growing (DAGWorks) | Large (LangChain ecosystem) |
| GitHub Stars | ~1,200 | ~12,000+ |
Core Philosophy
Burr: Declarative State Machine
Burr models agents as state machines where you define:
- Actions: Units of work that transform state
- Transitions: Rules for moving between states
- Hooks: Side effects and observability
@action(reads=["messages"], writes=["response"])
def respond(state: State) -> tuple[dict, State]:
response = llm.generate(state["messages"])
return {"response": response}, state.update(response=response)
LangGraph: Cyclical Computation Graph
LangGraph models agents as graphs where you define:
- Nodes: Functions that process state
- Edges: Conditional routing between nodes
- State Schema: Explicit state definition
class AgentState(TypedDict):
messages: Annotated[list[BaseMessage], add_messages]
builder = StateGraph(AgentState)
builder.add_node("agent", agent_node)
builder.add_node("tools", tool_node)
builder.add_conditional_edges("agent", should_continue)
Key Differences
1. State Management
Burr handles state automatically — you declare what you read and write, and Burr tracks everything. This reduces boilerplate and prevents state bugs.
LangGraph requires explicit state management. You define the state schema and manually pass state between nodes. More control, more responsibility.
2. Observability
Burr has observability built in — traces, logs, and metrics are automatic. No additional setup required.
LangGraph requires LangSmith for full observability. Without it, you get limited visibility into agent execution.
3. Testing
Burr includes a testing framework that lets you write tests as agent actions. Tests run alongside your agent and can verify state transitions.
LangGraph requires manual test writing. You need to set up test fixtures and mock dependencies yourself.
4. A/B Testing
Burr supports A/B testing out of the box — you can define multiple action variants and route traffic between them.
LangGraph doesn't have built-in A/B testing. You'd need to implement this yourself or use external tools.
5. Flexibility
Burr is opinionated — the state machine model works well for many use cases but can feel restrictive for complex workflows.
LangGraph is more flexible — you can build arbitrary graph topologies, including cycles, parallel branches, and dynamic routing.
When to Choose Burr
- You want a gentle learning curve and Pythonic API
- Observability is a priority and you don't want to set up external tools
- You need built-in testing and A/B testing
- Your agent has a clear state machine structure
- You prefer declarative configuration over imperative code
When to Choose LangGraph
- You need maximum flexibility in agent architecture
- You're already invested in the LangChain ecosystem
- Your agent requires complex graph topologies (cycles, parallel branches)
- You want fine-grained control over state and execution
- You're building research-grade or highly customized agents
Verdict
Choose Burr if you want a production-ready framework with built-in observability, testing, and A/B testing — especially for straightforward state machine agents. Choose LangGraph if you need maximum flexibility, are already using LangChain, or are building complex, non-linear agent architectures.
