Skip to main content
@deepagents/agent is a framework for building multi-agent AI systems with TypeScript. Create agents that use tools, coordinate through handoffs, and work together to solve complex tasks.

Features

Agent Composition

Build modular agents with specific roles and capabilities

Tool Integration

Compatible with Vercel AI SDK tools

Handoffs

Agents can delegate to specialized agents automatically

Structured Output

Type-safe responses with Zod schemas

Streaming

Real-time streaming responses

Context Sharing

Type-safe state passed between agents

Quick Example

import { openai } from '@ai-sdk/openai';
import { agent, execute, user } from '@deepagents/agent';

const assistant = agent({
  name: 'assistant',
  model: openai('gpt-4o'),
  prompt: 'You are a helpful assistant.',
});

const stream = execute(assistant, 'Hello!', {});

for await (const chunk of stream.textStream) {
  process.stdout.write(chunk);
}

Use Cases

Research & Writing

Build agents that research topics, gather information, and produce detailed reports:
  • Planner Agent - Generates search queries
  • Research Agent - Executes searches and summarizes findings
  • Writer Agent - Synthesizes research into cohesive reports

Customer Support

Create specialized agents for different support scenarios:
  • Triage Agent - Routes requests to appropriate specialists
  • Billing Agent - Handles payment and subscription issues
  • Technical Agent - Provides technical troubleshooting

Data Analysis

Coordinate agents for complex data workflows:
  • SQL Agent - Queries databases
  • Analysis Agent - Processes and interprets results
  • Visualization Agent - Creates charts and dashboards

Core Concepts

1

Agents

Agents are autonomous units with a language model, instructions, and optional tools. Each agent has a specific role and capabilities.
2

Tools

Tools extend agent capabilities by allowing them to interact with external systems, APIs, or perform computations.
3

Handoffs

Handoffs enable agents to transfer control to specialized agents when needed, creating a coordination hierarchy.
4

Context Variables

Shared state that flows through agent interactions, enabling stateful multi-agent workflows.

AI Model Providers

Works with any model provider supported by the Vercel AI SDK:
import { anthropic } from '@ai-sdk/anthropic';
import { google } from '@ai-sdk/google';
import { groq } from '@ai-sdk/groq';
import { openai } from '@ai-sdk/openai';

const agent1 = agent({ model: openai('gpt-4o') /* ... */ });
const agent2 = agent({ model: anthropic('claude-sonnet-4-20250514') /* ... */ });
const agent3 = agent({ model: google('gemini-1.5-pro') /* ... */ });
const agent4 = agent({ model: groq('llama-3.3-70b-versatile') /* ... */ });

Next Steps

Installation

Install @deepagents/agent in your project

Basic Agent

Create your first agent

Tools

Integrate tools with agents

Multi-Agent

Build multi-agent systems

Build docs developers (and LLMs) love