langchain-oss-primer

Commencez TOUJOURS ICI pour tout projet de construction d’agent LangChain, Deep Agents ou LangGraph. Point de départ obligatoire avant de choisir d’autres compétences ou d’écrire quoi que ce soit…

npx skills add https://github.com/langchain-ai/skills-benchmarks --skill langchain-oss-primer
**Always load this skill first.** This is the required starting point for any LangChain open source agent project — before choosing other skills, before writing code, before installing packages.

It answers three questions every project must resolve upfront:

  1. Which framework? — LangChain, LangGraph, or Deep Agents
  2. Which agent archetype? — maps your use case to the right API and patterns
  3. What to install and which skills to load next

Load this skill first. Once you've decided on a framework and agent type, follow the "Next Skills" section at the bottom — it tells you exactly which skills to invoke next based on your choices.


Step 1 — Pick Your Framework

The three frameworks are layered, not competing. Each builds on the one below:

┌─────────────────────────────────────────┐
│              Deep Agents                │  ← batteries included
│   (planning, memory, skills, files)     │
├─────────────────────────────────────────┤
│               LangGraph                 │  ← custom orchestration
│    (nodes, edges, state, persistence)   │
├─────────────────────────────────────────┤
│               LangChain                 │  ← foundation
│      (models, tools, prompts, RAG)      │
└─────────────────────────────────────────┘

Answer these questions in order:

QuestionYes →No →
User needs or wants planning, persistent memory, complex task management, long-running tasks, out-of-the-box file management, on-demand skills, or built-in middleware, subagents, easy expansion capabilities?Deep Agents
Needs custom control flow — specified loops, branching, deterministic parallel workers, or manually instrumented human-in-the-loop?LangGraph
Single-purpose agent with a fixed set of tools?LangChain (create_agent)
Simple prompt pipeline or retrieval chain with no agent loop?LangChain (direct model / chain)

Higher layers depend on lower ones only when necessary — you can mix them. A LangGraph graph can be a subagent inside Deep Agents; LangChain tools work inside both.

LangChainLangGraphDeep Agents
Control flowFixed (tool loop)Custom (graph)Managed (middleware)
MiddlewareCallbacks only✗ None✓ Explicit, configurable
PlanningManual✓ TodoListMiddleware
File managementManual✓ FilesystemMiddleware
Persistent memoryWith checkpointer✓ MemoryMiddleware
Subagent delegationManual✓ SubAgentMiddleware
On-demand skills✓ SkillsMiddleware
Human-in-the-loopManual interrupt✓ HumanInTheLoopMiddleware
Custom graph edges✓ Full controlLimited
Setup complexityLowMediumLow

Middleware is a concept specific to Deep Agents (explicit middleware layer). LangGraph has no middleware — behavior is wired directly into nodes and edges. If a user asks for built-in hooks or automatic middleware, route to Deep Agents.


Step 2 — Pick Your Agent Archetype

Once you've chosen a framework, match your use case to the right API and pattern.

LangChain — use create_agent()

Best for single-purpose agents in a ReACT style with a fixed tool set. No built-in planning, memory management, or delegation.

ArchetypeDescriptionKey tools
QA / ChatbotAnswer questions, summarise, classify. One job, done well.LLM + optional retrieval
SQL AgentQuery a database, return structured resultsSQLDatabase, create_agent
Search AgentLook up information, return findingsTavilySearchResults, DuckDuckGoSearch
RAG AgentRetrieve from a vector store, ground answers in documentsretriever tool + create_agent
Data Analysis AgentLoad, transform, and summarise structured dataPythonREPL, pandas tools
Tool-calling AgentCall APIs, run code, or chain arbitrary toolscustom @tool functions

All LangChain agents use create_agent(model, tools=[...]). Next skill: langchain-fundamentals.

LangGraph — use StateGraph

Best when you need explicit, deterministic control flow.

ArchetypeDescriptionKey pattern
Deterministic Parallel WorkflowsFan out to multiple nodes, collect results, mergeparallel edges → aggregation node
Multi-stage PipelineExtract → Transform → Load with typed stateTypedDict state + sequential nodes
Branching ClassifierRoute inputs to different handlers based on contentconditional edges + classifer node
Reflection LoopGenerate → Critique → Revise cycle with explicit exitcycle edges + iteration counter
Custom HITLComplex human-in-the-loop with structured review and conditional edgesinterrupt_before/interrupt_after + Command resume

LangGraph agents use StateGraph(State) with explicit add_node, add_edge, add_conditional_edges. Next skill: langgraph-fundamentals.

Deep Agents — use create_deep_agent()

Best when the agent needs to manage its own work: planning tasks, remembering users across sessions, delegating to specialists, or managing files autonomously.

ArchetypeDescriptionWhy Deep Agents
Research AssistantReceives an open-ended research brief, breaks it into subtasks, delegates to specialist subagents, writes up findingsNeeds SubAgentMiddleware for delegation + TodoListMiddleware for planning
Personal AssistantRemembers user preferences, ongoing projects, and context across multiple sessionsNeeds MemoryMiddleware (Store) for cross-session persistence
Coding AssistantReads codebases, writes files, plans refactors across many steps, optionally asks for approval before writesNeeds FilesystemMiddleware + TodoListMiddleware + optional HITL
OrchestratorTop-level agent that routes work to 2+ specialized subagents (researcher, coder, writer…)Needs SubAgentMiddleware with custom subagent configs
Long-running Task AgentMulti-hour or multi-day workflows where state must survive restartsNeeds checkpointer + MemoryMiddleware
On-demand Skills AgentAgent that loads different skill sets depending on what the user asksNeeds SkillsMiddleware + FilesystemBackend
Multi Agent ArchitectureAgent that spawns or has access to subagents for isolated tasks

All Deep Agents use create_deep_agent(model, tools=[...], ...). Next skill: deep-agents-core — load it immediately after deciding on Deep Agents.

Deep Agents built-in middleware

Six components pre-wired out of the box. First three are always active; the rest are opt-in:

MiddlewareAlways on?What it gives the agent
TodoListMiddlewarewrite_todos tool — tracks multi-step task plans
FilesystemMiddlewarels, read_file, write_file, edit_file, glob, grep
SubAgentMiddlewaretask tool — delegates subtasks to named subagents
SkillsMiddlewareOpt-inLoads SKILL.md files on demand from a skills directory
MemoryMiddlewareOpt-inLong-term memory across sessions via a Store instance
HumanInTheLoopMiddlewareOpt-inPauses execution and requests human approval before specified tool calls

You configure middleware — you don't implement it.

You can combine layers in the same project. The most common pattern: Deep Agents as the top-level orchestrator, with a compiled LangGraph graph registered as a specialized subagent. LangChain tools and chains are usable at every level.

Step 3 — Set Up Your Dependencies

Environment requirements

PythonTypeScript / Node
RuntimePython 3.10+Node.js 20+
LangChain1.0+ (LTS)1.0+ (LTS)
LangSmith SDK>= 0.3.0>= 0.3.0

Always use LangChain 1.0+. LangChain 0.3 is maintenance-only until December 2026 — do not start new projects on it.


Core packages — always required

**Python**
PackageRoleVersion
langchainAgents, chains, retrieval>=1.0,<2.0
langchain-coreBase types & interfaces>=1.0,<2.0
langsmithTracing, evaluation, datasets>=0.3.0
**TypeScript**
PackageRoleVersion
@langchain/coreBase types & interfaces (peer dep — install explicitly)^1.0.0
langchainAgents, chains, retrieval^1.0.0
langsmithTracing, evaluation, datasets^0.3.0

Orchestration — add based on your framework choice

FrameworkPythonTypeScript
LangGraphlanggraph>=1.0,<2.0@langchain/langgraph ^1.0.0
Deep Agentsdeepagents (depends on LangGraph; installs it as a transitive dep)deepagents

Model providers — pick the one(s) you use

ProviderPythonTypeScript
OpenAIlangchain-openai@langchain/openai
Anthropiclangchain-anthropic@langchain/anthropic
Google Geminilangchain-google-genai@langchain/google-genai
Mistrallangchain-mistralai@langchain/mistralai
Groqlangchain-groq@langchain/groq
Coherelangchain-cohere@langchain/cohere
AWS Bedrocklangchain-aws@langchain/aws
Azure AIlangchain-azure-ai@langchain/azure-openai
Ollama (local)langchain-ollama@langchain/ollama
Hugging Facelangchain-huggingface
Fireworks AIlangchain-fireworks
Together AIlangchain-together

Common tools & retrieval — add as needed

PackageAddsNotes
langchain-tavily / @langchain/tavilyTavily web searchKeep at latest; frequently updated for compatibility
langchain-text-splittersText chunkingSemver; keep current
langchain-chroma / @langchain/communityChroma vector storeDedicated integration package; keep at latest
langchain-pinecone / @langchain/pineconePinecone vector storeDedicated integration package; keep at latest
langchain-qdrant / @langchain/qdrantQdrant vector storeDedicated integration package; keep at latest
faiss-cpuFAISS vector store (Python only, local)Via langchain-community
langchain-community / @langchain/community1000+ integrations fallbackPython: NOT semver — pin to minor series
langsmith[pytest]pytest pluginRequires langsmith>=0.3.4

Prefer dedicated integration packages over langchain-community when one exists — they are independently versioned and more stable.


Dependency templates

LangChain agent — provider-agnostic starting point. ``` # requirements.txt langchain>=1.0,<2.0 langchain-core>=1.0,<2.0 langsmith>=0.3.0

Add your model provider:

langchain-openai | langchain-anthropic | langchain-google-genai | ...

Add tools/retrieval as needed:

langchain-tavily | langchain-chroma | langchain-text-splitters | ...

</python>
</ex-langchain-python>

<ex-langgraph-python>
<python>
LangGraph project — provider-agnostic starting point.

requirements.txt

langchain>=1.0,<2.0 langchain-core>=1.0,<2.0 langgraph>=1.0,<2.0 langsmith>=0.3.0

Add your model provider:

langchain-openai | langchain-anthropic | langchain-google-genai | ...

</python>
</ex-langgraph-python>

<ex-langgraph-typescript>
<typescript>
LangGraph project — provider-agnostic starting point.
```json
{
  "dependencies": {
    "@langchain/core": "^1.0.0",
    "langchain": "^1.0.0",
    "@langchain/langgraph": "^1.0.0",
    "langsmith": "^0.3.0"
  }
}
Deep Agents project — provider-agnostic starting point. ``` # requirements.txt deepagents langchain>=1.0,<2.0 langchain-core>=1.0,<2.0 langsmith>=0.3.0

Add your model provider:

langchain-openai | langchain-anthropic | langchain-google-genai | ...

</python>
</ex-deepagents-python>

<ex-deepagents-typescript>
<typescript>
Deep Agents project — provider-agnostic starting point.
```json
{
  "dependencies": {
    "deepagents": "latest",
    "@langchain/core": "^1.0.0",
    "langchain": "^1.0.0",
    "langsmith": "^0.3.0"
  }
}

Step 4 — Set Your Environment Variables

```bash # LangSmith — always recommended for observability LANGSMITH_API_KEY= LANGSMITH_PROJECT= # optional, defaults to "default"

Model provider — set the one(s) you use

OPENAI_API_KEY= ANTHROPIC_API_KEY= GOOGLE_API_KEY= MISTRAL_API_KEY= GROQ_API_KEY= COHERE_API_KEY= FIREWORKS_API_KEY= TOGETHER_API_KEY= HUGGINGFACEHUB_API_TOKEN=

Common tool/retrieval services

TAVILY_API_KEY= PINECONE_API_KEY=

</environment-variables>

---

## Step 5 — Load the Right Skill Next

Based on the framework and archetype you chose above, invoke these skills **now** before writing any code:

<next-skills>

### If you chose LangChain

| Your archetype | Load next |
|----------------|-----------|
| Any LangChain agent (QA bot, SQL, search, RAG, tool-calling) | **`langchain-fundamentals`** — always |
| Adding external tools/packages (Tavily, Pinecone, etc.) | **`langchain-dependencies`** — package patterns and version guidance |
| Need streaming or async responses | **`langchain-fundamentals`** then `langgraph-fundamentals` |

### If you chose LangGraph

| Your archetype | Load next |
|----------------|-----------|
| Any LangGraph graph | **`langgraph-fundamentals`** — always |
| Approval pipeline, HITL, or pause/resume | **`langgraph-fundamentals`** + `langgraph-human-in-the-loop` |
| State that must survive restarts or cross-thread memory | **`langgraph-persistence`** |
| Streaming output token by token | **`langgraph-fundamentals`** |

### If you chose Deep Agents

**Always load `deep-agents-core` first — it is the mandatory starting point for any Deep Agents project.**

| Your archetype | Load next (after `deep-agents-core`) |
|----------------|--------------------------------------|
| Research Assistant — delegates to specialist subagents | **`deep-agents-orchestration`** — subagent config, TodoList, HITL |
| Personal Assistant — remembers users across sessions | **`deep-agents-memory`** — MemoryMiddleware, Store backends |
| Coding Assistant — reads/writes files, plans refactors | `deep-agents-core` is sufficient; add `deep-agents-orchestration` if using HITL |
| Orchestrator — routes work across multiple named subagents | **`deep-agents-orchestration`** — SubAgentMiddleware patterns |
| Long-running task agent — survives restarts | **`deep-agents-memory`** + `deep-agents-orchestration` |
| On-demand skills agent | `deep-agents-core` covers SkillsMiddleware setup |
</next-skills>

Plus de skills de langchain-ai

langgraph-docs
langchain-ai
We need to translate the given text from English to French. The text describes an agent skill for accessing LangGraph documentation. We must preserve the name "langgraph-docs" but it's not in the text, so we don't include it. We translate the text inside <text>. No extra labels, no markdown, just the translation. The text: "Access LangGraph documentation to build stateful agents and multi-agent workflows. Fetches official LangGraph Python docs covering state machines, graph-based agent design, and human-in-the-loop patterns Prioritizes relevant documentation by query type: implementation guides for how-to questions, concept pages for theory, tutorials for end-to-end examples, and API references for technical details Automatically selects 2–4 most relevant documentation URLs and retrieves their content to answer..." We need to translate accurately, preserving technical terms like "LangGraph", "state machines", "graph-based agent design", "human-in-the-loop", "API references", etc. Also preserve numbers like "2–4". The ellipsis at the end should be kept. Let
official
langgraph-human-in-the-loop
langchain-ai
Mettre en pause l'exécution du graphe pour un examen, une approbation ou une validation humaine, puis reprendre avec leur saisie. Nécessite trois composants : un checkpoint (InMemorySaver ou PostgresSaver), un ID de thread dans la configuration, et des charges utiles d'interruption sérialisables en JSON. interrupt(value) met en pause et affiche les données ; Command(resume=value) reprend et renvoie cette valeur au nœud mis en pause. Tout le code avant interrupt() se réexécute lors de la reprise, donc les effets secondaires doivent être idempotents (utiliser upsert, pas insert). Prend en charge les workflows d'approbation,...
official
web-research
langchain-ai
Utilisez cette compétence pour les demandes liées à la recherche web ; elle fournit une approche structurée pour mener une recherche web
official
skill-creator
langchain-ai
Guide pour créer des compétences efficaces qui étendent les capacités de l'agent avec des connaissances spécialisées, des flux de travail ou des intégrations d'outils. Utilisez cette compétence lorsque l'utilisateur…
official
social-media
langchain-ai
Rédige des publications pour les réseaux sociaux adaptées à chaque plateforme, avec un contenu basé sur des recherches et des images d’accompagnement générées. Prend en charge les posts LinkedIn (1 300 caractères, ton professionnel) et les fils Twitter/X (280 caractères par tweet, format 1/🧵). Nécessite de déléguer la recherche à un sous-agent avant la rédaction, puis de lire les résultats pour garantir l’exactitude et la pertinence. Génère automatiquement des images sociales accrocheuses via l’outil generate_social_image, avec des compositions audacieuses et à fort contraste optimisées pour les petits...
official
deep-agents-memory
langchain-ai
Backends mémoire et fichiers enfichables pour Deep Agents avec options de routage éphémère, persistante et hybride. Quatre types de backends : StateBackend (éphémère, limité à un thread), StoreBackend (persistant entre sessions), FilesystemBackend (accès disque réel pour développement local) et CompositeBackend (routage de différents chemins vers différents backends). FilesystemMiddleware fournit six outils d'opérations sur fichiers : ls, read_file, write_file, edit_file, glob, grep. CompositeBackend utilise la correspondance par préfixe le plus long pour router...
official
deep-agents-orchestration
langchain-ai
Orchestrer des sous-agents, planifier des tâches en plusieurs étapes et exiger l'approbation humaine pour les opérations sensibles. Déléguer le travail à des sous-agents spécialisés via l'outil de tâche ; les sous-agents personnalisés prennent en charge des ensembles d'outils et des invites système isolés, tandis que le sous-agent "généraliste" par défaut hérite de la configuration de l'agent principal. Planifier et suivre des workflows complexes avec write_todos, en organisant les tâches dans les états en attente, en cours et terminés ; nécessite un thread_id pour la persistance entre les invocations. Mettre en œuvre...
official
deep-agents-orchestration
langchain-ai
INVOQUEZ CETTE COMPÉTENCE lors de l'utilisation de sous-agents, de planification de tâches ou d'approbation humaine dans Deep Agents. Couvre SubAgentMiddleware, TodoList pour la planification et les interruptions HITL.
official