AVA (AI Voice Agent for Asterisk)

repository·main·Indexed 22 days ago

https://github.com/hkjarral/ava-ai-voice-agent-for-asterisk

An open-source, modular AI voice agent for Asterisk and FreePBX systems. It features a pipeline architecture for mixing STT, LLM, and TTS providers, including support for Google Live, Deepgram, OpenAI Realtime, and local GPU setups. The project includes a React-based Admin UI for management, an Agent CLI for diagnostics and configuration, and production-validated 'Golden Baselines' for optimized deployment.

Tokens
199.1K
Snippets
456
Records
869
Agent score
75%

What's inside AVA

  1. Overview of Tool Calling in Asterisk AI Voice Agent

    main

    Tool calling allows AI agents to perform real-world actions during a conversation instead of only responding with text. This capability enables tasks such as:

    • Call Transfers: Moving callers to human agents or specific departments.
    • Email Management: Sending call summaries and transcripts via email.
    • Graceful Hangups: Ending calls with appropriate farewell messages.

    The system is provider-agnostic, meaning tools written for the agent can be used across different AI providers (like OpenAI, Deepgram, or Google Gemini) without code changes. It is designed to be type-safe and easy to extend.

  2. Overview of Admin UI features

    main

    The Admin UI provides several key management capabilities:

    • Dashboard: Monitor system health, container status, and metrics.
    • Providers: Configure AI providers such as OpenAI, Deepgram, or Local providers.
    • Pipelines: Create modular STT→LLM→TTS (Speech-to-Text to Large Language Model to Text-to-Speech) pipelines.
    • Contexts: Define conversation contexts and personas.
    • Models: Manage local AI models (download/delete).
    • Setup Wizard: A guided interface for initial configuration.

    Note: Heavy pages like the Wizard, Raw YAML Editor, Terminal, Logs, and Models are lazy-loaded to optimize performance.

  3. Compare AI Agent configurations

    main

    Choose a configuration based on your priority (cost, privacy, or speed):

    AspectOpenAI RealtimeDeepgramLocal Hybrid
    Ease of Deployment⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
    Hardware CostLowLowMedium-High
    Operating CostHighMediumVery Low
    ScalabilityExcellentExcellentLimited
    PrivacyLowLowHigh
    Response TimeFastestFastModerate
    Concurrent CallsHighHighLow-Medium

    Recommended Use Cases:

    • OpenAI Realtime: Quick deployment, high budget for API costs, 5-50 concurrent calls.
    • Deepgram Voice Agent: Deepgram ecosystem users, complex reasoning needs, 5-50 concurrent calls.
    • Local Hybrid: Privacy-critical (HIPAA/GDPR), cost-sensitive, 5-20 concurrent calls.
  4. Understand the v7.5.1 Hotfix Scope and Impact

    main

    The v7.5.1 hotfix focuses on Admin UI service replacement, Apply-versus-Restart classification, and response-scoped transcripts for OpenAI Realtime and Grok assistants.

    Important Constraints:

    • This hotfix does not change audio profiles, provider media transports, resampling, or fresh-install defaults.
    • It does not require database migrations or audio-profile migrations.
    • It does not change encoding, VAD, or provider-default paths.
    • Existing audio-profile assignments and historical Call History rows are preserved and not rewritten during updates.
  5. Hardware Requirements Quick Reference

    main

    The hardware requirements for the Asterisk AI Voice Agent depend on your chosen deployment configuration. Use the following table to select the appropriate baseline for your environment:

    ConfigurationCPURAMDiskNetworkCost/min
    OpenAI Realtime2+ cores4GB1GBStable internet~$0.06
    Deepgram Voice Agent2+ cores4GB1GBStable internet~$0.03
    Google Live2+ cores4GB1GBStable internetVaries
    ElevenLabs Agent2+ cores4GB1GBStable internetVaries
    Local Hybrid4+ cores (2020+)8-16GB2GBStable internet~$0.002
    Fully Local CPU (optional)8+ cores recommended16GB+ recommended10GB+No internet required$0
    Fully Local GPU (optional)4+ cores + GPU8-16GB + RTX 3060+10GB+No internet required$0
  6. Supported Platforms and Requirements

    main

    The project is optimized for Linux hosts that either run Asterisk/FreePBX locally or can reach an Asterisk/FreePBX host over the network.

    Important: macOS and Windows are considered development-only environments and are not targeted as production hosts for Asterisk. ARM-based hosts are considered Tier 3 (best-effort) and are intended for testing only.

    Baseline Requirements

    To run the project, you must meet these minimum requirements:

    • Docker + Docker Compose v2
    • x86_64 Linux host (for Tier 1/2 support)
    • Asterisk ARI must be reachable with credentials configured in your .env file.
  7. Overview of the Microsoft Calendar tool

    main

    The microsoft_calendar tool enables an AI voice agent to interact with Outlook calendars via Microsoft Graph. It supports listing events, finding free appointment slots, creating bookings, and deleting bookings.

    Key V1 Characteristics

    • Authentication: Uses device-code OAuth. This means no redirect URLs, client secrets, or public HTTPS endpoints are required. The operator authorizes the app by visiting microsoft.com/devicelogin and entering a code provided in the Admin UI.
    • Account Support: Supports Microsoft 365 work or school accounts (single-tenant Entra ID).
    • Unsupported: Personal Outlook.com accounts are NOT supported in V1.
    • Permissions: Uses delegated permissions, meaning the tool acts on behalf of the signed-in user.
    • Multi-account: V1 supports only one connected account per deployment (accounts.default).
  8. Handle Rootless Docker Actions

    main

    When the system detects docker.mode == "rootless", the following logic applies to system actions and suggestions:

    1. Permissions: Omit usermod -aG docker suggestions.
    2. Service Management: Use systemctl --user start docker instead of sudo systemctl start docker.
    3. Paths: Suggest user-writable paths (e.g., ~/aava-media) instead of system paths like /mnt/....
    4. Low Ports: If using ports < 1024, you must enable unprivileged ports via sysctl: sudo sysctl -w net.ipv4.ip_unprivileged_port_start=0
  9. Use Golden Baselines for rapid testing and validation

    main
    Golden Baselines are quick reference files used for regressions, IDE rules, and rapid testing validations. They provide lightweight links to detailed case studies, canonical logs, and quick validation checks to ensure current behavior matches established baseline behavior. Use these references when performing Root Cause Analysis (RCA), guiding testing, or comparing current system behavior against known working states.
  10. Understand the structure of a Golden Baseline case study

    main

    Each Golden Baseline documentation file follows a standardized format to ensure you have all the information needed for deployment. When reviewing a case study, expect to find:

    • Validated production configuration: Settings that have been tested in real-world scenarios.
    • Performance metrics: Validation results such as response latency.
    • Critical settings: Explanations of specific parameters and their impact on the agent.
    • Complete YAML configuration: The full configuration files required to implement the baseline.
    • Lessons learned and troubleshooting: Practical insights and common issues encountered during deployment.
    • Deployment recommendations: Guidance on how to roll out the specific configuration.
  11. How the Unified Tool System works

    main

    The AVA AI Voice Agent uses a Unified Tool System that allows tools to be written once and used across multiple AI providers (like OpenAI or Deepgram).

    Architecture Model

    1. Tool Registry: A central repository where tools like transfer, hangup_call, and send_email_summary are defined.
    2. Provider Adapters: Specialized adapters (e.g., OpenAI Adapter, Deepgram Adapter) translate provider-specific function calls into the unified format used by the registry.
    3. Execution Layer: Once translated, the tools interact with specific services like the ARI Client (for telephony actions) or an Email Service (for business actions).

    Tool Execution Flow

    1. AI Detection: The AI provider detects intent and generates a function call.
    2. Adapter Translation: The provider-specific adapter converts that call into the unified system format.
    3. Registry Lookup: The system retrieves the tool from the registry by name.
    4. Validation: Parameters are validated against the tool's definition.
    5. Execution: The tool logic executes using the provided context (e.g., ARI session).
    6. Result: A success or failure status is returned to the provider.
    7. AI Response: The provider communicates the result back to the caller.