मुख्य सामग्री पर जाएँ
Skillpedia
एजेंट7.8k · #12832

agent-squad-typescript

यह क्या करती है

यह गाइड AI को Node.js या TypeScript ऐप लिखने में मदद करती है, जो agent-squad पैकेज से कई AI एजेंट्स चलाता है। यह सर्वर पर AI सहायक बनाने वाले डेवलपर्स के लिए है।

कब इस्तेमाल करें

  • ✓जब मुझे एजेंट्स की ऐसी टीम बनानी है, जिसमें हर एजेंट अलग विषय संभाले।
  • ✓जब मुझे AI चरणों की एक चेन चाहिए, जिसमें हर चरण अपना परिणाम अगले चरण को दे।
  • ✓जब मेरे AI के जवाब मेरे अपने दस्तावेज़ों या नॉलेज बेस से आने चाहिए।

Skill का लिंक

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

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/2FastLabs/agent-squad/blob/main/typescript/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“मुझे एक TypeScript ऐप बनाना है, जिसमें कई AI एजेंट अलग-अलग तरह के सवालों के जवाब दें। मुझे कहाँ से शुरू करना चाहिए?”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

यह AI को बताती है कि पैकेज के कौन से हिस्से इस्तेमाल करने हैं, जैसे ऑर्केस्ट्रेटर, एजेंट्स, राउटिंग और स्टोरेज, और किन चीज़ों से बचना है। सटीक कोड विवरण पैकेज से ही आते हैं।

तकनीकी सामग्री (मूल SKILL.md)

लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।

agent-squad TypeScript — assistant guide

Node.js / TypeScript multi-agent orchestration framework (npm package agent-squad). All public symbols are exported from a single barrel typescript/src/index.ts. This file is guidance and a map — not an API reference. Read exact signatures from typescript/src/ and worked recipes from 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 + AgentSquad with no routing. Or skip the orchestrator entirely and call agent.processRequest(...) directly.
  • Several specialists → multiple agents registered with orchestrator.addAgent(agent), a classifier routes each turn.
  • Answers must not drift from data (prices, balances, live lookups) → GroundedAgent: a gatherer LLM calls tools, an isolated presenter LLM speaks only from the curated results.
  • Fixed pipeline → ChainAgent: each agent's output is the next agent's input.
  • One lead LLM coordinating a team → SupervisorAgent: the lead calls sub-agents as tools.
  • External tools via MCP → MCPToolProvider (async factory pattern, optional peer dep).
  • RAG context → attach a Retriever to any agent that supports retriever? in its options.

How to install

npm install agent-squad

Optional peer dependencies — install only what you use:

Package Used by
@aws-sdk/client-bedrock-runtime BedrockLLMAgent, BedrockClassifier (already a hard dep in current releases)
@anthropic-ai/sdk AnthropicAgent, AnthropicClassifier (already a hard dep)
openai OpenAIAgent, OpenAIClassifier (already a hard dep)
@modelcontextprotocol/sdk MCPToolProvider — lazy await import() at connect time
@dakera-ai/dakera DakeraRetriever — lazy require() at construction time

@modelcontextprotocol/sdk and @dakera-ai/dakera are the only two true optional peer deps; everything else ships as a hard dependency at the moment.

How a turn works

routeRequest is the single entry point. It classifies the input, dispatches to the selected agent, saves the exchange, and returns an AgentResponse. The response is either a plain string or a Node.js Transform stream:

import { AgentSquad, BedrockLLMAgent, BedrockClassifier } from 'agent-squad';

const orchestrator = new AgentSquad({
  classifier: new BedrockClassifier(),   // default when omitted
  // storage: new DynamoDbChatStorage(...),
  // config: { LOG_AGENT_CHAT: true, MAX_MESSAGE_PAIRS_PER_AGENT: 50 },
});

orchestrator.addAgent(new BedrockLLMAgent({
  name: 'Tech Support',
  description: 'Handles technical questions about software and hardware',
  streaming: true,
}));

const response = await orchestrator.routeRequest(
  userInput,
  userId,
  sessionId,
  additionalParams   // optional Record<string, any>
);

if (response.streaming) {
  // response.output is an AccumulatorTransform (Node.js Transform)
  for await (const chunk of response.output) {
    process.stdout.write(chunk);
  }
} else {
  // response.output is a string
  console.log(response.output);
  // response.thinking? is set when the agent used extended thinking
}

// response.metadata: { agentId, agentName, userId, sessionId, userInput, additionalParams }

routeRequest never throws — it catches all errors and returns them as a non-streaming AgentResponse with the error string in output (configurable via GENERAL_ROUTING_ERROR_MSG_MESSAGE).

The pieces

Orchestrator: AgentSquad

new AgentSquad(options?: OrchestratorOptions)

Key OrchestratorOptions fields:

Field Default Notes
classifier new BedrockClassifier() Any Classifier subclass
storage new InMemoryChatStorage() Any ChatStorage subclass
defaultAgent undefined Used when classifier returns no match and USE_DEFAULT_AGENT_IF_NONE_IDENTIFIED is true
config.USE_DEFAULT_AGENT_IF_NONE_IDENTIFIED true Fall back to defaultAgent or return NO_SELECTED_AGENT_MESSAGE
config.MAX_MESSAGE_PAIRS_PER_AGENT 100 Per-agent history cap (pairs = user+assistant)
config.MAX_RETRIES 3 Classifier retries on bad XML response
config.LOG_AGENT_CHAT false

Useful methods: addAgent(agent), setDefaultAgent(agent), getDefaultAgent(), getAllAgents(), analyzeAgentOverlap(), classifyRequest(...), `agentProcess

अक्सर पूछे जाने वाले सवाल

एजेंट का डेटा कहाँ सहेजा जा सकता है?

पैकेज इन-मेमोरी स्टोरेज, DynamoDB और SQL डेटाबेस को सपोर्ट करता है, इसलिए आप अपनी ज़रूरत का विकल्प चुन सकते हैं।

पैकेज कैसे इंस्टॉल होता है?

गाइड agent-squad पैकेज के लिए मानक npm install कमांड का उपयोग करती है, और ज़रूरत पड़ने पर ही अतिरिक्त विकल्प जोड़े जाते हैं।

क्या एजेंट्स MCP टूल्स इस्तेमाल कर सकते हैं?

हाँ, MCP टूल प्रोवाइडर से एजेंट्स बाहरी सर्वर के टूल्स इस्तेमाल कर सकते हैं।

जानकारी

लेखक का मूल विवरण

Use when building or modifying a Node.js / TypeScript app that uses the agent-squad npm package — multi-agent orchestration: orchestrator, agents (all built-in types + GroundedAgent), classifier routing (Bedrock / Anthropic / OpenAI), storage (in-memory / DynamoDB / SQL), retrievers (Amazon KB / Dakera), and tools (AgentTools + MCPToolProvider).

repo: 2FastLabs/agent-squad

लोकप्रियता

GitHub स्टार
7.8k
रैंकिंग में स्थान
#12832
लाइसेंस
Apache-2.0
अपडेट की गई
8/10/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

मिलती-जुलती skills