langchain-ai/swarm

Despacha muchos elementos independientes en paralelo: crea una tabla, distribuye a subagentes y agrega los resultados. Una fila = una unidad de trabajo.

¿Qué es swarm?

La skill langchain-ai/swarm permite a los agentes de IA procesar múltiples tareas independientes de forma concurrente, dividiendo el trabajo en filas de una tabla. Cada fila representa una unidad de trabajo que se asigna a un subagente, el cual la ejecuta en paralelo con otras. Esta skill es útil para tareas como scraping web, análisis de datos masivos o procesamiento por lotes, donde se requiere alta escalabilidad y eficiencia. Funciona con plataformas como Claude Code, Cursor y Codex, y se basa en una arquitectura de fan-out/in para distribuir y luego agregar los resultados de cada subagente.

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

Installed? Explore more Productividad y colaboración skills: steipete/gemini, steipete/gh-issues, steipete/skill-creator · View all 6 →

Preguntar en tu IA favorita

Abre un nuevo chat con esta habilidad de agente ya precargada.

Documentación

¿Qué hace swarm?

Despacha muchos elementos independientes en paralelo: crea una tabla, distribuye a subagentes y agrega los resultados. Una fila = una unidad de trabajo.

Descripción

La skill langchain-ai/swarm está diseñada para agentes de IA que necesitan procesar grandes volúmenes de trabajo independiente de manera eficiente. Al organizar los elementos de trabajo en una tabla, cada fila se convierte en una unidad de procesamiento que un subagente puede manejar de forma autónoma. Esto permite una ejecución paralela masiva, acelerando significativamente las tareas que de otro modo serían secuenciales.

Plataformas compatibles

  • Claude Code
  • Cursor
  • Codex
  • Otros agentes de IA con soporte para habilidades personalizadas

Funcionamiento

  1. Crear tabla: El agente principal organiza las unidades de trabajo en filas de una tabla (por ejemplo, URLs para scraping, datos para análisis, etc.).
  2. Fan-out: Cada fila se asigna a un subagente independiente que ejecuta la tarea correspondiente.
  3. Procesamiento paralelo: Los subagentes trabajan en paralelo, cada uno completando su fila asignada.
  4. Agregar resultados: Una vez que todos los subagentes terminan, el agente principal recoge y combina los resultados en una estructura coherente.

Ejemplo de uso

# Ejemplo conceptual (no código ejecutable)
swarm = Swarm(table=work_items)
swarm.fan_out()
results = swarm.aggregate()

Beneficios

  • Escalabilidad: Maneja desde decenas hasta miles de unidades de trabajo.
  • Eficiencia: Reduce el tiempo total de procesamiento al ejecutar en paralelo.
  • Simplicidad: La abstracción de tabla/fila facilita la organización de datos.

Notas

  • Asegúrese de que las unidades de trabajo sean independientes entre sí para evitar conflictos.
  • La skill no incluye manejo automático de fallos; es responsabilidad del agente principal gestionar subagentes fallidos.

Para más información, consulte la documentación oficial de langchain-ai/swarm.

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-fundamentals

Create LangChain agents with create_agent, define tools, and use middleware for human-in-the-loop and error handling.

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.

Skills relacionados