Skip to main content

Requirements

Node.js

Node.js LTS (20+)

Zod

Zod 3.25.76+ or 4.0.0+ (peer dependency)

Install Package

npm install @deepagents/agent zod

Install AI Provider

Install the AI provider you want to use. The agent framework works with any Vercel AI SDK provider.
npm install @ai-sdk/openai

Environment Variables

Set up your API keys as environment variables:
.env
# OpenAI
OPENAI_API_KEY=your_openai_api_key

# Anthropic
ANTHROPIC_API_KEY=your_anthropic_api_key

# Google
GOOGLE_GENERATIVE_AI_API_KEY=your_google_api_key

# Groq
GROQ_API_KEY=your_groq_api_key

Verify Installation

Create a simple test file to verify your installation:
test.ts
import { openai } from '@ai-sdk/openai';
import { agent, execute } from '@deepagents/agent';

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

const stream = await execute(assistant, 'Say hello!', {});
const text = await stream.text;

console.log(text);
Run the test:
node --env-file=.env test.ts
If everything is set up correctly, you should see a greeting from the agent.

TypeScript Configuration

Ensure your tsconfig.json includes these settings:
tsconfig.json
{
  "compilerOptions": {
    "target": "ES2022",
    "module": "ESNext",
    "moduleResolution": "bundler",
    "strict": true,
    "esModuleInterop": true,
    "skipLibCheck": true
  }
}

Next Steps

Create Your First Agent

Build a simple agent

Add Tools

Integrate tools with your agent

Build docs developers (and LLMs) love