back to home

78 / xiaozhi-esp32

An MCP-based chatbot | 一个基于MCP的聊天机器人

24,118 stars
5,157 forks
521 issues
C++CPython

AI Architecture Analysis

This repository is indexed by RepoMind. By analyzing 78/xiaozhi-esp32 in our AI interface, you can instantly generate complete architecture diagrams, visualize control flows, and perform automated security audits across the entire codebase.

Our Agentic Context Augmented Generation (Agentic CAG) engine loads full source files into context, avoiding the fragmentation of traditional RAG systems. Ask questions about the architecture, dependencies, or specific features to see it in action.

Embed this Badge

Showcase RepoMind's analysis directly in your repository's README.

[![Analyzed by RepoMind](https://img.shields.io/badge/Analyzed%20by-RepoMind-4F46E5?style=for-the-badge)](https://repomind-ai.vercel.app/repo/78/xiaozhi-esp32)
Preview:Analyzed by RepoMind

Repository Summary (README)

Preview

An MCP-based Chatbot

(English | 中文 | 日本語)

Introduction

👉 Human: Give AI a camera vs AI: Instantly finds out the owner hasn't washed hair for three days【bilibili】

👉 Handcraft your AI girlfriend, beginner's guide【bilibili】

As a voice interaction entry, the XiaoZhi AI chatbot leverages the AI capabilities of large models like Qwen / DeepSeek, and achieves multi-terminal control via the MCP protocol.

<img src="docs/mcp-based-graph.jpg" alt="Control everything via MCP" width="320">

Version Notes

The current v2 version is incompatible with the v1 partition table, so it is not possible to upgrade from v1 to v2 via OTA. For partition table details, see partitions/v2/README.md.

All hardware running v1 can be upgraded to v2 by manually flashing the firmware.

The stable version of v1 is 1.9.2. You can switch to v1 by running git checkout v1. The v1 branch will be maintained until February 2026.

Features Implemented

  • Wi-Fi / ML307 Cat.1 4G
  • Offline voice wake-up ESP-SR
  • Supports two communication protocols (Websocket or MQTT+UDP)
  • Uses OPUS audio codec
  • Voice interaction based on streaming ASR + LLM + TTS architecture
  • Speaker recognition, identifies the current speaker 3D Speaker
  • OLED / LCD display, supports emoji display
  • Battery display and power management
  • Multi-language support (Chinese, English, Japanese)
  • Supports ESP32-C3, ESP32-S3, ESP32-P4 chip platforms
  • Device-side MCP for device control (Speaker, LED, Servo, GPIO, etc.)
  • Cloud-side MCP to extend large model capabilities (smart home control, PC desktop operation, knowledge search, email, etc.)
  • Customizable wake words, fonts, emojis, and chat backgrounds with online web-based editing (Custom Assets Generator)

Hardware

Breadboard DIY Practice

See the Feishu document tutorial:

👉 "XiaoZhi AI Chatbot Encyclopedia"

Breadboard demo:

Breadboard Demo

Supports 70+ Open Source Hardware (Partial List)

  • <a href="https://oshwhub.com/li-chuang-kai-fa-ban/li-chuang-shi-zhan-pai-esp32-s3-kai-fa-ban" target="_blank" title="LiChuang ESP32-S3 Development Board">LiChuang ESP32-S3 Development Board</a>
  • <a href="https://github.com/espressif/esp-box" target="_blank" title="Espressif ESP32-S3-BOX3">Espressif ESP32-S3-BOX3</a>
  • <a href="https://docs.m5stack.com/zh_CN/core/CoreS3" target="_blank" title="M5Stack CoreS3">M5Stack CoreS3</a>
  • <a href="https://docs.m5stack.com/en/atom/Atomic%20Echo%20Base" target="_blank" title="AtomS3R + Echo Base">M5Stack AtomS3R + Echo Base</a>
  • <a href="https://gf.bilibili.com/item/detail/1108782064" target="_blank" title="Magic Button 2.4">Magic Button 2.4</a>
  • <a href="https://www.waveshare.net/shop/ESP32-S3-Touch-AMOLED-1.8.htm" target="_blank" title="Waveshare ESP32-S3-Touch-AMOLED-1.8">Waveshare ESP32-S3-Touch-AMOLED-1.8</a>
  • <a href="https://github.com/Xinyuan-LilyGO/T-Circle-S3" target="_blank" title="LILYGO T-Circle-S3">LILYGO T-Circle-S3</a>
  • <a href="https://oshwhub.com/tenclass01/xmini_c3" target="_blank" title="XiaGe Mini C3">XiaGe Mini C3</a>
  • <a href="https://oshwhub.com/movecall/cuican-ai-pendant-lights-up-y" target="_blank" title="Movecall CuiCan ESP32S3">CuiCan AI Pendant</a>
  • <a href="https://github.com/WMnologo/xingzhi-ai" target="_blank" title="WMnologo-Xingzhi-1.54">WMnologo-Xingzhi-1.54TFT</a>
  • <a href="https://www.seeedstudio.com/SenseCAP-Watcher-W1-A-p-5979.html" target="_blank" title="SenseCAP Watcher">SenseCAP Watcher</a>
  • <a href="https://www.bilibili.com/video/BV1BHJtz6E2S/" target="_blank" title="ESP-HI Low Cost Robot Dog">ESP-HI Low Cost Robot Dog</a>
<div style="display: flex; justify-content: space-between;"> <a href="docs/v1/lichuang-s3.jpg" target="_blank" title="LiChuang ESP32-S3 Development Board"> <img src="docs/v1/lichuang-s3.jpg" width="240" /> </a> <a href="docs/v1/espbox3.jpg" target="_blank" title="Espressif ESP32-S3-BOX3"> <img src="docs/v1/espbox3.jpg" width="240" /> </a> <a href="docs/v1/m5cores3.jpg" target="_blank" title="M5Stack CoreS3"> <img src="docs/v1/m5cores3.jpg" width="240" /> </a> <a href="docs/v1/atoms3r.jpg" target="_blank" title="AtomS3R + Echo Base"> <img src="docs/v1/atoms3r.jpg" width="240" /> </a> <a href="docs/v1/magiclick.jpg" target="_blank" title="Magic Button 2.4"> <img src="docs/v1/magiclick.jpg" width="240" /> </a> <a href="docs/v1/waveshare.jpg" target="_blank" title="Waveshare ESP32-S3-Touch-AMOLED-1.8"> <img src="docs/v1/waveshare.jpg" width="240" /> </a> <a href="docs/v1/lilygo-t-circle-s3.jpg" target="_blank" title="LILYGO T-Circle-S3"> <img src="docs/v1/lilygo-t-circle-s3.jpg" width="240" /> </a> <a href="docs/v1/xmini-c3.jpg" target="_blank" title="XiaGe Mini C3"> <img src="docs/v1/xmini-c3.jpg" width="240" /> </a> <a href="docs/v1/movecall-cuican-esp32s3.jpg" target="_blank" title="CuiCan"> <img src="docs/v1/movecall-cuican-esp32s3.jpg" width="240" /> </a> <a href="docs/v1/wmnologo_xingzhi_1.54.jpg" target="_blank" title="WMnologo-Xingzhi-1.54"> <img src="docs/v1/wmnologo_xingzhi_1.54.jpg" width="240" /> </a> <a href="docs/v1/sensecap_watcher.jpg" target="_blank" title="SenseCAP Watcher"> <img src="docs/v1/sensecap_watcher.jpg" width="240" /> </a> <a href="docs/v1/esp-hi.jpg" target="_blank" title="ESP-HI Low Cost Robot Dog"> <img src="docs/v1/esp-hi.jpg" width="240" /> </a> </div>

Software

Firmware Flashing

For beginners, it is recommended to use the firmware that can be flashed without setting up a development environment.

The firmware connects to the official xiaozhi.me server by default. Personal users can register an account to use the Qwen real-time model for free.

👉 Beginner's Firmware Flashing Guide

Development Environment

  • Cursor or VSCode
  • Install ESP-IDF plugin, select SDK version 5.4 or above
  • Linux is better than Windows for faster compilation and fewer driver issues
  • This project uses Google C++ code style, please ensure compliance when submitting code

Developer Documentation

Large Model Configuration

If you already have a XiaoZhi AI chatbot device and have connected to the official server, you can log in to the xiaozhi.me console for configuration.

👉 Backend Operation Video Tutorial (Old Interface)

Related Open Source Projects

For server deployment on personal computers, refer to the following open-source projects:

Other client projects using the XiaoZhi communication protocol:

Custom Assets Tools:

About the Project

This is an open-source ESP32 project, released under the MIT license, allowing anyone to use it for free, including for commercial purposes.

We hope this project helps everyone understand AI hardware development and apply rapidly evolving large language models to real hardware devices.

If you have any ideas or suggestions, please feel free to raise Issues or join our Discord or QQ group: 994694848

Star History

<a href="https://star-history.com/#78/xiaozhi-esp32&Date"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=78/xiaozhi-esp32&type=Date&theme=dark" /> <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=78/xiaozhi-esp32&type=Date" /> <img alt="Star History Chart" src="https://api.star-history.com/svg?repos=78/xiaozhi-esp32&type=Date" /> </picture> </a>