Skip to main content
Sonamu allows you to build AI agents based on the Vercel AI SDK. It supports various LLM providers like OpenAI and Anthropic, and you can define custom tools to enable agents to perform specific tasks.

What is an AI Agent?

An AI Agent is a system that provides tools to a conversational AI model (LLM), allowing it to automatically perform complex tasks. Characteristics:
  • LLM selects and executes appropriate tools based on context
  • Automatically performs multi-step tasks
  • Maintains context throughout conversations

Required Package Installation

To use AI agents, you need to install the Vercel AI SDK and LLM provider packages.

Using OpenAI

Using Anthropic

Using Both

Basic Configuration

Environment Variables

LLM Model Initialization

Supported Models:
  • gpt-4o: GPT-4 Optimized (latest)
  • gpt-4-turbo: GPT-4 Turbo
  • gpt-4: GPT-4
  • gpt-3.5-turbo: GPT-3.5 Turbo

AgentConfig

The agent configuration object.

Key Options

LLM Model (required)

Additional Options

Practical Configuration Examples

1. Customer Support Chatbot

2. Creative Content Generation

3. Data Analysis Agent

4. Multimodal Agent

Environment-Specific Configuration

Development Environment

Production Environment

Cost Optimization

Model Selection

Token Limits

Precautions

Important considerations when configuring agents:
  1. API Key Security: Environment variables required
  2. Token Limits: Set maxOutputTokens
  3. Temperature Range: 0.0 ~ 2.0
  4. toolChoice Selection: Configure based on use case
  5. Instructions Clarity: Specific instructions
  6. Cost Monitoring: Track token usage in production

Next Steps

Creating Agents

Build agents with BaseAgentClass

Using the AI SDK

Leverage the Vercel AI SDK