agent-squad-python
यह क्या करती है
यह स्किल agent-squad से Python ऐप बनाने का मार्गदर्शन है। agent-squad कई AI एजेंट्स को एक साथ चलाने का फ्रेमवर्क है। यह उन Python डेवलपर्स के लिए है जो AI सहायक या AI एजेंट्स की टीम बना रहे हैं।
कब इस्तेमाल करें
- ✓जब आप एक Python ऐप बना रहे हैं जो अनुरोधों को कई विशेषज्ञ AI एजेंट्स में बाँटता है।
- ✓जब आपको एक सरल सहायक, एक तय क्रम वाली प्रक्रिया, एक सुपरवाइज़र टीम, या डेटा पर आधारित उत्तर चाहिए।
- ✓जब आप बाहरी टूल सर्वर को MCP प्रोटोकॉल के ज़रिए एजेंट से जोड़ना चाहते हैं।
Skill का लिंक
https://github.com/2FastLabs/agent-squad/blob/main/python/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“agent-squad से एक Python ऐप बनाने में मदद कीजिए, जो ग्राहकों के सवाल बिलिंग एजेंट और सपोर्ट एजेंट तक पहुँचाए।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
यह बताती है कि कब एक सहायक, कब कई एजेंट्स और एक ऑर्केस्ट्रेटर, कब डेटा पर आधारित एजेंट, कब तय चरणों वाली चेन, और कब सुपरवाइज़र टीम उपयोग करें। सटीक विवरण के लिए यह स्रोत कोड और डॉक्यूमेंटेशन की ओर इशारा करती है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे 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
Agentsubclass; no orchestrator needed, callprocess_requestdirectly. - Several specialists — multiple agents + an
AgentSquadorchestrator; 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 leadBedrockLLMAgentorAnthropicAgentdelegates to a team of sub-agents via an internal tool loop, maintaining shared context. Can itself be registered in anAgentSquad. - External tool servers —
MCPToolProvider(requiresagent-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
अक्सर पूछे जाने वाले सवाल
क्या इसमें पूरा API रेफरेंस मिलता है?
नहीं। यह एक मार्गदर्शक और नक्शा है। सटीक सिग्नेचर के लिए स्किल आपको स्रोत कोड और डॉक्यूमेंटेशन की ओर भेजती है।
कौन सा Python वर्ज़न चाहिए?
Python 3.11 या उससे नया।
क्या यह बाहरी टूल्स जोड़ सकती है?
हाँ। एक वैकल्पिक MCP टूल प्रोवाइडर कई MCP सर्वर जोड़ सकता है, ताकि उनके टूल्स एजेंट्स के लिए उपलब्ध हों।
जानकारी
लेखक का मूल विवरण
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
लोकप्रियता
- GitHub स्टार
- 7.8k
- रैंकिंग में स्थान
- #12830
- लाइसेंस
- Apache-2.0
- अपडेट की गई
- 8/10/2026
कमेंट
- …
इस repository की और skills
agent-squad-swift
7.8kआपके एजेंट को Swift में iPhone और Mac ऐप बनाने में मदद करती है, जहाँ कई AI सहायक साथ मिलकर काम करते हैं।
agent-squad-typescript
7.8kआपके एजेंट को Node.js ऐप बनाने में मदद करती है, जहाँ कई AI एजेंट मिलकर काम करते हैं, डेटा सहेजते हैं और बाहरी टूल्स से जुड़ते हैं।
मिलती-जुलती skills
add-model-provider
394kयह आपके एजेंट को सुरक्षित कमांड से OpenClaw में नया AI मॉडल प्रोवाइडर जोड़ने, API कीज़ को सादे टेक्स्ट से बचाने और लाइव टेस्ट चलाने देती है।
acp-router
394kयह आपके एजेंट को OpenClaw के ज़रिए Claude Code या Cursor जैसे कोडिंग असिस्टेंट को काम भेजने देती है, ताकि काम उसी टूल में चले।
browser-automation
394kयह आपके एजेंट को लॉगिन, टैब और अटकी वेब पेज से उबरने समेत, वेबसाइट पर चरण-दर-चरण काम करना सिखाती है।