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가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
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
Agentsubclass +AgentSquadwith no routing. Or skip the orchestrator entirely and callagent.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
Retrieverto any agent that supportsretriever?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.
댓글
- …
이 저장소의 다른 스킬
agent-squad-python
7.8k여러 AI 에이전트를 조율하고 요청을 라우팅하며 도구를 공유하는 agent-squad 패키지로 Python 앱을 만들도록 돕습니다.
agent-squad-swift
7.8k여러 AI 도우미를 함께 실행하는 iPhone과 Mac용 Swift 앱을 만들도록 돕습니다. 라우팅, 도구, 기기 내 저장소를 포함합니다.
비슷한 스킬
add-model-provider
394k에이전트가 안전한 설정 명령으로 새 AI 모델 제공자를 OpenClaw에 연결하고, API 키를 평문으로 두지 않으며, 실시간 테스트를 실행하도록 돕습니다.
acp-router
394k에이전트가 OpenClaw를 통해 Claude Code나 Cursor 같은 코딩 도우미에 작업을 전달해, 작업이 그 도구에서 실행되도록 돕습니다.
browser-automation
394k에이전트가 로그인, 탭, 페이지 응답이 멈췄을 때의 복구를 포함해 웹 페이지를 단계별로 조작하도록 가르칩니다.