Getting Started with MimicLaw
Prerequisites
- Hardware: ESP32-S3 board with 16MB Flash + 8MB PSRAM (e.g., Xiaozhi AI Board ~$10)
- Software: ESP-IDF v5.5+ or esptool.py (for pre-built firmware)
- Accounts: Anthropic API key, Telegram Bot Token (via @BotFather)
- Optional: Brave Search API key (for
web_searchtool), HTTP proxy (for restricted networks)
Option A: Flash pre-built firmware
Download the latest release from GitHub Releases:
Then configure via serial CLI (see Configuration below).
Option B: Build from source
Build-time secrets (mimi_secrets.h)
Configuration
After flashing, connect to the serial CLI (115200 baud):
Essential commands
Optional commands
Diagnostics
Two-layer configuration
MimicLaw uses a two-layer config system:
- Build-time (
mimi_secrets.h): Compiled into firmware. Convenient for personal builds. - Runtime NVS (via CLI): Stored in flash, survives reboots. Overrides build-time values.
The config_show command indicates the source of each value:
First conversation
- Open Telegram and find your bot (the one you created via @BotFather)
- Send any message
- The device serial output shows the agent processing
- Response appears in Telegram
You can also connect via WebSocket on ws://<device-ip>:18789:
Memory and personality
MimicLaw loads three files from SPIFFS flash at startup:
The agent is instructed to proactively save important information to MEMORY.md and daily notes (/spiffs/memory/daily/YYYY-MM-DD.md) using its file tools. You don't need to ask it to remember — it does so autonomously.
Firmware updates (OTA)
MimicLaw uses dual OTA partitions (ota_0 + ota_1). The ota_manager module wraps ESP-IDF's esp_https_ota() for over-the-air updates from a URL. The device automatically reboots after a successful update.