The LangChain & LangGraph Field Guide
A working-knowledge reference on LangChain and LangGraph: how the two actually relate, what each building block does, how it shows up commercially and in the open-source ecosystem, how to run it for free, and the questions you're actually likely to be asked.
Overview & Mental Model
Two frameworks, one company, one increasingly blurred line between them. Get the relationship straight first — everything else follows from it.
LangChain is a framework for building LLM-powered applications: standardised interfaces to chat models, tools, prompts, retrievers and — as of LangChain 1.0 — a single, opinionated way to build an agent (create_agent). It's the "I want the common case to just work" layer.
LangGraph is a lower-level orchestration runtime for building stateful, controllable applications as graphs: nodes do work, edges decide what happens next, and the whole thing is checkpointed so it can survive a crash, pause for a human, or be resumed hours later from exactly where it left off. It's the "I need to control precisely what happens next" layer.
As of the 1.0 releases, these are no longer two competing choices. LangGraph is now the foundation LangChain's agents run on — create_agent is built on top of the LangGraph runtime to get durable execution, streaming and human-in-the-loop "for free." You reach for plain LangChain when the standard agent loop fits; you drop to LangGraph directly when you need custom control flow, multiple cooperating agents, or fine-grained state.
Design philosophy
- Model-agnostic: a provider-qualified string like
"anthropic:claude-sonnet-4-6"swaps providers without rewriting application code. - Composable, not monolithic: messages, tools, retrievers and the agent loop are independently usable pieces.
- Escapable abstractions:
create_agentis a thin, inspectable layer over LangGraph primitives you can drop to at any point — not a black box. - Durable by default: LangGraph checkpoints state at every step, so "the process died mid-run" is a resume, not a restart.
The four layers
- langchain-core — shared base abstractions: messages, the
Runnableinterface, output parsers. - langgraph — the graph execution runtime:
StateGraph, checkpointers, persistence, streaming. - langchain — the opinionated layer:
create_agent, prebuilt tools, 600+ integrations. - langsmith — commercial observability/eval layer that traces calls from either layer above.
The single most common gap candidates show is knowing the APIs but not knowing when to use which layer — and not being able to talk about production concerns (state, persistence, cost, observability). That plays directly to strengths you already have from MLOps/platform ownership: a checkpointer's thread_id is functionally your run/session key; a supervisor agent's routing logic is a decisioning layer, conceptually not far from a champion/challenger setup.
Suggested Study Path
A focused week if you're starting from zero. Each day builds something small and runnable rather than just reading.
| Day | Focus | Hands-on outcome |
|---|---|---|
| Day 1 | LangChain fundamentals — messages, chat models, tools, create_agent | A single tool-calling agent that answers questions using one custom tool |
| Day 2 | LangGraph fundamentals — StateGraph, state schema, nodes, edges | A 3-node graph built by hand, no prebuilt agent — see what create_agent does for you |
| Day 3 | Persistence & control — checkpointers, threads, interrupt(), streaming | Add memory across turns, then a human-approval step before a "risky" tool call |
| Day 4 | Retrieval — embeddings, vector stores, RAG | A small RAG chatbot answering questions over a handful of your own PDFs/notes |
| Day 5 | Multi-agent patterns — supervisor, handoffs, subgraphs, Send | A 2-agent supervisor system (e.g. a router + a specialist agent) |
| Day 6 | Observability & deployment — LangSmith tracing/eval, LangGraph Platform | Instrument Day 5's agent with tracing and look at the resulting trace tree |
| Day 7 | Interview prep | Work the Interview Questions section out loud, then re-read the Glossary cold |
Do Day 1 and Day 2 back to back — build the same simple agent both ways (create_agent, then by hand in StateGraph). That single exercise is what makes the "LangGraph is the runtime under LangChain" relationship click.
Architecture
How the pieces actually stack — the diagram most candidates can gesture at but can't draw accurately.
Fig. 1 — create_agent is a thin, opinionated layer over the LangGraph runtime; both sit on the same langchain-core message/Runnable foundation, and LangSmith can trace calls made at either level.
The execution model: super-steps, not a call stack
LangGraph borrows its execution model from Pregel, Google's message-passing framework for large-scale graph processing. The graph runs in discrete super-steps: on each super-step, every currently-active node runs (in parallel if there's more than one), each returns a state update, those updates are merged via each field's reducer, and any node that update should activate becomes active for the next super-step. The graph halts when no nodes are active and no messages are in flight. This is why a checkpoint can capture "the state of the whole graph" as a single well-defined snapshot — it's always taken between super-steps, never mid-node.
Two kinds of persisted memory
Checkpointer (short-term / thread-scoped): the full graph state at each super-step, keyed by thread_id — lets a conversation resume, survive a crash, or be rewound (time travel). Store (long-term / cross-thread): a separate key-value store for facts that should persist across threads/sessions, not tied to any one run.
Where LangSmith fits
LangSmith isn't part of the execution path — it's an observer. Set two environment variables (LANGSMITH_TRACING=true, LANGSMITH_API_KEY) and every LangChain/LangGraph call emits trace data automatically, with no code changes.
LangChain Building Blocks
The vocabulary for the "opinionated" layer — what most people mean when they say "I built this with LangChain."
Messages & Content Blocks
The unit of conversation: HumanMessage, AIMessage, SystemMessage, ToolMessage. Since 1.0, every message also exposes a standardised .content_blocks property that normalises provider-specific output — text, reasoning, tool calls, citations — into one consistent shape.
Chat Models
A unified interface across 15+ providers. init_chat_model() takes a provider-qualified string or a live model instance, so swapping providers is a one-line change rather than a rewrite.
Tools
Any Python callable the model can choose to invoke, turned into a tool via the @tool decorator or passed as a plain function to create_agent. ToolNode is the prebuilt LangGraph node that executes whichever tool call the model requested.
create_agent · 1.0
The standard factory: "a model calling tools in a loop until the task is complete." Takes a model, tools, an optional system prompt, middleware, a response_format, and a checkpointer. The docs frame it as Agent = Model + Harness — the harness being the prompt, tools and middleware that shape what context the model sees.
Middleware · 1.0
Composable hooks that intercept the agent loop — before_model, after_model, wrap_model_call, modify_model_request — chained like web-server middleware. Built-ins ship for summarisation, human-in-the-loop review, and Anthropic prompt caching.
Retrieval & RAG
LangChain's original bread and butter: text splitters, embedding-model wrappers, and a common Retriever interface over 100+ vector stores, so "give the model your own documents" is a swappable backend, not a rewrite per database.
LangGraph Building Blocks
The vocabulary for the runtime layer — what you reach for once the standard agent loop isn't enough.
StateGraph & State
The graph is parameterised by a State schema — a TypedDict, dataclass, or Pydantic model describing every field the graph carries around. It's the "shape of memory" for the whole run.
Nodes & Edges
A node is a function (state) -> update. A normal edge is a fixed transition; a conditional edge calls a routing function to pick the next node dynamically. START/END are virtual nodes marking entry and exit.
Reducers & add_messages
Every state field has a reducer governing how a node's update merges into existing state. The default reducer overwrites; the prebuilt add_messages reducer instead appends to a message list and de-duplicates by message ID.
Command & Send
Command combines a state update and routing in one return value, and also resumes execution after an interrupt. Send fans a node out over a dynamically-sized list — one Send per item — enabling map-reduce-style parallel work.
Checkpointers & Persistence
State is snapshotted at every super-step boundary, keyed by thread_id. That durability is what makes resuming after a crash, pausing for a human, and "time travel" possible — not bolted-on logging, but the execution model itself.
Human-in-the-loop
interrupt() pauses a running graph mid-node to surface a question or approval request to a human, then Command(resume=...) continues execution from that exact point.
What's New in 1.0
LangChain 1.0 and LangGraph 1.0 shipped together as a matched pair and reached general availability in 2026 — a real architectural shift from the tutorials most search results still show.
- create_agent replaces the old patterns. Earlier
create_react_agent/AgentExecutorapproaches are superseded by one standardised factory built directly on LangGraph. - Middleware is the new extensibility primitive. Instead of subclassing an executor, you compose hooks — the same shape as web-server middleware, applied to "context engineering."
- Standardised .content_blocks. A direct response to LLM APIs increasingly returning structured lists of content rather than plain strings — one shape across providers.
- LCEL and ad-hoc chains are de-emphasised. For anything beyond a simple linear pipeline, current guidance is "use
langgraphand build your own." Alangchain-legacypackage preserves the old chain APIs for migration. - Deep Agents — a new open-source package (built on
create_agent+ LangGraph) that bundles a planning/todo tool, a virtual filesystem, sub-agent spawning, and long-running-task support into one opinionated harness. - LangGraph 1.0 GA. The Pregel-style runtime, its checkpointing API, and LangGraph Studio/Platform are now considered stable, production-grade surface area.
Huge amounts of existing tutorial content pre-date 1.0 and show AgentExecutor, initialize_agent, or long prompt | model | parser LCEL pipe-chains as "the" way to build an agent. Recognise that pattern — you'll meet it in real (older) codebases — but be ready to say what current guidance actually recommends: create_agent for the standard case, LangGraph directly for anything custom.
Commercial & Open-Source Implementations
LangChain and LangGraph themselves are free and open source — LangChain, Inc. monetises the layers around them: observability/eval (LangSmith) and managed deployment (LangGraph Platform).
Ways to build & run LangChain/LangGraph apps
Plain open-source libraries
Self-hosted, open source. pip install langchain langgraph and run entirely on your own infrastructure — your own checkpointer database, compute, and API keys.
LangSmith
Managed, commercial. Tracing, dataset-based evals, annotation queues, a prompt hub, production dashboards. Free tier (5,000 traces/month, 14-day retention); Plus ≈ US$39/seat/month (10,000 traces, 400-day retention); custom Enterprise pricing with SSO/RBAC.
LangGraph Platform
Managed, commercial. Purpose-built deployment infrastructure for long-running, stateful agents: managed checkpointer/Postgres, horizontal scaling, streaming and human-in-the-loop endpoints. Spans fully-managed Cloud SaaS down to self-hosted options.
LangGraph Studio
Free tool. A visual graph debugger — see state at each node, step through execution, replay from a checkpoint. Runs locally via langgraph dev or connects to a deployed Platform instance.
Deep Agents
Open source. The opinionated harness described above — planning tool, virtual filesystem, sub-agents — free to self-host, works with any model create_agent supports.
Docker Compose / Kubernetes
Self-hosted, open source. The common self-hosted pattern for a LangGraph Platform-style deployment: your agent code + PostgreSQL as the checkpointer + Redis for pub/sub.
Adjacent / competing frameworks
These solve overlapping problems — worth knowing the honest trade-offs rather than dismissing them, especially in an interview.
LlamaIndex
Open source. A data-framework-first competitor — strongest at ingestion, indexing and retrieval for RAG, with less fine-grained orchestration control than LangGraph.
CrewAI
Open source. Role-based multi-agent coordination as a first-class primitive — the fastest path to a working multi-agent prototype. More black-box than LangGraph, no built-in cost caps.
Microsoft Agent Framework
Vendor (Microsoft). Unified AutoGen and Semantic Kernel into one SDK (.NET + Python) in 2026; AutoGen is now in maintenance mode. The natural choice inside an Azure-standardised stack.
PydanticAI
Open source. Type-safety-first: validated outputs, built-in usage/cost limits, consistently rated highest for developer experience. Ecosystem roughly an order of magnitude smaller than LangChain's.
Mastra
Open source. TypeScript-native, serverless-first, with automatic context/memory compression — the natural pick for a JS/TS web team on Vercel-style serverless.
Haystack (deepset)
Open source. A mature, pipeline-first RAG framework — strong in enterprise search/QA where the workload really is "retrieve then answer."
Comparison Table
High-level trade-offs — treat exact pricing as indicative and time-boxed to 2026.
| Tool | Licence | Strength | Weakness | Best fit |
|---|---|---|---|---|
| LangChain + LangGraph | MIT, free | Huge integration surface, full orchestration control | Steep learning curve; historical churn left outdated tutorials | Python teams needing stateful, production-grade agents |
| LangSmith | Commercial, free tier | Purpose-built tracing/eval, deep LangChain integration | Cost scales with trace volume and seats | Teams already on LangChain/LangGraph |
| LangGraph Platform | Commercial (+ self-hosted tiers) | Zero-ops durable execution, scaling, HITL endpoints | Best value only if already invested in LangGraph | Teams that don't want to operate checkpointer infra |
| CrewAI | Open source (+ commercial cloud) | Fastest path to a role-based multi-agent prototype | Harder to debug at scale; no built-in cost controls | Rapid multi-agent prototyping |
| LlamaIndex | Open source, MIT | Best-in-class data ingestion/indexing for RAG | Less orchestration control for complex workflows | Retrieval-heavy applications |
| Microsoft Agent Framework | Open source + Azure services | Unified, enterprise-supported .NET/Python SDK | Younger unified surface area post-merger | Teams standardised on Azure |
| PydanticAI | Open source, MIT | Type safety, best DX scores | Much smaller ecosystem | Type-safety-focused teams |
Local Setup
Three levels: the two-minute local agent, a visual debugger, and a production-like Docker Compose stack.
Level 1 — Zero-config local agent
No server, no vector database — just an API key. Works the same with a fully local model via Ollama if you'd rather not use a paid API while practising.
pip install langchain langgraph langchain-anthropic
export ANTHROPIC_API_KEY="sk-..."
python - <<'PY'
from langchain.agents import create_agent
def get_weather(city: str) -> str:
"""Get the current weather for a city."""
return f"It's sunny in {city}."
agent = create_agent(
model="anthropic:claude-sonnet-4-6",
tools=[get_weather],
system_prompt="You are a concise assistant.",
)
result = agent.invoke({"messages": [{"role": "user", "content": "Weather in Melbourne?"}]})
print(result["messages"][-1].content)
PY
Level 2 — LangGraph Studio (visual debugger)
pip install langgraph-cli
langgraph dev # reads langgraph.json in the current project, opens Studio in your browser
Install Ollama, pull an open-weight model (ollama pull llama3.1), then point LangChain at it with init_chat_model("ollama:llama3.1"). Pair it with a local vector store (pip install chromadb) and you can work through this entire guide's exercises offline and free.
Level 3 — Docker Compose: Postgres checkpointer (production-like)
services:
postgres:
image: postgres:16
environment:
POSTGRES_USER: langgraph
POSTGRES_PASSWORD: langgraph
POSTGRES_DB: langgraph
volumes: [pgdata:/var/lib/postgresql/data]
ports: ["5432:5432"]
agent:
build: .
depends_on: [postgres]
environment:
DATABASE_URL: postgresql://langgraph:langgraph@postgres:5432/langgraph
ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY}
ports: ["8000:8000"]
volumes: {pgdata: {}}
from langgraph.checkpoint.postgres import PostgresSaver
with PostgresSaver.from_conn_string(DATABASE_URL) as checkpointer:
checkpointer.setup() # creates tables on first run
graph = builder.compile(checkpointer=checkpointer)
Command cheat sheet
| Command | What it does |
|---|---|
| pip install langchain langgraph | Core libraries for building agents and graphs |
| pip install langgraph-cli | Adds the langgraph CLI (dev, up, build) |
| langgraph dev | Local dev server + LangGraph Studio, hot-reloading |
| langgraph up | Runs the graph as a local API server (Docker-based) |
| LANGSMITH_TRACING=true | Env var that turns on automatic tracing, no code changes |
| config={"configurable": {"thread_id": "..."}} | Runs the agent within a persisted conversation thread |
Quickstart Code
The patterns you should be able to sketch from memory — including what create_agent is actually doing underneath.
The same agent, two ways
from langchain.agents import create_agent
agent = create_agent(model="anthropic:claude-sonnet-4-6", tools=[get_weather])
from langgraph.graph import StateGraph, START, END, MessagesState
from langgraph.prebuilt import ToolNode
def call_model(state: MessagesState):
response = model.bind_tools([get_weather]).invoke(state["messages"])
return {"messages": [response]}
def should_continue(state: MessagesState) -> str:
last = state["messages"][-1]
return "tools" if getattr(last, "tool_calls", None) else END
builder = StateGraph(MessagesState)
builder.add_node("agent", call_model)
builder.add_node("tools", ToolNode([get_weather]))
builder.add_edge(START, "agent")
builder.add_conditional_edges("agent", should_continue, {"tools": "tools", END: END})
builder.add_edge("tools", "agent") # loop back after a tool call
graph = builder.compile()
Adding persistence and a human-approval step
from langgraph.checkpoint.memory import InMemorySaver
from langgraph.types import interrupt, Command
def call_risky_tool(state: MessagesState):
approved = interrupt({"question": "Allow this tool call?", "call": state["messages"][-1]})
if not approved:
return {"messages": [{"role": "tool", "content": "Rejected by reviewer."}]}
return {"messages": [run_the_actual_tool(state)]}
graph = builder.compile(checkpointer=InMemorySaver())
config = {"configurable": {"thread_id": "conversation-1"}}
graph.invoke({"messages": [...]}, config=config) # pauses at interrupt()
# ...later, once a human has reviewed it...
graph.invoke(Command(resume=True), config=config) # resumes exactly where it paused
A minimal RAG tool
from langchain_chroma import Chroma
from langchain_anthropic import AnthropicEmbeddings
vectorstore = Chroma.from_documents(docs, embedding=AnthropicEmbeddings())
retriever = vectorstore.as_retriever(search_kwargs={"k": 4})
def search_docs(query: str) -> str:
"""Search internal documents for relevant context."""
results = retriever.invoke(query)
return "\n\n".join(d.page_content for d in results)
rag_agent = create_agent(model="anthropic:claude-sonnet-4-6", tools=[search_docs])
RAG as a LangGraph node, with a retry loop
The tool above is RAG as a single call: retrieve once, answer, done — fine when retrieval is reliable. Once you want the agent to judge whether what it retrieved is actually good enough and try a reformulated query before giving up, that's control flow, which is what LangGraph is for.
from typing import TypedDict
from langgraph.graph import StateGraph, START, END
class RAGState(TypedDict):
question: str
query: str
docs: list[str]
attempts: int
answer: str
def retrieve(state: RAGState) -> dict:
docs = retriever.invoke(state["query"])
return {"docs": [d.page_content for d in docs]}
def grade_docs(state: RAGState) -> str:
if state["docs"] and looks_relevant(state["question"], state["docs"]):
return "generate"
if state["attempts"] >= 2:
return "generate" # give up gracefully rather than loop forever
return "reformulate"
def reformulate(state: RAGState) -> dict:
better = model.invoke(f"Rewrite for search, prior results were weak: {state['question']}")
return {"query": better.content, "attempts": state["attempts"] + 1}
def generate(state: RAGState) -> dict:
context = "\n\n".join(state["docs"]) or "No relevant documents found."
response = model.invoke(f"Answer using only this context:\n{context}\n\nQuestion: {state['question']}")
return {"answer": response.content}
builder = StateGraph(RAGState)
builder.add_node("retrieve", retrieve)
builder.add_node("reformulate", reformulate)
builder.add_node("generate", generate)
builder.add_edge(START, "retrieve")
builder.add_conditional_edges("retrieve", grade_docs, {"generate": "generate", "reformulate": "reformulate"})
builder.add_edge("reformulate", "retrieve") # loop back and try again
builder.add_edge("generate", END)
rag_graph = builder.compile()
RAG is the technique (retrieve, then generate); LangChain is a toolkit that makes the retrieval half faster to wire up; LangGraph is what you reach for once retrieval needs to be one step inside something stateful or looping, rather than a single linear call.
A minimal 2-agent supervisor
from langgraph_supervisor import create_supervisor
research_agent = create_agent(model="anthropic:claude-sonnet-4-6", tools=[search_docs])
writer_agent = create_agent(model="anthropic:claude-sonnet-4-6", tools=[])
supervisor = create_supervisor(
agents=[research_agent, writer_agent],
model="anthropic:claude-sonnet-4-6",
prompt="Route research questions to research_agent, drafting requests to writer_agent.",
).compile(checkpointer=InMemorySaver())
Interview Questions
Grouped by depth. Click to reveal a model answer — write your own version in your own words before reading mine.
Conceptual
coreWhat's the actual difference between LangChain and LangGraph?
LangChain is the opinionated, higher-level layer — standardised models/messages/tools and one recommended way to build an agent (create_agent). LangGraph is the lower-level orchestration runtime — a graph of nodes and edges with durable, checkpointed execution. As of the 1.0 releases they're not alternatives: create_agent is built on top of LangGraph, which supplies the durable-execution runtime underneath it.
coreWhat is create_agent, and what does "Agent = Model + Harness" mean?
create_agent is the standard factory for "a model calling tools in a loop until the task is complete." The harness is everything around the model that shapes what it sees and can do — the system prompt, the available tools, and middleware — and the framing is that most of the engineering work in a good agent is in the harness, not the loop itself.
coreWhat problem does middleware solve that a plain agent loop doesn't?
Production agents need fine-grained control over context — trimming a conversation before it blows the context window, redacting PII, injecting caching hints, pausing for human review. Middleware gives named hook points to do this without subclassing the whole agent, composing in a defined order like web-server middleware.
coreWhat is a checkpointer, and why is it central to LangGraph rather than an add-on?
LangGraph executes in discrete super-steps, and a checkpointer snapshots the entire graph state at each boundary, keyed by thread_id. Because it's built into the execution model itself, it's what makes crash recovery, pausing for a human, resuming days later, and time-travel debugging all possible — it isn't logging bolted on afterward.
coreWhat's a reducer, and why does add_messages matter?
A reducer defines how a node's returned update merges into existing state for a given field. The default reducer just overwrites the old value. add_messages is the prebuilt reducer for chat history: instead of overwriting, it appends and de-duplicates by message ID — without it, every node's response would erase the conversation so far.
Practical / hands-on
practicalHow would you give an agent memory across multiple conversation turns?
Compile the graph (or create_agent) with a checkpointer, then pass a consistent thread_id in the config on every call. LangGraph automatically loads that thread's prior state before running and saves the new state after.
practicalHow would you make a tool call require human approval before it executes?
Call interrupt() inside the node that would perform the risky action. The graph pauses and persists its state via the checkpointer. Resuming later with Command(resume=<decision>) against the same thread_id continues execution from that exact point.
practicalHow do you stop a long conversation from blowing the model's context window?
Use the built-in summarisation middleware (a before_model hook) to compress older messages past a configured threshold before they reach the model, keeping recent turns verbatim.
practicalHow would you fan an agent out to process 50 items in parallel and combine the results?
Use the Send API from a conditional edge: return a list of Send("worker_node", {...}) objects, one per item. A downstream node with an accumulating reducer then combines the results — LangGraph's map-reduce pattern.
practicalHow would you instrument an agent so you can debug a bad response after the fact?
Set LANGSMITH_TRACING=true and a LANGSMITH_API_KEY — every model call, tool call and retrieval is captured as a hierarchical trace with no code changes. For the graph's control flow specifically, LangGraph Studio lets you step through execution node-by-node and replay from an earlier checkpoint.
Architecture & production
scenarioYour agent needs to survive the process restarting mid-conversation. How does LangGraph help, and what's still on you?
Swap the in-memory checkpointer for a database-backed one (e.g. PostgresSaver); since state is persisted at every super-step, a restarted process can resume any thread exactly where it left off. Still your responsibility: the database's own availability/backups, idempotency of any external side effects a node performs, and monitoring for threads stuck mid-interrupt waiting on a human who never responds.
scenarioHow would you control cost and latency in a multi-step agent that might call a tool dozens of times?
Cap total steps/tool calls and route to a fallback once exceeded; use a cheaper/faster model for routing or summarisation nodes and reserve the strongest model for the node that needs it; enable prompt caching so repeated system-prompt/tool-schema tokens aren't re-billed every turn; use LangSmith's cost/latency dashboards to find the actual bottleneck rather than guessing.
scenarioWhen would you choose a supervisor multi-agent pattern over one agent with many tools?
One agent with many tools works until the tool list or required expertise gets too broad for one system prompt/context — the model starts picking the wrong tool or losing track of long-running sub-tasks. A supervisor pattern splits that into specialist sub-agents plus a router, at the cost of more moving parts and an extra hop of latency per handoff — the same trade-off as "one monolith vs. several bounded services."
scenarioHow do you evaluate whether an agent's output is actually good, when there's no single "correct" answer?
Build an eval dataset of representative inputs, and score outputs with a mix of deterministic checks (did it call the right tool, is the output valid JSON) and LLM-as-judge scorers for open-ended quality (faithfulness, relevance, tone) — run via LangSmith's evaluation framework so results are comparable across prompt/model changes over time, not just eyeballed once.
scenarioA stakeholder asks "why not just write a Python script that calls the API in a loop instead of using these frameworks?" How do you answer?
You can, and for a genuinely simple, linear use case that might be the right call — part of why LangChain de-emphasised its own chain abstractions for non-trivial flows. The frameworks earn their keep once you need durable state that survives a crash, pausing for human approval mid-flow, streaming partial results, swapping model providers without rewriting logic, and structured observability.
Agentic & multi-agent
agenticWhat's the difference between a "supervisor" and a "swarm" multi-agent pattern?
Supervisor is hierarchical: one central agent owns all routing decisions and delegates via tool-based handoffs, and workers report back to it. Swarm is peer-to-peer: agents hand off directly to each other based on context, with no single controller. Supervisor is easier to reason about and debug; swarm can be more natural when the "next expert" genuinely depends on what the current agent just discovered.
agenticWhat is Deep Agents, and how is it different from just calling create_agent?
Deep Agents is an opinionated harness built on top of create_agent and LangGraph for long-running, complex tasks — it bundles a planning/todo tool, a virtual filesystem with permission rules, sub-agent spawning, and context-management features that a plain agent loop doesn't include by default. Think of create_agent as the primitive and Deep Agents as a batteries-included application built from it.
agenticWhat are subgraphs, and why use one instead of one big graph?
A subgraph is a compiled graph used as a node inside a larger parent graph — useful for encapsulating a self-contained agent, or reusing the same sub-workflow in multiple places. It also enables a multi-agent handoff pattern: a node inside a subgraph can return Command(goto=..., graph=Command.PARENT) to route control back up to the parent graph.
agenticHow does LangGraph's approach to multi-agent systems compare to CrewAI's?
CrewAI gives you role-based agents as a first-class, high-level primitive — you get a working multi-agent crew fastest, but with less visibility into exactly what's happening between hand-offs and no built-in cost ceiling. LangGraph makes you construct the routing explicitly as a graph, which is more setup, but gives precise control over state, context passed at each hand-off, and checkpointed, resumable execution.
Glossary
Every term used in this guide, in one place.
- Agent
- A model calling tools in a loop until a task is complete; in LangChain 1.0, built via create_agent on top of the LangGraph runtime.
- AgentState
- The typed state object every create_agent instance carries — holds the messages list plus any custom fields added via state_schema.
- Checkpointer
- Persists graph state at every super-step, keyed by thread_id — enables crash recovery, pausing/resuming, and time travel.
- Command
- A node return value combining a state update, routing (goto), and/or resuming after an interrupt().
- Content Blocks
- The standardised .content_blocks message property (1.0+) that normalises text, reasoning, tool-call and citation content across providers.
- create_agent
- LangChain 1.0's standard factory function for building an agent from a model, tools, prompt and middleware.
- Deep Agents
- An open-source, opinionated agent harness (planning tool, virtual filesystem, sub-agents) built on create_agent and LangGraph, for long-running complex tasks.
- Edge
- A transition between nodes — normal (fixed) or conditional (chosen at runtime by a routing function).
- Handoff
- A multi-agent pattern where one agent transfers control (and relevant context) to another, typically via a tool call interpreted as a routing instruction.
- interrupt()
- Pauses a running graph mid-node to request human input; resumes via Command(resume=...).
- LangChain
- The higher-level, opinionated framework layer: standardised messages/models/tools and the create_agent API.
- LangGraph
- The lower-level, Pregel-derived graph orchestration runtime that LangChain's agents run on.
- LangGraph Platform
- LangChain, Inc.'s commercial deployment infrastructure for LangGraph agents.
- LangSmith
- LangChain, Inc.'s commercial observability and evaluation platform.
- LCEL
- LangChain Expression Language — the prompt | model | parser pipe syntax. Still supported but de-emphasised beyond simple linear use cases as of 1.0.
- Message
- The unit of conversation — HumanMessage, AIMessage, SystemMessage, or ToolMessage.
- Middleware
- Composable hooks that intercept and modify the agent loop — the primary extensibility mechanism in 1.0.
- Node
- A function (state) -> update representing one unit of work in a graph.
- Pregel / super-step
- The message-passing execution model LangGraph is built on — the graph advances in discrete super-steps.
- RAG
- Retrieval-Augmented Generation — answering a query by first retrieving relevant documents and passing them to the model as context.
- Reducer
- Governs how a node's state update merges with existing state for a given field.
- Send
- Dynamically fans a node out over a list of items — the map half of a map-reduce pattern in LangGraph.
- State
- The typed schema describing every field a graph run carries and updates.
- StateGraph
- LangGraph's main graph-builder class, parameterised by a State schema.
- Store
- A long-term key-value store for memory that persists across threads/sessions, distinct from the checkpointer's thread-scoped state.
- Subgraph
- A compiled graph used as a node inside a larger parent graph.
- Thread / thread_id
- The key a checkpointer uses to identify one persisted conversation/run.
- Tool
- A callable the model can choose to invoke, with a schema the model uses to decide when and how to call it.
- Trace
- A hierarchical record of everything that happened during one agent run, captured automatically by LangSmith.
Sources
- LangChain & LangGraph 1.0 alpha releases — LangChain blog
- Agents — LangChain docs
- Agent Middleware — LangChain blog
- Graph API — LangGraph docs
- langgraph-supervisor — LangChain reference
- Deep Agents — LangChain
- Deep Agents overview — LangChain docs
- LangGraph Platform is now Generally Available — LangChain blog
- LangChain Academy
- LangSmith Pricing 2026 — PE Collective
- Choosing an agent framework — Speakeasy
- How AutoGen and Semantic Kernel became the Microsoft Agent Framework
- awesome-LangGraph — community index
- LangChain Python documentation
- LangGraph documentation