
Framework Selection
Choose LangChain vs LangGraph vs Deep Agents (or a combo) before writing any agent code on a new LangChain-stack project.
Install
npx skills add https://github.com/langchain-ai/langchain-skills --skill framework-selectionWhat is this skill?
- Ordered decision table: planning needs, loops/state, memory/skills → layer mapping
- Explains layered stack—Deep Agents atop LangGraph atop LangChain, not mutually exclusive
- Must run before other LangChain agent skills in the same repo
- Higher layers still allow lower-layer primitives inside the same project
- Invoke at project start whenever LangChain, LangGraph, or Deep Agents is in play
Adoption & trust: 7.3k installs on skills.sh; 782 GitHub stars; 3/3 security scanners passed (skills.sh audits); trending (+100% hot-view momentum).
Recommended Skills
Journey fit
Framework layer choice is an architecture gate that should happen while scoping the agent—before implementation commitments. Scope is where you decide orchestration depth (chains vs graphs vs batteries-included agents) that drives the rest of the build plan.
Common Questions / FAQ
Is Framework Selection safe to install?
skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.
SKILL.md
READMESKILL.md - Framework Selection
<overview> LangChain, LangGraph, and Deep Agents are **layered**, not competing choices. Each builds on the one below it: ``` ┌─────────────────────────────────────────┐ │ Deep Agents │ ← highest level: batteries included │ (planning, memory, skills, files) │ ├─────────────────────────────────────────┤ │ LangGraph │ ← orchestration: graphs, loops, state │ (nodes, edges, state, persistence) │ ├─────────────────────────────────────────┤ │ LangChain │ ← foundation: models, tools, chains │ (models, tools, prompts, RAG) │ └─────────────────────────────────────────┘ ``` Picking a higher layer does not cut you off from lower layers — you can use LangGraph graphs inside Deep Agents, and LangChain primitives inside both. > **This skill should be loaded at the top of any project before selecting other skills or writing agent code.** The framework you choose dictates which other skills to invoke next. </overview> --- ## Decision Guide <decision-table> Answer these questions in order: | Question | Yes → | No → | |----------|-------|-------| | Does the task require breaking work into sub-tasks, managing files across a long session, persistent memory, or loading on-demand skills? | **Deep Agents** | ↓ | | Does the task require complex control flow — loops, dynamic branching, parallel workers, human-in-the-loop, or custom state? | **LangGraph** | ↓ | | Is this a single-purpose agent that takes input, runs tools, and returns a result? | **LangChain** (`create_agent`) | ↓ | | Is this a pure model call, chain, or retrieval pipeline with no agent loop? | **LangChain** (chain) | — | </decision-table> --- ## Framework Profiles <langchain-profile> ### LangChain — Use when the task is focused and self-contained **Best for:** - Single-purpose agents that use a fixed set of tools - RAG pipelines and document Q&A - Model calls, prompt templates, output parsing - Quick prototypes where agent logic is simple **Not ideal when:** - The agent needs to plan across many steps - State needs to persist across multiple sessions - Control flow is conditional or iterative **Skills to invoke next:** `langchain-models`, `langchain-rag`, `langchain-middleware` </langchain-profile> <langgraph-profile> ### LangGraph — Use when you need to own the control flow **Best for:** - Agents with branching logic or loops (e.g. retry-until-correct, reflection) - Multi-step workflows where different paths depend on intermediate results - Human-in-the-loop approval at specific steps - Parallel fan-out / fan-in (map-reduce patterns) - Persistent state across invocations within a session **Not ideal when:** - You want planning, file management, and subagent delegation handled for you (use Deep Agents instead) - The workflow is straightforward enough for a simple agent **Skills to invoke next:** `langgraph-fundamentals`, `langgraph-human-in-the-loop`, `langgraph-persistence` </langgraph-profile> <deep-agents-profile> ### Deep Agents — Use when the task is open-ended and multi-dimensional **Best for:** - Long-running tasks that require breaking work into a todo list - Agents that need to read, write, and manage files across a session - Delegating subtasks to specialized subagents - Loading domain-specific skills on demand - Persistent memory that survives across multiple sessions **Not ideal when:** - The task is simple enough for a single-purpose agent - You need precise, hand-crafted control over every graph edge (use LangGraph directly) **Middleware — built-in and extensible:** Deep Agents ships with a built-in middleware layer out of t