<!-- source: https://deepwiki.com/MervinPraison/PraisonAI/7.5-realtime-voice-interface -->

# Realtime Voice Interface

- README.md
- docker/Dockerfile
- docker/Dockerfile.chat
- docker/Dockerfile.dev
- docker/Dockerfile.ui
- docker/README.md
- src/praisonai-agents/pyproject.toml
- src/praisonai-agents/uv.lock
- src/praisonai/README.md
- src/praisonai/praisonai.rb
- src/praisonai/praisonai/cli/main.py
- src/praisonai/praisonai/deploy.py
- src/praisonai/praisonai/version.py
- src/praisonai/pyproject.toml
- src/praisonai/uv.lock

The Realtime Voice Interface provides real-time voice communication capabilities for PraisonAI agents, enabling natural voice interactions with AI agents through WebSocket connections, streaming responses, and telephony integrations. This interface allows users to communicate with agents using voice input and receive audio responses in real-time.

For web-based chat interfaces without voice capabilities, see [Web UI (Chainlit)](/MervinPraison/PraisonAI/6.1-guardrails). For general tool integrations that may be used within voice interfaces, see [Tool Integration](/MervinPraison/PraisonAI/5.1-tool-integration).

## Architecture Overview

The realtime voice interface is built as a modular component within the PraisonAI ecosystem, leveraging WebSocket connections for real-time communication and integrating with various voice processing and telephony services.

### System Components

```

```

Sources: [src/praisonai/pyproject.toml69-81](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/src/praisonai/pyproject.toml#L69-L81) [src/praisonai/pyproject.toml82-91](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/src/praisonai/pyproject.toml#L82-L91)

### Package Dependencies

The realtime voice interface relies on specific optional dependencies defined in the project configuration:

Sources: [src/praisonai/pyproject.toml69-81](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/src/praisonai/pyproject.toml#L69-L81) [src/praisonai/pyproject.toml82-91](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/src/praisonai/pyproject.toml#L82-L91)

## Installation and Configuration

### Realtime Feature Installation

The realtime voice interface is available as an optional feature installation:

```

```

For voice calling capabilities, install the call feature:

```

```

Sources: [src/praisonai/pyproject.toml69-81](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/src/praisonai/pyproject.toml#L69-L81) [src/praisonai/pyproject.toml82-91](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/src/praisonai/pyproject.toml#L82-L91)

### Docker Deployment

The realtime voice interface is supported in Docker environments:

```

```

Sources: [docker/Dockerfile.dev26](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/docker/Dockerfile.dev#L26-L26)

## Streaming Response Engine

The realtime voice interface supports streaming responses for immediate user feedback:

### Streaming Implementation

```

```

The streaming capability is demonstrated in the agent configuration where `stream=True` enables real-time response generation:

Sources: [src/praisonai-agents/realtime-streaming.py8](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/src/praisonai-agents/realtime-streaming.py#L8-L8)

## Voice Calling Integration

### Twilio Integration Architecture

```

```

The voice calling system provides a dedicated command-line interface accessible through the `praisonai-call` script.

Sources: [src/praisonai/pyproject.toml25](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/src/praisonai/pyproject.toml#L25-L25) [src/praisonai/pyproject.toml82-91](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/src/praisonai/pyproject.toml#L82-L91)

## WebSocket Communication Protocol

### Real-time Message Flow

```

```

The WebSocket implementation uses the `websockets>=12.0` package for maintaining persistent connections required for real-time voice communication.

Sources: [src/praisonai/pyproject.toml76](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/src/praisonai/pyproject.toml#L76-L76)

## Integration with Chainlit Framework

The realtime voice interface integrates with Chainlit for web-based voice interactions:

### Chainlit Configuration

```

```

Sources: [src/praisonai/pyproject.toml70](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/src/praisonai/pyproject.toml#L70-L70) [docker/README.md28-29](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/docker/README.md?plain=1#L28-L29) [docker/README.md72-73](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/docker/README.md?plain=1#L72-L73)

## Agent Integration

### Async Agent Communication

The realtime voice interface supports asynchronous agent operations for responsive voice interactions:

```

```

The async capabilities enable non-blocking voice interactions where multiple voice sessions can be handled concurrently.

Sources: [src/praisonai-agents/any-llm-agents-async.py12](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/src/praisonai-agents/any-llm-agents-async.py#L12-L12) [src/praisonai-agents/async-tavily-agents-gemini.py44-50](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/src/praisonai-agents/async-tavily-agents-gemini.py#L44-L50)

## Tool Integration for Voice

The realtime voice interface can leverage various tools during voice conversations:

Sources: [src/praisonai/pyproject.toml74-80](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/src/praisonai/pyproject.toml#L74-L80)

## Environment Configuration

### Docker Environment Variables

For containerized deployments, the realtime voice interface uses specific environment configurations:

Sources: [docker/Dockerfile.dev41-44](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/docker/Dockerfile.dev#L41-L44)

## Development and Testing

The development environment includes comprehensive support for realtime voice interface development with additional tools for testing and debugging:

Sources: [docker/Dockerfile.dev32-35](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/docker/Dockerfile.dev#L32-L35)
