Home / Market / voice ai engine development

voice ai engine development

Build real-time conversational AI voice engines using async worker pipelines, streaming transcription, LLM agents, and TTS synthesis with interrupt handling and multi-provider support

skill★ 508220 dlgithubCC-BY-4.0 content; MIT code; upstream exceptions applyInstall in CosmosUpstream Source

Documentation & Preview

Voice AI Engine Development Skill

Build production-ready real-time conversational AI voice engines with async worker pipelines, streaming transcription, LLM agents, and TTS synthesis.

Overview

This skill provides comprehensive guidance for building voice AI engines that enable natural, bidirectional conversations between users and AI agents. It covers the complete architecture from audio input to audio output, including:

Quick Start

# Use the skill in your AI assistant
@voice-ai-engine-development I need to build a voice assistant that can handle real-time conversations with interrupts

What's Included

Main Skill File

Examples

Templates

References

Key Concepts

The Worker Pipeline Pattern

Every voice AI engine follows this pipeline:

Audio In → Transcriber → Agent → Synthesizer → Audio Out
           (Worker 1)   (Worker 2)  (Worker 3)

Each worker:

Critical Implementation Details

  1. Buffer LLM Responses - Always buffer the entire LLM response before sending to synthesizer to prevent audio jumping
  2. Mute Transcriber - Mute the transcriber when bot speaks to prevent echo/feedback loops
  3. Rate-Limit Audio - Send audio chunks at real-time speed to enable interrupts
  4. Proper Cleanup - Always cleanup resources in finally blocks to prevent memory leaks

Supported Providers

Transcription

LLM

TTS

Common Use Cases

Architecture Highlights

Async Worker Pattern

class BaseWorker:
    async def _run_loop(self):
        while self.active:
            item = await self.input_queue.get()
            await self.process(item)

Interrupt System

# User interrupts bot mid-sentence
if stop_event.is_set():
    partial_message = get_message_up_to(seconds_spoken)
    return partial_message, True  # cut_off = True

Multi-Provider Factory

factory = VoiceComponentFactory()
transcriber = factory.create_transcriber(config)  # Deepgram, AssemblyAI, etc.
agent = factory.create_agent(config)              # OpenAI, Gemini, etc.
synthesizer = factory.create_synthesizer(config)  # ElevenLabs, Azure, etc.

Testing

The skill includes examples for:

Best Practices

  1. ✅ Always stream at every stage (transcription, LLM, synthesis)
  2. ✅ Buffer entire LLM responses before synthesis
  3. ✅ Mute transcriber during bot speech
  4. ✅ Rate-limit audio chunks for interrupts
  5. ✅ Maintain conversation history for context
  6. ✅ Use proper error handling in worker loops
  7. ✅ Cleanup resources in finally blocks
  8. ✅ Use LINEAR16 PCM at 16kHz for audio

Common Pitfalls

See references/common_pitfalls.md for detailed solutions to:

Contributing

This skill is part of the Agentic Awesome Skills repository. Contributions are welcome!

Related Skills

License

MIT License - See repository LICENSE file

Resources

---

Built with ❤️ for the Antigravity community