Agents

LangGraph Finally Makes Sense

All articles
🤖🧩⚙️

State Graphs Without The LangChain Hangover (Mostly)

LangGraph started life as LangChain's "what if we made it worse" experiment. v0.1 made you instantiate seven classes to draw a triangle. v0.3 just landed and — spoiler — the API is now small enough to fit in one screen and the mental model finally clicks.

The Setup

The pitch is simple: agent workflows are graphs. Nodes mutate state, edges decide where to go next. You define typed state, you wire nodes, you compile. Conditional edges handle branching. Checkpoints handle pause/resume. The graph is the program.

pip install "langgraph>=0.3" langchain-anthropic

The Money Pattern

A typed state dict, nodes that return partial updates, and edges that route. Persistence is one argument away. Streaming events come for free. This is the API I wished it had in 2024.

from typing import TypedDict, Annotated
from langgraph.graph import StateGraph, START, END
from langgraph.checkpoint.memory import MemorySaver
from langchain_anthropic import ChatAnthropic

class State(TypedDict):
    query: str
    plan: str
    answer: str

llm = ChatAnthropic(model="claude-opus-4-5")

def plan(state: State):
    out = llm.invoke(f"Plan steps for: {state['query']}")
    return {"plan": out.content}

def execute(state: State):
    out = llm.invoke(f"Execute plan: {state['plan']}")
    return {"answer": out.content}

graph = StateGraph(State)
graph.add_node("plan", plan)
graph.add_node("execute", execute)
graph.add_edge(START, "plan")
graph.add_edge("plan", "execute")
graph.add_edge("execute", END)

app = graph.compile(checkpointer=MemorySaver())
result = app.invoke({"query": "Summarise hail risk for Brisbane this weekend."},
                    config={"configurable": {"thread_id": "1"}})
print(result["answer"])

The Catch

It still pulls in a chunk of LangChain. The chat models, the message types, the runnable interface — they're all there. If you wanted a clean break from the LangChain ecosystem, this isn't it. Also: the docs love showing you the most complex example first. Skip the tutorials, read the API reference.

The Verdict

LangGraph v0.3 is the first version I'd actually recommend. State graphs are the right primitive for non-trivial agent workflows, and the checkpointing means you can build human-in-the-loop flows without inventing your own pause/resume protocol. If your agent has more than two steps and any branching, this beats writing your own runtime. Do not @ me when you accidentally enjoy using it.

Let us make some quick suggestions?
Please provide your full name.
Please provide your phone number.
Please provide a valid phone number.
Please provide your email address.
Please provide a valid email address.
Please provide your brand name or website.
Please provide your brand name or website.