langchain-ai/langchain-fundamentals

Créez des agents LangChain avec create_agent, définissez des outils et utilisez un middleware pour l'intervention humaine et la gestion des erreurs.

Qu'est-ce que langchain-fundamentals ?

Cette compétence permet aux développeurs de créer des agents LangChain en utilisant la fonction `create_agent`, de définir des outils personnalisés et d'intégrer un middleware sophistiqué. Elle est particulièrement utile pour les applications nécessitant une intervention humaine (human-in-the-loop) et une gestion robuste des erreurs, garantissant ainsi des flux de travail interactifs et fiables. Compatible avec les plateformes d'agents AI comme Claude Code, Cursor et Codex, elle simplifie l'implémentation de fonctionnalités avancées sans avoir à écrire de code complexe. En s'appuyant sur la documentation SKILL.md, les agents peuvent être configurés facilement, avec des hooks de middleware pour intercepter et modifier les actions, ce qui améliore considérablement la flexibilité et la maintenabilité des systèmes d'agents.

Compatible avec~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/langchain-ai/langchain-skills/tree/main/skills/langchain-fundamentals

Installed? Explore more Productivité et collaboration skills: steipete/gemini, steipete/gh-issues, steipete/skill-creator · View all 6 →

Demander à votre IA préférée

Ouvre une nouvelle conversation avec cette compétence d'agent déjà préchargée.

Documentation

Que fait langchain-fundamentals ?

Créez des agents LangChain avec create_agent, définissez des outils et utilisez un middleware pour l'intervention humaine et la gestion des erreurs.

Objectif

Cette compétence vous permet de construire des agents LangChain en exploitant create_agent, en définissant des outils personnalisés et en mettant en place un middleware pour gérer l'intervention humaine et les erreurs. Idéale pour les développeurs qui souhaitent déployer des agents interactifs et robustes.

Fonctionnalités clés

  • create_agent : Fonction principale pour instancier un agent LangChain.
  • Définition d'outils : Créez facilement des outils personnalisés à intégrer dans votre agent.
  • Middleware : Utilisez des intercepteurs pour l'intervention humaine (human-in-the-loop) et la gestion des erreurs.

Utilisation de base

from langchain.agents import create_agent

agent = create_agent(
    tools=[my_tool],
    middleware=[error_handler_middleware, human_in_loop_middleware]
)
agent.run("Exécute une tâche")

Références

Individual skills in this repo

This repo contains 11 individual skills — each has its own dedicated page.

langchain-ai/deep-agents-core

INVOKE THIS SKILL when building ANY Deep Agents application. Covers create_deep_agent(), harness architecture, SKILL.md format, and configuration options.

langchain-ai/deep-agents-memory

INVOKE THIS SKILL when your Deep Agent needs memory, persistence, or filesystem access. Covers StateBackend (ephemeral), StoreBackend (persistent), FilesystemMiddleware, and CompositeBackend for routing.

langchain-ai/deep-agents-orchestration

INVOKE THIS SKILL when using subagents, task planning, or human approval in Deep Agents. Covers SubAgentMiddleware, TodoList for planning, and HITL interrupts.

langchain-ai/framework-selection

INVOKE THIS SKILL at the START of any LangChain/LangGraph/Deep Agents project, before writing any agent code. Determines which framework layer is right for the task: LangChain, LangGraph, Deep Agents, or a combination. Must be consulted before other agent skills.

langchain-ai/langchain-dependencies

INVOKE THIS SKILL when setting up a new project or when asked about package versions, installation, or dependency management for LangChain, LangGraph, LangSmith, or Deep Agents. Covers required packages, minimum versions, environment requirements, versioning best practices, and common community tool packages for both Python and TypeScript.

langchain-ai/langchain-middleware

INVOKE THIS SKILL when you need human-in-the-loop approval, custom middleware, or structured output. Covers HumanInTheLoopMiddleware for human approval of dangerous tool calls, creating custom middleware with hooks, Command resume patterns, and structured output with Pydantic/Zod.

langchain-ai/langchain-rag

INVOKE THIS SKILL when building ANY retrieval-augmented generation (RAG) system. Covers document loaders, RecursiveCharacterTextSplitter, embeddings (OpenAI), and vector stores (Chroma, FAISS, Pinecone).

langchain-ai/langgraph-fundamentals

INVOKE THIS SKILL when writing ANY LangGraph code. Covers StateGraph, state schemas, nodes, edges, Command, Send, invoke, streaming, and error handling.

langchain-ai/langgraph-human-in-the-loop

INVOKE THIS SKILL when implementing human-in-the-loop patterns, pausing for approval, or handling errors in LangGraph. Covers interrupt(), Command(resume=...), approval/validation workflows, and the 4-tier error handling strategy.

langchain-ai/langgraph-persistence

INVOKE THIS SKILL when your LangGraph needs to persist state, remember conversations, travel through history, or configure subgraph checkpointer scoping. Covers checkpointers, thread_id, time travel, Store, and subgraph persistence modes.

langchain-ai/swarm

Dispatches many independent items in parallel: create a table, fan out to subagents, aggregate results. One row = one unit of work.

Skills associés