Langsung ke konten
Skillpedia
Agen7.8k Β· #12830

agent-squad-python

Fungsinya

Skill ini adalah panduan untuk membangun aplikasi Python dengan agent-squad, kerangka kerja untuk sistem AI multi-agent. Skill ini menjelaskan jenis agent mana yang cocok untuk setiap kebutuhan. Skill ini cocok untuk pengembang Python yang membangun asisten atau tim agent AI.

Kapan dipakai

  • βœ“Saat Anda membangun aplikasi Python yang mengarahkan permintaan ke beberapa agent AI spesialis.
  • βœ“Saat Anda membutuhkan satu asisten, alur tetap, tim supervisor, atau jawaban yang didasarkan pada data.
  • βœ“Saat Anda ingin menghubungkan server alat eksternal ke agent melalui protokol MCP.

Link skill

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

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/2FastLabs/agent-squad/blob/main/python/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

Contoh permintaan ke AI

β€œBangun aplikasi Python dengan agent-squad yang mengarahkan pertanyaan pelanggan ke agent penagihan dan agent dukungan.”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Skill ini menjelaskan kapan menggunakan satu asisten, beberapa agent dengan orchestrator, agent berbasis data untuk jawaban yang harus sesuai dengan data, rantai untuk langkah tetap, atau supervisor untuk tim. Skill ini menunjuk ke sumber kode dan dokumentasi untuk detail yang tepat.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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
Pertanyaan umum

Apakah skill ini memberikan referensi API lengkap?

Tidak. Ini adalah panduan dan peta. Skill mengarahkan Anda ke kode sumber dan dokumentasi untuk signature yang tepat.

Versi Python apa yang dibutuhkan?

Python 3.11 atau yang lebih baru.

Apakah bisa menghubungkan alat eksternal?

Bisa. Penyedia alat MCP yang opsional dapat menghubungkan sejumlah server MCP sehingga alatnya tersedia bagi agent.

Detail

Deskripsi asli dari pembuat

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

Popularitas

Bintang GitHub
7.8k
Peringkat
#12830
Lisensi
Apache-2.0
Diperbarui
8/10/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa