- Home
- Automation
- Ai Sdk Agents
Ai Sdk Agents
A flexible toolkit for building, running, and managing AI-powered agents - built on top of the Verce
Rating
Votes
0
score
Downloads
0
total
Price
Free
No login needed
Works With
About
AI SDK Agents
](https://npmjs.org/package/ai-sdk-agents) [ [](https://github.com/sslava/ai-sdk-agents/actions)
AI SDK Agents is an extension of the standard Vercel AI SDK API. It enables you to build advanced generative applications using patterns and agent compositions that are not supported by the Vercel AI SDK out of the box. With this library, you can define your own agents, compose them together, and call agents as tools within other agents, unlocking complex reasoning and orchestration flows.
Features
- 🚀 Extends the Vercel AI SDK API to support new generative app patterns
- 🤖 Define and compose agents (agents can call each other as tools)
- 🔄 Flexible flow and step management
- 🛠️ Extensible tool system
- 📝 Context and memory between steps
- 🔄 Streaming response support
Installation
npm install ai-sdk-agents
# or
yarn add ai-sdk-agents
# or
pnpm add ai-sdk-agentsPrerequisites
This package requires the Vercel AI SDK and zod as a peer dependency:
npm install ai zod
# or
yarn add ai zod
# or
pnpm add ai zodUsage
Here's a basic example of how to use the library:
import { z } from 'zod';
import { generateId } from 'ai';
import { openai } from '@ai-sdk/openai';
import { agent, ChatFlow } from 'ai-sdk-agents';
// Math expert agent, exposed as a tool
const mathAgent = agent({
model: openai('gpt-4o'),
description: 'Math expert that can answer questions and help with tasks.',
system: 'You are a math expert that can answer questions and help with tasks.',
output: z.object({
answer: z.string().describe('The answer to the math problem'),
}),
asTool: {
input: z.object({
question: z.string().describe('The math problem to solve'),
}),
getPrompt: ({ question }) => ({
prompt: `Solve the following math problem: ${question}`,
}),
},
});
const assistantAgent = agent({
model: openai('gpt-4o'),
system: 'You are a helpful assistant that can answer questions and help with tasks.',
tools: { math: mathAgent },
maxSteps: 5,
toolChoice: 'auto',
});
const chat = new ChatFlow({ agent: assistantAgent });
const context = { history: [{ role: 'user', content: 'What is the square root of 144?' }] };
const { result } = await chat.run(context);
const { messages } = await result.response;
console.log(messages);This example demonstrates how to build a streaming chat API where the assistant agent can automatically use the math agent as a tool to solve math problems in user queries. The response is streamed in real time to the client.
Other examples
Don't lose this
Three weeks from now, you'll want Ai Sdk Agents again. Will you remember where to find it?
Save it to your library and the next time you need Ai Sdk Agents, it’s one tap away — from any AI app you use. Group it into a bench with the rest of the team for that kind of task and you can pull the whole stack at once.
⚡ Pro tip for geeks: add a-gnt 🤵🏻♂️ as a custom connector in Claude or a custom GPT in ChatGPT — one click and your library is right there in the chat. Or, if you’re in an editor, install the a-gnt MCP server and say “use my [bench name]” in Claude Code, Cursor, VS Code, or Windsurf.
a-gnt's Take
Our honest review
A flexible toolkit for building, running, and managing AI-powered agents - built on top of the Verce. Best for anyone looking to make their AI assistant more capable in automation. It's completely free and works across most major AI apps. This one just landed in the catalog — worth trying while it's fresh.
Tips for getting started
Tap "Get" above, pick your AI app, and follow the steps. Most installs take under 30 seconds.
What's New
Imported from GitHub
Ratings & Reviews
0.0
out of 5
0 ratings
No reviews yet. Be the first to share your experience.