Voice Agents
Build real-time conversational voice agents powered by your custom instructions, knowledge base, and content safety policies. Voice agents handle speech recognition, natural language understanding, response generation, and text-to-speech — all through a single WebSocket connection.How It Works
- Your application opens a WebSocket connection to Perf
- Perf establishes a real-time voice pipeline (speech-to-text, LLM, text-to-speech)
- Your app streams microphone audio to Perf, and receives agent audio + transcripts back
- Content safety policies are evaluated on every turn
Quick Start
1. Create a Voice Agent
In the Perf Dashboard, click Create Agent and configure:- Name — A label for your agent (e.g. “Customer Support”)
- System Prompt — Instructions that define the agent’s behavior
- Voice — Choose from available voices
- First Message — What the agent says when a conversation starts
- Content Policy (optional) — Attach a policy for PII redaction, blocked terms, or custom safety criteria
2. Add the SDK
The fastest way to integrate is the PerfVoice JavaScript SDK:3. Test It
Click your start button, allow microphone access, and speak. You should hear the agent respond and see transcripts in the console.Features
Integration Options
Authentication
Voice agent connections require two parameters:
These are passed as query parameters on the WebSocket URL:
Audio Format
All audio is streamed as PCM 16-bit, 16kHz, mono, little-endian:Content Safety
Voice agents support the same content safety policies as the rest of the Perf platform:- Blocked terms — Prevent specific words or phrases in agent responses
- PII detection — Detect and redact personally identifiable information
- Custom criteria — Define LLM-evaluated safety rules (e.g. “Agent must not provide medical advice”)
- Filler phrases — Play natural filler audio while safety evaluation runs
Next Steps
- JavaScript SDK Reference — Full SDK API documentation
- WebSocket Protocol — Raw WebSocket integration for advanced use cases
- Python Integration — Server-side Python integration
- Content Policies — Configure safety policies