Saltar al contenido
Skillpedia
Agentes7,8 mil · #12830

agent-squad-python

Qué hace

Esta skill es una guía para crear aplicaciones en Python con agent-squad, un marco para sistemas de varios agentes de IA. Explica qué tipo de agente conviene para cada necesidad. Está pensada para desarrolladores de Python que crean asistentes o equipos de agentes de IA.

Cuándo usarla

  • ✓Cuando estás creando una app en Python que reparte peticiones entre varios agentes de IA especialistas.
  • ✓Cuando necesitas un asistente único, una cadena fija de pasos, un equipo con supervisor o respuestas basadas en datos.
  • ✓Cuando quieres conectar servidores de herramientas externos a un agente mediante el protocolo MCP.

Link de la skill

https://github.com/2FastLabs/agent-squad/blob/main/python/SKILL.md

Cópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.

Cómo usar

La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.

Mensaje listo para pegar

Usa esta skill para ayudarme: https://github.com/2FastLabs/agent-squad/blob/main/python/SKILL.md Lee el archivo SKILL.md de ese link y sigue sus instrucciones en mi tarea.
¿Quieres que tu IA encuentre skills como esta por sí sola?Instala el MCP gratis de Skillpedia: una línea, y busca entre 15.000+ skills antes de cada tarea.Instalar en 1 minuto →

Ejemplo de qué pedirle a la IA

“Crea una app en Python con agent-squad que envíe las preguntas de los clientes a un agente de facturación y a un agente de soporte.”

5 skills nuevas por semana. 1 minuto de lectura.

Cómo funciona

Explica cuándo usar un asistente único, varios agentes con un orquestador, un agente con respuestas basadas en datos, una cadena para pasos fijos o un supervisor para equipos. Te indica el código fuente y la documentación para los detalles exactos.

Contenido técnico (SKILL.md original)

Texto original del autor, en inglés, directo de GitHub.

agent-squad Python — assistant guide

Async-first, dependency-optional multi-agent orchestration framework (Python 3.11+). This is a guide and a map — not an API reference. Read exact signatures from the source (python/src/agent_squad/) and the docs site (docs/src/content/docs/); this file tells you what to use, when, and what to watch out for.

When to use what

  • One assistant — a single Agent subclass; no orchestrator needed, call process_request directly.
  • Several specialists — multiple agents + an AgentSquad orchestrator; the classifier routes each turn to the right agent automatically.
  • Answers must not drift from data (prices, balances, live stock) — GroundedAgent: a gatherer LLM calls tools and sees raw results but never speaks to the user; an isolated presenter LLM writes the reply grounded only on curated facts.
  • Fixed pipeline — ChainAgent: routes the output of one agent as the input to the next, sequentially.
  • Team coordination — SupervisorAgent: a lead BedrockLLMAgent or AnthropicAgent delegates to a team of sub-agents via an internal tool loop, maintaining shared context. Can itself be registered in an AgentSquad.
  • External tool servers — MCPToolProvider (requires agent-squad[mcp]) connects any number of MCP servers (stdio or SSE) and makes their tools available to any agent.

How to install

All third-party integrations are optional extras — never forced on users who don't need them.

pip install agent-squad                  # core only (no LLM runtime)
pip install "agent-squad[aws]"           # + boto3 — BedrockLLMAgent, BedrockClassifier, DynamoDbChatStorage, etc.
pip install "agent-squad[anthropic]"     # + anthropic SDK — AnthropicAgent, AnthropicClassifier
pip install "agent-squad[openai]"        # + openai SDK — OpenAIAgent, OpenAIClassifier
pip install "agent-squad[sql]"           # + libsql-client — SqlChatStorage (Turso/libSQL)
pip install "agent-squad[strands-agents]"# + strands-agents — StrandsAgent
pip install "agent-squad[dakera]"        # + dakera — DakeraRetriever
pip install "agent-squad[mcp]"           # + mcp — MCPToolProvider
pip install "agent-squad[all]"           # everything except strands-agents

How a turn works

AgentSquad.route_request is the one entry point worth memorising. It is a coroutine — you must await it.

import asyncio
from agent_squad.orchestrator import AgentSquad
from agent_squad.agents import BedrockLLMAgent, BedrockLLMAgentOptions
from agent_squad.classifiers import BedrockClassifier, BedrockClassifierOptions

orchestrator = AgentSquad(
    classifier=BedrockClassifier(BedrockClassifierOptions())
)
orchestrator.add_agent(BedrockLLMAgent(BedrockLLMAgentOptions(
    name="General Assistant",
    description="Handles general knowledge questions",
)))

async def main():
    response = await orchestrator.route_request(
        user_input="What is the capital of France?",
        user_id="user-123",
        session_id="session-abc",
    )

    if response.streaming:
        # response.output is an async generator of AgentStreamResponse
        async for chunk in response.output:
            if chunk.text:
                print(chunk.text, end="", flush=True)
            if chunk.final_message:
                pass  # full ConversationMessage — already persisted
    else:
        # response.output is a ConversationMessage
        print(response.output.content[0]["text"])

asyncio.run(main())

AgentResponse has three fields: metadata (AgentProcessingResult), output, and streaming (bool). Always branch on response.streaming — the type of output differs.

To stream back from route_request, pass stream_response=True:

response = await orchestrator.route_request(
    user_input="...",
    user_id="u1",
    session_id="s1",
    stream_response=True,
)

If no agent is selected and no default agent is configured, route_request returns an AgentResponse with the NO_SELECTED_AGENT_MESSAGE text rather than raising.

The pieces

AgentSquad (orchestrator)

from agent_squad.orchestrator import AgentSquad

The top-level object. Holds an agent registry, a classifier, and a ChatStorage.

from agent_squad.types import AgentSquadConfig

orchestrator = AgentSquad(
    options=AgentSquadConfig(
        LOG_CLASSIFIER_OUTPUT=True,
        MAX_MESSAGE_PAIRS_PER_AGENT=20,
        USE_DEFAULT_AGENT_IF_NONE_IDENTIFIED=T
Preguntas frecuentes

¿Incluye la referencia completa de la API?

No. Es una guía y un mapa. La skill te dirige al código fuente y a la documentación para las firmas exactas.

¿Qué versión de Python se necesita?

Python 3.11 o una versión más reciente.

¿Puede conectar herramientas externas?

Sí. Un proveedor opcional de herramientas MCP puede conectar varios servidores MCP para que sus herramientas estén disponibles para los agentes.

Detalles

Descripción original del autor

Use when building or modifying a Python app that uses the agent-squad Python package — async multi-agent orchestration for Python 3.11+: orchestrator, agents (BedrockLLMAgent, AnthropicAgent, OpenAIAgent, SupervisorAgent, GroundedAgent, ChainAgent, and more), classifier routing (Bedrock, Anthropic, OpenAI), storage (in-memory, DynamoDB, SQL/Turso), retrievers (Amazon KB, Dakera), tools (AgentTools, MCPToolProvider), and custom implementations.

repo: 2FastLabs/agent-squad

Popularidad

Estrellas en GitHub
7,8 mil
Posición en el ranking
#12830
Licencia
Apache-2.0
Actualizada
8/10/2026

¿Te sirve esta skill?

0

Entra para votar.

Comentarios

  • …

Más skills de este repositorio

Skills parecidas