Skip to main content

Overview

Voice AI agents combine traditional agent capabilities with text-to-speech (TTS) technology to create immersive, conversational experiences. These agents can process text or voice input and respond with natural-sounding speech, making them ideal for customer support, educational content, and accessibility applications.
All voice agents in this collection use advanced TTS models from OpenAI, ElevenLabs, or Google for high-quality, natural-sounding voice output.

Voice RAG Systems

Voice RAG with OpenAI SDK

A voice-enabled Retrieval-Augmented Generation system that processes PDFs and responds with both text and voice. Architecture:
Features:

Document Processing

  • PDF upload and parsing
  • Intelligent chunking
  • FastEmbed embeddings
  • Qdrant vector storage
  • Multiple document tracking

Voice Features

  • Multiple voice options
  • Real-time text-to-speech
  • Downloadable MP3 files
  • Spoken-word optimization
  • Natural speech patterns

RAG Pipeline

  • Query embedding
  • Similarity search
  • Context-aware responses
  • Source attribution
  • Document references

Agent Workflow

  • Processing agent for answers
  • TTS agent for speech optimization
  • Real-time audio streaming
  • Progress tracking
Setup Requirements:
1

Get API Keys

2

Create Environment File

3

Run Application

4

Upload and Query

  • Upload PDF documents
  • Ask questions about content
  • Select preferred voice
  • Listen to or download responses
Voice Selection: OpenAI provides multiple voice personalities:
  • alloy - Neutral and balanced
  • echo - Clear and articulate
  • fable - Warm and expressive
  • onyx - Deep and authoritative
  • nova - Friendly and energetic
  • shimmer - Soft and pleasant
Implementation Pattern:
The TTS agent optimizes responses for speech by adjusting pacing, adding appropriate pauses, and ensuring natural flow - significantly improving audio quality.

Customer Support Agents

Customer Support Voice Agent

An OpenAI SDK powered customer support agent that delivers voice responses to questions about your knowledge base. System Architecture:
Agent Team:
Role: Answer generation from knowledge baseCapabilities:
  • Analyzes documentation content
  • Generates clear, concise responses
  • Provides context from sources
  • Handles follow-up questions
  • Maintains conversation context
Tools:
  • Qdrant vector search
  • FastEmbed for embeddings
  • GPT-4o for reasoning
Voice Customization: Supports 11 OpenAI TTS voices:
  • alloy - Versatile, neutral tone
  • ash - Clear and professional
  • ballad - Expressive storytelling
  • coral - Warm and welcoming
  • echo - Articulate and clear
  • fable - Engaging narrator
  • onyx - Authoritative presence
  • nova - Energetic and friendly
  • sage - Calm and knowledgeable
  • shimmer - Gentle and soothing
  • verse - Conversational tone
Setup and Usage:
1

Configure API Keys

Enter in sidebar:
  • OpenAI API key
  • Qdrant API key and URL
  • Firecrawl API key
2

Initialize Knowledge Base

  • Input documentation URL
  • Select preferred voice
  • Click “Initialize System”
  • Wait for crawling and indexing
3

Ask Questions

  • Type questions about the documentation
  • Receive text response
  • Listen to voice response
  • Download audio if needed
Features in Detail:

Knowledge Base Creation

  • Crawls documentation websites
  • Preserves document structure
  • Stores metadata
  • Supports up to 5 pages (configurable)

Vector Search

  • FastEmbed for embeddings
  • Semantic similarity search
  • Efficient document retrieval
  • Context-aware results

Voice Generation

  • High-quality TTS
  • Multiple voice options
  • Natural speech patterns
  • Proper pacing and emphasis

Interactive Interface

  • Clean Streamlit UI
  • Sidebar configuration
  • Real-time processing
  • Progress indicators
  • Audio player with download
Scaling Configuration: The default setup crawls 5 pages. To index more documentation, adjust the max_pages parameter in the Firecrawl configuration.

Audio Tour Agents

Self-Guided AI Audio Tour Agent

A conversational voice agent that generates immersive, self-guided audio tours based on location, interests, and duration. Multi-Agent Architecture:

Orchestrator Agent

Coordinates overall tour flow, manages transitions, and assembles content from expert agents.

History Agent

Delivers historical narratives with authoritative voice and detailed context.

Architecture Agent

Highlights architectural details, styles, and design elements with technical descriptions.

Culture Agent

Explores local customs, traditions, and artistic heritage with enthusiastic tone.

Culinary Agent

Describes iconic dishes and food culture with passionate, engaging voice.
Tour Generation Workflow:
Features:
Dynamic Content Generation:
  • Based on user-input location
  • Real-time web search integration
  • Up-to-date information
  • Relevant local details
Personalization:
  • Filtered by interest categories
  • Weighted by user preferences
  • Customized depth of coverage
Usage Flow:
1

Enter Location

Specify the destination for your audio tour:
  • City name (e.g., “Rome”)
  • Landmark (e.g., “Eiffel Tower”)
  • Region (e.g., “Tuscany”)
2

Select Interests

Choose areas of interest:
  • History and heritage
  • Architecture and design
  • Culture and arts
  • Culinary experiences
Adjust weights for each category
3

Choose Duration

Select tour length:
  • 15 min (highlights)
  • 30 min (standard)
  • 60 min (comprehensive)
4

Generate Tour

  • Agents research and create content
  • Orchestrator assembles narrative
  • Voice synthesis generates audio
  • Download or stream result
Example Tour Structure (30 minutes):
Best Practices:
  • Be specific with location for better results
  • Adjust interest weights to personalize content
  • Start with 30-minute tours for balanced experience
  • Use headphones for immersive experience

Implementation Patterns

Basic Voice Agent

Voice RAG Pattern

Multi-Agent Voice System

Streaming Voice Responses

Voice Quality Optimization

Text Optimization for TTS

Voice Selection Guide

Audio Quality Settings

Best Practices

Response Formatting

  • Use conversational language
  • Break into short sentences
  • Add natural pauses with punctuation
  • Spell out acronyms
  • Avoid complex markdown

Voice Selection

  • Match voice to use case
  • Test multiple options
  • Consider audience preferences
  • Use consistent voices for roles
  • Vary voices in multi-agent systems

Audio Processing

  • Use HD model for quality
  • Stream for long content
  • Cache generated audio
  • Provide download options
  • Add playback controls

Error Handling

  • Handle API failures gracefully
  • Provide text fallback
  • Show loading indicators
  • Timeout long requests
  • Log audio generation issues
Cost Considerations:
  • TTS API costs per character
  • HD models cost more than standard
  • Cache audio when possible
  • Monitor usage in production
  • Consider rate limits

Next Steps

MCP Agents

Add external service integration

Multi-Agent Teams

Build coordinated agent systems

Advanced Agents

Explore sophisticated implementations

Game Playing

Try adversarial agent systems