Skip to content

coloz/MimiClaw

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MimiClaw - ESP32-S3 AI Agent Arduino Library

An Arduino library for running MimiClaw AI Agent on ESP32-S3 with PSRAM.

Features

  • ReAct Agent Loop — Autonomous AI agent with tool calling (up to 10 iterations)
  • Dual LLM Support — Anthropic Claude and OpenAI GPT models
  • Telegram Bot — Long-polling Telegram bot integration
  • WebSocket Server — Real-time communication gateway
  • Persistent Memory — SPIFFS-based long-term memory and daily notes
  • Session Management — Per-chat conversation history (JSONL)
  • 9 Built-in Tools — Web search, file I/O, time, cron scheduling
  • Skill System — Extensible skill files loaded from SPIFFS
  • Cron Scheduler — Recurring and one-shot scheduled tasks
  • Heartbeat — Periodic HEARTBEAT.md file checking
  • HTTP/SOCKS5 Proxy — Optional proxy support for all API calls

Hardware Requirements

  • ESP32-S3 board with PSRAM (recommended: 8MB+ PSRAM, 16MB flash)
  • WiFi connectivity

Dependencies

Install via Arduino Library Manager:

  • ArduinoJson v7.0+ by Benoit Blanchon
  • WebSockets v2.4+ by Markus Sattler (links2004)

Quick Start

  1. Install the library (copy MimiClaw folder to Arduino libraries/)
  2. Install dependencies (ArduinoJson, WebSockets)
  3. Upload data/ folder to SPIFFS using "ESP32 Sketch Data Upload"
  4. Open Examples > MimiClaw > BasicAgent
  5. Set your WiFi, Telegram, and API credentials
  6. Upload to your ESP32-S3 board

Board Settings (Arduino IDE)

Setting Value
Board ESP32S3 Dev Module
PSRAM OPI PSRAM
Flash Size 16MB (128Mb)
Partition Scheme Default with large SPIFFS

API Reference

#include <MimiClaw.h>

MimiClaw mimi;

// Setup
mimi.begin();                            // Initialize all subsystems
mimi.setWiFi("SSID", "PASSWORD");       // WiFi credentials
mimi.setTelegramToken("BOT_TOKEN");     // Telegram bot token
mimi.setApiKey("API_KEY");              // LLM API key
mimi.setModelProvider("anthropic");     // "anthropic" or "openai"
mimi.setModel("claude-opus-4-5"); // Model name
mimi.setSearchKey("BRAVE_KEY");         // Brave Search API key
mimi.setTimezone("CST-8");             // POSIX timezone
mimi.setProxy("host", 8080, "http");   // HTTP/SOCKS5 proxy
mimi.start();                           // Start all services

// Loop
mimi.loop();                            // Call in loop()

// Access subsystems
mimi.memory();   // MimiMemory — read/write persistent memory
mimi.session();  // MimiSession — conversation history
mimi.tools();    // MimiToolRegistry — register custom tools
mimi.cron();     // MimiCron — manage scheduled jobs

Custom Tools

bool myToolExecute(const char* input_json, char* output, size_t output_size) {
    // Parse input_json, do work, write result to output
    snprintf(output, output_size, "Tool result here");
    return true;
}

MimiTool myTool = {
    .name = "my_tool",
    .description = "Description of what this tool does",
    .input_schema_json = "{\"type\":\"object\",\"properties\":{\"param\":{\"type\":\"string\"}},\"required\":[\"param\"]}",
    .execute = myToolExecute
};

mimi.tools().registerTool(&myTool);

Architecture

┌──────────────────────────────────────────────┐
│                  MimiClaw                     │
│                                               │
│  ┌─────────┐   ┌──────┐   ┌───────────────┐ │
│  │Telegram │──>│      │──>│ Agent Loop     │ │
│  │Bot      │   │ Bus  │   │ (ReAct)       │ │
│  └─────────┘   │      │   │               │ │
│  ┌─────────┐   │ In   │   │ System Prompt │ │
│  │WebSocket│──>│  +   │   │ + LLM Call    │ │
│  │Server   │   │ Out  │   │ + Tool Exec   │ │
│  └─────────┘   │      │   │ + Session     │ │
│  ┌─────────┐   │      │<──│               │ │
│  │Cron     │──>│      │   └───────────────┘ │
│  │Heartbeat│   └──────┘                      │
│  └─────────┘                                 │
│                                               │
│  Storage: SPIFFS (memory, sessions, skills)  │
│  LLM: Anthropic / OpenAI via HTTPS           │
└──────────────────────────────────────────────┘

SPIFFS Data Structure

Upload the data/ folder to SPIFFS:

/spiffs/
  config/
    SOUL.md          — AI personality definition
    USER.md          — User info (auto-populated)
  memory/
    MEMORY.md        — Long-term persistent memory
    daily/           — Daily notes (auto-created)
  sessions/          — Chat session files (auto-created)
  skills/            — Skill files (auto-created)
  cron.json          — Scheduled jobs (auto-created)

License

MIT — See original MimiClaw project.

About

MimiClaw for Arduino/ESP32S3

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors