Skip to main content

AI Agent Examples with Source Codes

Necati Ozmen
CMO @VoltAgent-Feeling Irie ⚡
9 min read

VoltAgent is an open source TypeScript framework for building AI agents. This article explores real-world examples applications built with VoltAgent, complete with source code and technical details.

What Is VoltAgent?

VoltAgent is a TypeScript-based AI agent framework. It provides memory management, tools, observability, and sub-agent coordination.

WhatsApp Order Agent

A chatbot implementation that accepts food orders through natural conversation on WhatsApp, queries menu items from a database, and maintains conversation history.

WhatsApp Order Agent

Technical Details:

  • WhatsApp Business API webhook integration
  • SQLite database for menu and order management
  • Memory API for conversation history persistence
  • Natural language understanding for order parameter extraction

Resources:

YouTube to Blog Agent

A multi-agent system that extracts transcripts from YouTube video URLs and generates Markdown-formatted blog posts.

YouTube to Blog Agent

Technical Details:

  • Supervisor agent coordinates 3 sub-agents
  • MCP tools for YouTube transcript API integration
  • Shared memory for inter-agent data transfer
  • Structured Markdown output generation

Resources:

AI Ads Generator Agent

An agent that scrapes landing pages to extract brand information and generates Instagram-formatted visuals using Google Gemini.

AI Ads Generator

Technical Details:

  • BrowserBase Stagehand for headless browser control
  • Color palette and typography extraction from DOM
  • Google Gemini multimodal API for image generation
  • 1080x1080 Instagram post format rendering

Resources:

AI Recipe Generator Agent

A recipe recommendation system based on ingredient lists, dietary restrictions, and time parameters.

Recipe Generator

Technical Details:

  • Zod schema validation for ingredients and dietary preferences
  • Nutrition database integration
  • Structured output for step-by-step instructions
  • Portion and time calculation algorithms

Resources:

AI Research Assistant Agent

A research workflow implementation where multiple agents work in parallel for data collection and analysis.

Research Assistant

Technical Details:

  • 4 different research agents running in parallel
  • Type-safe workflow chaining
  • OpenTelemetry traces for inter-agent dependency visualization
  • Markdown-formatted research report output

Resources:

More Examples

Integration Examples

GitHub Repository Analyzer

This example demonstrates how agents can analyze repository code and automatically generate summaries about project structure, dependencies, and potential issues.

RAG Chatbot

A document-grounded conversational bot that retrieves relevant information from your knowledge base and provides responses with proper citations.

Integrate real-time web search capabilities into your agents, allowing them to augment responses with up-to-date information from the internet.

Vector Database & RAG

Chroma Vector Database

This example shows how to implement RAG (Retrieval-Augmented Generation) using Chroma, demonstrating both automatic retrieval and tool-driven retrieval patterns for enhanced context.

Build semantic search capabilities using Pinecone's vector database, enabling your agents to find contextually similar information through embeddings.

Qdrant Vector Database

Compare two different retrieval strategies: retriever-on-every-turn where documents are fetched automatically, versus LLM-decides where the model determines when to search.

Postgres with pgvector

Use PostgreSQL with the pgvector extension for both structured data storage and semantic similarity search in a single database.

LLM Providers

Anthropic Claude

Connect your agents to Anthropic's Claude models through the AI SDK, giving you access to advanced reasoning and long-context capabilities.

Google Gemini AI

Integrate Google's Gemini models into your VoltAgent applications using the AI SDK provider for multimodal AI capabilities.

Google Vertex AI

Deploy agents using Google Cloud's Vertex AI platform, leveraging enterprise-grade infrastructure and model management.

Groq LPU Inference

Achieve ultra-low latency responses by running your agents on Groq's specialized LPU (Language Processing Unit) hardware.

Amazon Bedrock

Configure your agents to use AWS Bedrock's foundation models, accessing a variety of AI models through Amazon's managed service.

xAI Grok

Power your agents with xAI's Grok models for real-time understanding and generation capabilities.

MCP (Model Context Protocol)

MCP Client Basics

Learn how to connect your agents to Model Context Protocol servers and invoke their tools, enabling standardized integration with external services.

Custom MCP Server

Build your own MCP server that exposes custom tools to agents, allowing you to create reusable tool ecosystems across different agent applications.

Composio MCP Integration

Integrate Composio's suite of third-party application actions into your agents through the Model Context Protocol interface.

Google Drive MCP

Enable your agents to browse folders and read files from Google Drive using an MCP server connection.

Hugging Face MCP

Access HuggingFace's vast collection of models and tools through MCP, allowing your agents to leverage specialized AI capabilities.

Zapier MCP Integration

Connect your agents to thousands of applications through Zapier's automation platform using MCP integration.

Peaka MCP Integration

Integrate Peaka's data federation and query services into your agents through MCP tools for unified data access.

Deployment Platforms

Next.js Integration

Build a React-based frontend that communicates with VoltAgent APIs, featuring streaming responses for real-time agent interactions.

Nuxt Integration

Create a Vue/Nuxt application that seamlessly integrates with VoltAgent's backend services for server-side rendered agent experiences.

Cloudflare Workers Deployment

Deploy your agents to Cloudflare's edge network using the Hono server adapter for global, low-latency serverless execution.

Netlify Functions Deployment

Host your agent APIs as serverless functions on Netlify, enabling easy deployment with automatic scaling and CDN distribution.

Advanced Patterns

Supervisor and Sub-agents

Implement hierarchical agent systems where a supervisor agent coordinates multiple specialized sub-agents, each handling specific aspects of complex tasks.

Multi-step Workflows

Create sophisticated multi-step workflows using createWorkflowChain, including human-in-the-loop approval steps for critical decisions.

Working Memory Management

Maintain per-conversation facts and context that persist across interactions, with built-in tools for reading and updating stored information.

Enable agents to automatically recall relevant context from past conversations using semantic memory and vector similarity search.

Client-side Tool Execution

Execute type-safe tools directly in the browser while maintaining security, with a Next.js frontend managing client-side interactions.

Agent-to-Agent Communication

Set up HTTP endpoints that allow different agents to communicate with each other, enabling distributed multi-agent architectures.

Tools & Utilities

Zod-typed Tool Creation

Learn how to create type-safe tools using Zod schemas, with support for cancellation, streaming responses, and full TypeScript inference.

Structured Thinking Tool

Give your agents a dedicated thinking tool that enables structured reasoning and step-by-step problem solving before providing final answers.

Playwright Browser Automation

Equip your agents with browser automation capabilities using Playwright, enabling them to interact with web pages, fill forms, and extract data.

Dynamic Prompt Generation

Build prompts programmatically from templates and runtime data, allowing you to customize agent behavior based on context and user input.

Dynamic Parameter Validation

Validate and inject runtime parameters into your agents using Zod schemas, ensuring type safety and proper input handling at execution time.

Observability & Evaluation

OpenTelemetry Trace Example

Set up OpenTelemetry tracing with VoltOps integration, allowing you to inspect detailed execution spans and understand your agent's decision-making process.

Langfuse Integration

Export traces and metrics to Langfuse's observability platform for comprehensive monitoring, debugging, and performance analysis of your AI agents.

Live Agent Evaluations

Run real-time evaluations on your agents during development, helping you catch issues and validate behavior changes immediately.

Offline Batch Evaluations

Test your agents against predefined datasets in batch mode, enabling systematic regression testing and quality assurance.

ViteVal Evaluation

Evaluate agent performance and prompt effectiveness using ViteVal's testing framework for systematic quality measurement.

Telemetry Exporter

Configure custom telemetry exports to send traces, metrics, and logs to external observability platforms like Datadog or New Relic.

Voice & Audio

OpenAI Text-to-Speech

Convert your agent's text responses into natural-sounding speech using OpenAI's TTS API with multiple voice options.

ElevenLabs Voice Generation

Generate high-quality, realistic voice audio from agent responses using ElevenLabs' advanced text-to-speech technology.

xAI Voice Synthesis

Integrate xAI's audio models to synthesize voice output from your agent's text responses with natural prosody.

Security & Storage

JWT Authentication

Secure your agent endpoints with JWT token verification, ensuring only authorized users can access your AI services.

Supabase Integration

Leverage Supabase for user authentication and database operations within your agent tools, combining auth and data storage in one platform.

Turso Database

Persist agent memory and conversation history using Turso's distributed LibSQL database for fast, edge-optimized storage.

VoltOps Managed Memory

Use VoltOps' managed memory service through a REST adapter, offloading memory management for production-scale agent deployments.

Core Examples

Minimal Starter Project

Get started with the simplest possible VoltAgent setup featuring a single agent and local development server.

Output Guardrails

Add validation rules and schema enforcement to your agent outputs, ensuring responses always conform to your required format.

Lifecycle Hooks

Implement lifecycle hooks to add logging, authentication, or custom middleware at different stages of agent execution.

Custom REST Endpoints

Extend your VoltAgent server with custom REST routes for additional functionality beyond standard agent endpoints.

Retriever API

Explore the basics of VoltAgent's retriever API for fetching relevant context to augment agent responses.

Vercel AI SDK

Integrate VoltAgent with Vercel's AI SDK for streaming responses and seamless deployment on Vercel's platform.

Getting Started

Create a new VoltAgent project:

npm create voltagent-app@latest

This scaffolds a TypeScript project with agent definitions, workflow examples, and VoltOps integration configured.

VoltAgent is open source. Contributions are welcome on GitHub.