Skip to content
Skillpedia
Agents7.8k Β· #12830

agent-squad-python

What it does

This skill is a guide for building Python applications with agent-squad, a framework for multi-agent AI systems. It explains which agent type fits each need. It is for Python developers building assistants or teams of AI agents.

When to use it

  • βœ“When you are building a Python app that routes requests across several specialist AI agents.
  • βœ“When you need a single assistant, a fixed pipeline, a supervisor team, or answers grounded in data.
  • βœ“When you want to connect external tool servers to an agent through the MCP protocol.

Skill link

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

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/2FastLabs/agent-squad/blob/main/python/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute β†’

Example of what to ask your AI

β€œBuild a Python app with agent-squad that routes customer questions to a billing agent and a support agent.”

5 new skills a week. 1 minute to read.

How it works

It explains when to use a single assistant, several agents with an orchestrator, a grounded agent for answers that must match data, a chain for fixed steps, or a supervisor for teams. It points you to the source and docs for exact details.

Technical content (original SKILL.md)

Original text by the author, straight from 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
FAQ

Does it give the full API reference?

No. It is a guide and map. The skill directs you to the source code and documentation for exact signatures.

Which Python version is needed?

Python 3.11 or newer.

Can it connect external tools?

Yes. An optional MCP tool provider can connect any number of MCP servers so their tools are available to agents.

Details

Original description by the author

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

Popularity

GitHub stars
7.8k
Ranking position
#12830
License
Apache-2.0
Updated
10/8/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills