agent-squad-typescript

Guides building multi-agent orchestration apps in TypeScript with the agent-squad npm package.

7.8k|738|Updated Jul 23, 2024
One-click install
npx skills add https://github.com/2FastLabs/agent-squad --skill agent-squad-typescript
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: agent-squad-typescript
Source: https://github.com/2FastLabs/agent-squad/tree/main/typescript
Command: npx skills add https://github.com/2FastLabs/agent-squad --skill agent-squad-typescript

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Building a Node.js/TypeScript application that routes user queries across multiple specialized AI agents requires knowing the correct agent classes, classifiers, storage backends, and tool integrations in the agent-squad package, plus avoiding common pitfalls like unstable agent IDs and un-awaited MCP connections.

Core Features & Use Cases

  • Orchestration guidance: Covers the AgentSquad orchestrator, routeRequest flow, streaming vs non-streaming responses, and classifier routing with Bedrock, Anthropic, or OpenAI classifiers.
  • Agent and tool recipes: Documents all built-in agent types (BedrockLLMAgent, AnthropicAgent, OpenAIAgent, LexBotAgent, LambdaAgent, ChainAgent, SupervisorAgent, GroundedAgent), AgentTools, and the MCPToolProvider async factory pattern.
  • Storage and retrieval: Explains InMemory, DynamoDB, SQL, and Summarizing chat storage plus Amazon Knowledge Bases and Dakera retrievers for RAG.
  • Use Case: You are adding a pricing agent that must never hallucinate figures; the Skill directs you to GroundedAgent with a gatherer LLM calling tools and an isolated presenter LLM speaking only from curated results.

Quick Start

Read the agent-squad TypeScript skill guide, then scaffold an AgentSquad orchestrator with a BedrockLLMAgent and route a sample user request through it.

Frequently Asked Questions about agent-squad-typescript

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I route user queries to multiple AI agents in TypeScript?

Create an AgentSquad orchestrator, register agents with addAgent, and call routeRequest with the user input, userId, and sessionId. A classifier (BedrockClassifier by default, or Anthropic/OpenAI variants) selects the most suitable agent per turn.

How do I add MCP tools to a Bedrock agent in agent-squad?

Use the async factory MCPToolProvider.create with stdio or sse server configs, then pass the provider as toolConfig.tool to a BedrockLLMAgent. Install the optional peer dependency @modelcontextprotocol/sdk and await create before the agent handles requests.

Does agent-squad support streaming responses in Node.js?

Yes, agents configured with streaming: true return a Node.js Transform stream in response.output. Check response.streaming and iterate with for await; the transform accumulates the full response internally for storage.

Why does my agent-squad chat history break after renaming an agent?

The agent id is derived from its name at construction by stripping non-alphanumerics, lowercasing, and replacing spaces with hyphens. Renaming changes the id used as the storage key, so keep agent names stable across deployments.

What is GroundedAgent and when should I use it?

GroundedAgent is a two-LLM anti-hallucination pattern where a gatherer agent calls tools and an isolated presenter agent answers only from curated results. Use it when responses must not drift from live data such as prices or balances.

Can I use agent-squad without AWS credentials?

Yes, but you must pass an explicit classifier since AgentSquad defaults to BedrockClassifier, which fails without AWS credentials. Use AnthropicClassifier or OpenAIClassifier with AnthropicAgent or OpenAIAgent instead.