
ecosystem-primer
β 851by langchain-ai Β· part of langchain-ai/langchain-skills
INVOKE FIRST for any LangChain / LangGraph / Deep Agents agent building project before consulting other skills or writing any agent code. Required starting point for up to date info on framework selection (LangChain vs LangGraph vs Deep Agents vs hybrid composition), agent patterns, install, environment setup, and which skill to load next.
This is the playbook your agent receives when the skill activates β you don't need to read it to use the skill, but it's here to audit before installing.
- Deep Agents (top layer, harness) β batteries-included toolkit built on LangChain + LangGraph. Ships with planning, file management, subagent spawning, and memory out of the box.
- LangGraph (middle layer, runtime) β low-level orchestration for durable execution, custom control flow, and stateful workflows. LangChain agents run on top of LangGraph.
- LangChain (bottom layer, framework) β abstractions for models, tools, and the agent loop. Provider-agnostic, easiest to start with.
- LangSmith (cross-cutting) β observability and evaluation platform. Framework-agnostic; always recommended alongside any of the above.
Higher layers depend on lower ones, but you don't need to use lower layers directly. Deep Agents gives you LangGraph's durable execution without writing graph code. LangChain gives you models and tools without managing graph edges.
Step 1 β Choose Your Tool
Evaluate these conditions in order and stop at the first match:
- If the task needs planning, file management across a long session, persistent memory, subagent delegation, or on-demand skills β Deep Agents
- Else, if the task needs custom control flow (deterministic loops, branching logic) β LangGraph
- Else, if it's a single-purpose agent with a fixed set of tools β LangChain (
create_agentfunction) - Else, if it's a pure model call, retrieval pipeline, or simple prompt chain with no agent loop β LangChain (direct model / chain)
This is your layer. BUT you are not done: later in Step 4, you MUST load the layer-specific skill before writing any agent code.
Tool Profiles
LangChain β agent framework
Best for:
- Single-purpose agents with a fixed tool set
- RAG pipelines and document Q&A
- Model calls, prompt templates, structured output
Not ideal when:
- The agent needs to plan across many steps or manage large context
- Control flow is conditional, iterative, or parallel
- State must persist across sessions
All LangChain agents use create_agent(model, tools=[...]).
LangGraph β agent runtime
Best for:
- Custom control flow β deterministic loops, reflection cycles, parallel fan-out
- Complex workflows combining deterministic and agentic steps
- Human-in-the-loop with precise interrupt and resume points
- State that must survive failures or span long sessions
Not ideal when:
- You want planning, file management, and subagent delegation out of the box (use Deep Agents instead)
- The workflow is simple enough for a straight tool loop
All LangGraph graphs use StateGraph(State) with explicit nodes, edges, and conditional edges.
Deep Agents β agent harness
Best for:
- Long-running tasks that require planning and decomposition
- Agents that read, write, and manage files across a session
- Delegating subtasks to specialized subagents
- Persistent memory across sessions
- Loading domain-specific skills on demand
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)
All Deep Agents use create_deep_agent(model, tools=[...]).
Mixing Layers
The tools are layered, so they can be combined in the same project. Common patterns:
- Deep Agents orchestrator β LangGraph subagent β when the main agent needs planning and memory but one subtask requires a deterministic graph.
- LangGraph graph wrapped as a tool or subagent β when a specialized pipeline (e.g. RAG, reflection loop) is called by a broader agent.
A compiled LangGraph graph can be registered as a named subagent inside Deep Agents β the orchestrator delegates to it via the task tool without knowing its internal structure. LangChain tools and retrievers work freely inside both LangGraph nodes and Deep Agents tools.
Step 2 β Set Environment Variables
Always set these for observability. These are the current LangSmith env var names. Copy them as-is. OLDER NAMES NO LONGER WORK.
LANGSMITH_API_KEY= LANGSMITH_TRACING=true LANGSMITH_PROJECT=Model-provider and tool-specific keys (ANTHROPIC_API_KEY, OPENAI_API_KEY, TAVILY_API_KEY, etc.) depend on your stack β set them as needed.
Step 3 β How the Docs Work
All documentation lives at docs.langchain.com, organized into two top-level sections:
- OSS β LangChain, LangGraph, Deep Agents. Python (
/oss/python/) and TypeScript (/oss/javascript/) trees in parallel. - LangSmith β observability, evaluation, deployment, prompt engineering.
Each product has its own page tree: overview β quickstart β how-to guides β reference.
Canonical landing pages
Start here rather than tree-searching from root (swap python β javascript for TypeScript):
- LangChain β
/oss/python/langchain/overview - LangGraph β
/oss/python/langgraph/overview - Deep Agents β
/oss/python/deepagents/overview - LangSmith β
/langsmith/home(no language split)
Accessing docs in an agent context
If the LangChain Docs MCP server is connected (mcp__docs-langchain__* tools are available), query it directly:
tree /oss/python -L 2 # explore Python structure
tree /oss/javascript -L 2 # parallel TypeScript structure
cat /oss/python/langchain/quickstart.mdx # read a specific page
rg -il "checkpointer" /oss/python/langgraph/ # search by keywordIf the MCP server is not available, use the llms.txt index:
- Fetch
https://docs.langchain.com/llms.txtβ structured list of all pages with descriptions - Identify the 2β4 most relevant pages for the question
- Fetch those pages directly for accurate, up-to-date content
Always prefer fetching live docs over relying on training-data knowledge β these libraries evolve fast and APIs change often.
Step 4 β Load the Right Skill Next
Now load the skill below that matches your layer from Step 1. This is required β the layer-specific skill carries the current API; the primer alone does not.
LangChain
langchain-fundamentalsβ building any LangChain agentlangchain-ragβ adding RAG / vector store retrievallangchain-middlewareβ structured output with Pydanticlangchain-dependenciesβ package versions, installs, or dependency management questions
LangGraph
langgraph-fundamentalsβ any LangGraph graphlanggraph-human-in-the-loopβ human-in-the-loop or approval workflowslanggraph-persistenceβ state that must survive restarts, or cross-thread memory
Deep Agents
Always load deep-agents-core first. Then, as needed:
deep-agents-orchestrationβ subagent delegation or orchestrationdeep-agents-memoryβ cross-session persistent memory
npx skills add https://github.com/langchain-ai/langchain-skills --skill ecosystem-primerRun this in your project β your agent picks the skill up automatically.
No common issues documented yet. If you hit a problem, the repository's GitHub Issues page is the best place to look.