LangChain Ecosystem Router
Framework Selection
Frameworks are layered, not competing:
┌─────────────────────────────────────┐
│ Deep Agents │ ← planning, memory, skills, files
├─────────────────────────────────────┤
│ LangGraph │ ← graphs, loops, state, control flow
├─────────────────────────────────────┤
│ LangChain │ ← models, tools, prompts, RAG
└─────────────────────────────────────┘
Decision tree (answer in order):
- Needs sub-tasks, file management, persistent memory, or on-demand skills? → Deep Agents
- Needs complex control flow (loops, branching, parallel, human-in-the-loop)? → LangGraph
- Single-purpose agent with fixed tools? → LangChain (
create_agent)
- Pure model call, chain, or retrieval pipeline? → LangChain (LCEL)
| Capability |
LangChain |
LangGraph |
Deep Agents |
| Control flow |
Fixed tool loop |
Custom graph |
Middleware-managed |
| Planning |
✗ |
Manual |
✓ TodoListMiddleware |
| File management |
✗ |
Manual |
✓ FilesystemMiddleware |
| Persistent memory |
✗ |
With checkpointer |
✓ MemoryMiddleware |
| Subagent delegation |
✗ |
Manual |
✓ SubAgentMiddleware |
| Human-in-the-loop |
✗ |
Manual interrupt |
✓ HumanInTheLoopMiddleware |
LangChain tools/chains/retrievers work inside LangGraph nodes and Deep Agents tools.
LangGraph compiled graphs can be registered as Deep Agents subagents.
Quick Start (Most Common Patterns)
Simple agent:
from langchain.agents import create_agent
agent = create_agent(model="anthropic:claude-sonnet-4-5", tools=[my_tool])
result = agent.invoke({"messages": [{"role": "user", "content": "Hello"}]})
print(result["messages"][-1].content)
Stateful graph:
from langgraph.graph import StateGraph, START, END
graph = StateGraph(State).add_node("process", fn).add_edge(START, "process").add_edge("process", END).compile()
Deep Agent:
from deepagents import create_deep_agent
agent = create_deep_agent(model="claude-sonnet-4-5-20250929", tools=[my_tool], system_prompt="...")
Critical Rules (All Frameworks)
- Persistence always needs
thread_id: config = {"configurable": {"thread_id": "..."}}
- HITL always needs checkpointer:
MemorySaver() at minimum
- Resume after interrupt:
Command(resume={"decisions": [{"type": "approve"}]}) — never plain dict
- LangChain 1.0 is LTS — never start new projects on 0.3
- Always install
langchain-core explicitly — not auto-hoisted in monorepos
- Use dedicated packages (e.g.,
langchain-chroma) not langchain_community
Deep-Dive References
LangChain
| Reference |
When to Read |
| references/langchain-fundamentals.md |
create_agent, tool definitions, persistence, TypeScript |
| references/langchain-dependencies.md |
Package versions, install commands, import paths, environment setup |
| references/langchain-middleware.md |
HumanInTheLoopMiddleware, approval/edit/reject, per-tool policies |
| references/langchain-rag.md |
Document loaders, splitters, embeddings, vector stores, MMR search |
LangGraph
| Reference |
When to Read |
| references/langgraph-fundamentals.md |
StateGraph, reducers, nodes, edges, Command, Send, streaming |
| references/langgraph-human-in-the-loop.md |
interrupt(), idempotency, approval workflows, parallel interrupts |
| references/langgraph-persistence.md |
Checkpointers, Store, time travel, subgraph scoping |
Deep Agents
| Reference |
When to Read |
| references/deep-agents-core.md |
create_deep_agent, built-in tools, SKILL.md format, configuration |
| references/deep-agents-memory.md |
StateBackend, StoreBackend, FilesystemBackend, CompositeBackend |
| references/deep-agents-orchestration.md |
Subagents, task delegation, TodoList, HITL approval flow |
Meta
| Reference |
When to Read |
| references/framework-selection.md |
Full decision tree, capability matrix, interoperability details |
1---2name: langchain-ecosystem3description: Complete guide for LangChain, LangGraph, and Deep Agents development. Covers framework selection, agents, tools, RAG, middleware, graphs, persistence, HITL, subagents, and memory. Triggers when code imports langchain/langgraph/deepagents, or user asks about building AI agents, RAG pipelines, stateful graphs, human-in-the-loop workflows, or agent orchestration.4---5
6# LangChain Ecosystem Router
7
8## Framework Selection
9
10Frameworks are **layered**, not competing:
11
12```
13┌─────────────────────────────────────┐
14│ Deep Agents │ ← planning, memory, skills, files
15├─────────────────────────────────────┤
16│ LangGraph │ ← graphs, loops, state, control flow
17├─────────────────────────────────────┤
18│ LangChain │ ← models, tools, prompts, RAG
19└─────────────────────────────────────┘
20```
21
22**Decision tree (answer in order):**
231. Needs sub-tasks, file management, persistent memory, or on-demand skills? → **Deep Agents**
242. Needs complex control flow (loops, branching, parallel, human-in-the-loop)? → **LangGraph**
253. Single-purpose agent with fixed tools? → **LangChain** (`create_agent`)
264. Pure model call, chain, or retrieval pipeline? → **LangChain** (LCEL)
27
28| Capability | LangChain | LangGraph | Deep Agents |
29|---|-----------|-----------|-------------|
30| Control flow | Fixed tool loop | Custom graph | Middleware-managed |
31| Planning | ✗ | Manual | ✓ TodoListMiddleware |
32| File management | ✗ | Manual | ✓ FilesystemMiddleware |
33| Persistent memory | ✗ | With checkpointer | ✓ MemoryMiddleware |
34| Subagent delegation | ✗ | Manual | ✓ SubAgentMiddleware |
35| Human-in-the-loop | ✗ | Manual interrupt | ✓ HumanInTheLoopMiddleware |
36
37LangChain tools/chains/retrievers work inside LangGraph nodes and Deep Agents tools.
38LangGraph compiled graphs can be registered as Deep Agents subagents.
39
40## Quick Start (Most Common Patterns)
41
42**Simple agent:**
43```python
44from langchain.agents import create_agent
45agent = create_agent(model="anthropic:claude-sonnet-4-5", tools=[my_tool])
46result = agent.invoke({"messages": [{"role": "user", "content": "Hello"}]})
47print(result["messages"][-1].content)
48```
49
50**Stateful graph:**
51```python
52from langgraph.graph import StateGraph, START, END
53graph = StateGraph(State).add_node("process", fn).add_edge(START, "process").add_edge("process", END).compile()
54```
55
56**Deep Agent:**
57```python
58from deepagents import create_deep_agent
59agent = create_deep_agent(model="claude-sonnet-4-5-20250929", tools=[my_tool], system_prompt="...")
60```
61
62## Critical Rules (All Frameworks)
63
64- **Persistence always needs `thread_id`**: `config = {"configurable": {"thread_id": "..."}}`
65- **HITL always needs checkpointer**: `MemorySaver()` at minimum
66- **Resume after interrupt**: `Command(resume={"decisions": [{"type": "approve"}]})` — never plain dict
67- **LangChain 1.0 is LTS** — never start new projects on 0.3
68- **Always install `langchain-core` explicitly** — not auto-hoisted in monorepos
69- **Use dedicated packages** (e.g., `langchain-chroma`) not `langchain_community`
70
71## Deep-Dive References
72
73### LangChain
74| Reference | When to Read |
75|-----------|-------------|
76| [references/langchain-fundamentals.md](references/langchain-fundamentals.md) | `create_agent`, tool definitions, persistence, TypeScript |
77| [references/langchain-dependencies.md](references/langchain-dependencies.md) | Package versions, install commands, import paths, environment setup |
78| [references/langchain-middleware.md](references/langchain-middleware.md) | HumanInTheLoopMiddleware, approval/edit/reject, per-tool policies |
79| [references/langchain-rag.md](references/langchain-rag.md) | Document loaders, splitters, embeddings, vector stores, MMR search |
80
81### LangGraph
82| Reference | When to Read |
83|-----------|-------------|
84| [references/langgraph-fundamentals.md](references/langgraph-fundamentals.md) | StateGraph, reducers, nodes, edges, Command, Send, streaming |
85| [references/langgraph-human-in-the-loop.md](references/langgraph-human-in-the-loop.md) | interrupt(), idempotency, approval workflows, parallel interrupts |
86| [references/langgraph-persistence.md](references/langgraph-persistence.md) | Checkpointers, Store, time travel, subgraph scoping |
87
88### Deep Agents
89| Reference | When to Read |
90|-----------|-------------|
91| [references/deep-agents-core.md](references/deep-agents-core.md) | `create_deep_agent`, built-in tools, SKILL.md format, configuration |
92| [references/deep-agents-memory.md](references/deep-agents-memory.md) | StateBackend, StoreBackend, FilesystemBackend, CompositeBackend |
93| [references/deep-agents-orchestration.md](references/deep-agents-orchestration.md) | Subagents, task delegation, TodoList, HITL approval flow |
94
95### Meta
96| Reference | When to Read |
97|-----------|-------------|
98| [references/framework-selection.md](references/framework-selection.md) | Full decision tree, capability matrix, interoperability details |