본문으로 건너뛰기
Skillpedia
에이전트7.8k · #12832

agent-squad-typescript

하는 일

이 안내서는 AI가 agent-squad 패키지로 여러 AI 에이전트를 실행하는 Node.js 또는 TypeScript 앱을 작성하도록 돕습니다. 서버에서 AI 어시스턴트를 만드는 개발자를 위한 것입니다.

사용하는 경우

  • ✓각 에이전트가 다른 주제를 맡는 AI 에이전트 팀을 만들고 싶을 때.
  • ✓각 단계가 결과를 다음 단계로 넘기는 AI 단계의 체인이 필요할 때.
  • ✓AI 답변이 내 문서나 지식 베이스를 활용해야 하는 경우.

스킬 링크

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

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/2FastLabs/agent-squad/blob/main/typescript/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“여러 AI 에이전트가 서로 다른 종류의 질문에 답하는 TypeScript 앱을 설정하고 싶습니다. 어떻게 시작하면 좋을까요?”

매주 새 스킬 5개. 읽는 데 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
업데이트
2026. 10. 8.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬