hackers365/xiaozhi-esp32-server-golang
golang版本的小智后端服务,支持websocket和mqtt+udp协议,支持声纹识别/声音克隆/知识库/mcp远程调用/主动音频下发/openclaw等功能
Featured achievements
The project's latest awards
#1 Repository of the week
#1 Repository of the week
🔊 Xiaozhi ESP32 Server in Go
A high-performance, full-streaming AI voice backend built for ESP32 and IoT devices.
xiaozhi-esp32-server-golang is a Go implementation of the Xiaozhi AI backend designed for real-time voice interaction on IoT and smart terminal devices. It wires ASR, LLM, and TTS into an end-to-end streaming pipeline and supports large-scale concurrent connections over both WebSocket and MQTT+UDP.
✨ Highlights
- End-to-end full-streaming: ASR → LLM → TTS processed in full stream for low-latency real-time interaction.
- Speaker recognition & dynamic TTS switching: Automatically switches TTS voice based on speaker identity for a more personalized experience.
- Unified transport abstraction: WebSocket and MQTT+UDP are abstracted under one Transport layer for flexible injection and easier protocol extension.
- Queue-based processing: LLM and TTS use message queues for async processing with flexible business logic injection.
- Multi-protocol high concurrency: Built to handle large-scale device access and message delivery.
- Resource pooling & connection reuse: External resource connection pools help cut response time and boost throughput.
- Multi-engine AI integration: Uses the Eino framework to integrate FunASR, OpenAI-compatible APIs, Ollama, Doubao, EdgeTTS, CosyVoice, and more.
- Modular plug-and-play architecture: VAD, ASR, LLM, TTS, MCP, vision, and other modules are independent and pluggable.
- MCP Audio Server: Supports paged audio resource retrieval, streaming, music playback, and volume control.
- OpenClaw agent integration: Per-agent OpenClaw Endpoint with connection status, session testing, and keyword-based enter/exit routing (default "打开龙虾/进入龙虾" and "关闭龙虾/退出龙虾").
- Full-featured Web management console: Visual config wizard, full-chain availability tests for VAD/ASR/LLM/TTS, device management, message injection, real-time latency monitoring, and OTA validation.
- Advanced business features: MCP market aggregation/import, voice cloning, knowledge base (Dify/RAGFlow/WeKnora), and per-device/agent MCP remote call debugging.
- Easy deployment: Prebuilt AIO package (main program + console + speaker service), Docker one-click deployment, and support for Linux/Windows/macOS local builds.
💡 Why it matters
By keeping the entire voice chain in one full-streaming pipeline and unifying WebSocket with MQTT+UDP under one transport layer, this project is built to keep latency low for many concurrent ESP32 devices at the same time. Its modular design avoids locking into a single ASR/LLM/TTS engine while still tying them together cleanly with Eino.
With built-in tools like OpenClaw agent routing, MCP market and remote calls, voice cloning, knowledge base integration, and a full Web console, it covers more than just a basic voice relay. Multiple deployment paths and detailed docs make it practical for both quick testing and building a more complete Xiaozhi voice backend.
#Go #ESP32 #AI #ASR #LLM #TTS #MCP #IoT #OpenSource #TiniX
Similar Projects
Discover other similar projects and AI models.
Get up and running with Inkling, Kimi, GLM, MiniMax, DeepSeek, gpt-oss, Qwen, Gemma and other models.
The AI that really does things. Any OS. Any Platform. The lobster way. 🦞
CasaOS - A simple, easy-to-use, elegant open-source Personal Cloud system.
💖🧸 Self hosted, you-owned Grok Companion, a container of souls of waifu, cyber livings to bring them into our worlds, wishing to achieve Neuro-sama's altitude. Capable of realtime voice chat, Minecraft, Factorio playing. Web / macOS / Windows supported.
Open-source personal AI assistant & Agent Harness. Plans tasks, runs tools and skills, self-evolves with memory and knowledge. Multi-agent, multi-model, multi-channel. Lightweight, extensible, one-line install.