How chfly2024/mimiclaw works
MimiClaw is an ESP32-S3 AI assistant. Its main workflow takes messages from Telegram or Feishu over WiFi, places them on a message bus, runs an agent loop that builds context and calls an LLM and tools, then dispatches replies back to the originating channel. Local memory and sessions, scheduling, skills, setup, and administration support that workflow. Relationships are based on the README, the shown application entry point, and SOURCE INDEX references; unsampled tool implementations are represented at their enclosing directory where appropriate.
Main entry points: message_bus.c Message Bus · mimi.c ESP32 Device · agent_loop.c Agent Loop · serial_cli.c Serial CLI
Components 23
Connectivity
- Telegram Bot
main/channels/telegram/telegram_bot.c - Feishu Bot
main/channels/feishu/feishu_bot.c - WiFi Manager
main/wifi/wifi_manager.c - WebSocket Gateway
main/gateway/ws_server.c - HTTP Proxy
main/proxy/http_proxy.c
Assistant Runtime
- Message Bus
main/bus/message_bus.c - Agent Loop
main/agent/agent_loop.c - Context Builder
main/agent/context_builder.c - LLM Proxy
main/llm/llm_proxy.c - Session Manager
main/memory/session_mgr.c - Memory Store
main/memory/memory_store.c
Assistant Capabilities
- Tool Registry
main/tools/tool_registry.c - Web Search
main/tools/tool_web_search.c - Device Tools
main/tools - Skills
main/skills/skill_loader.c - Cron Service
main/cron/cron_service.c - Heartbeat
main/heartbeat/heartbeat.c
Device Operations
- Serial CLI
main/cli/serial_cli.c - WiFi Onboarding
main/onboard/wifi_onboard.c - ESP32 Device
main/mimi.c
Other components
- User
- Anthropic / OpenAI
- Search APIs
Connections 37
- User → Telegram Bot: sends message
README.md - Telegram Bot → Message Bus: queues inbound
main/channels/telegram/telegram_bot.c - User → Feishu Bot: sends message
README.md - Feishu Bot → Message Bus: queues inbound
main/channels/feishu/feishu_bot.c - Message Bus → Agent Loop: delivers inbound
main/agent/agent_loop.c - Agent Loop → Context Builder: builds context
main/agent/agent_loop.c - Agent Loop → Session Manager: loads history
main/agent/agent_loop.c - Agent Loop → LLM Proxy: requests completion
main/agent/agent_loop.c - Agent Loop → Tool Registry: dispatches tools
main/agent/agent_loop.c - Agent Loop → Message Bus: queues reply
main/agent/agent_loop.c - Context Builder → Memory Store: reads memory
main/agent/context_builder.c - Context Builder → Skills: includes skills
main/agent/context_builder.c - LLM Proxy → Anthropic / OpenAI: calls API
README.md - Tool Registry → Web Search: dispatches search
- Tool Registry → Device Tools: dispatches tools
- Web Search → Search APIs: queries provider
- Cron Service → Message Bus: queues due jobs
main/cron/cron_service.c - Heartbeat → Message Bus: queues checks
main/heartbeat/heartbeat.c - Message Bus → Telegram Bot: routes reply
- Message Bus → Feishu Bot: routes reply
- Message Bus → WebSocket Gateway: routes reply
- WebSocket Gateway → Message Bus: queues inbound
main/gateway/ws_server.c - Serial CLI → Session Manager: manages sessions
main/cli/serial_cli.c - Serial CLI → Memory Store: reads and writes
main/cli/serial_cli.c - Serial CLI → Cron Service: starts scheduler
main/cli/serial_cli.c - Serial CLI → WiFi Manager: sets credentials
main/cli/serial_cli.c - WiFi Onboarding → WiFi Manager: configures network
main/onboard/wifi_onboard.c - Telegram Bot → HTTP Proxy: uses HTTPS proxy
main/channels/telegram/telegram_bot.c - Feishu Bot → HTTP Proxy: uses HTTPS proxy
main/channels/feishu/feishu_bot.c - LLM Proxy → HTTP Proxy: uses HTTPS proxy
main/llm/llm_proxy.c - ESP32 Device → WiFi Manager: initializes and starts
main/mimi.c - ESP32 Device → WiFi Onboarding: starts setup portal
main/mimi.c - ESP32 Device → Message Bus: initializes queues
main/mimi.c - ESP32 Device → Agent Loop: starts agent
main/mimi.c - ESP32 Device → Serial CLI: starts console
main/mimi.c - ESP32 Device → Cron Service: starts scheduler
main/mimi.c - ESP32 Device → Heartbeat: starts heartbeat
main/mimi.c