A personal AI assistant inspired by OpenClaw's architecture — running on your always-on PC, chatting via Discord, managing your Google Calendar, and growing its own skills over time.
- 🤖 Discord Bot — Chat with Claude via Discord (owner-only security)
- 🧠 OpenClaw-Style Memory — Markdown files as source of truth with hybrid BM25 + vector search
- 📅 Google Calendar Integration — View, create, update, and delete events
- 🔄 Context Compaction — Pre-compaction memory flush prevents data loss in long sessions
- 🎭 Personality System —
SOUL.mdandIDENTITY.mdfiles that evolve over time - 🛠️ Skill Builder — Meta-tool that lets the AI create its own tools collaboratively
- 🔍 Hybrid Memory Search — SQLite FTS5 (BM25) + optional vector embeddings via Voyage AI
MiniClaw uses Markdown files as the source of truth for memory:
- MEMORY.md — Curated long-term facts and preferences
- memory/daily/ — Running daily logs (append-only)
- SQLite index for fast hybrid search (BM25 + vector)
- Skills are isolated project folders with their own code and data
- Node.js 20+ — Download here
- Python 3 + Visual Studio Build Tools (for better-sqlite3 native compilation on Windows)
- Install with:
npm install --global windows-build-tools(run as administrator) - OR have Python 3 and VS Build Tools already installed
- Install with:
- Anthropic API Key — Get one here
- Discord Bot Token — See Discord setup below
- Google Calendar Credentials — See Google setup below
- Voyage AI API Key (optional) — Get one here for vector embeddings
cd C:\Users\Rob\Desktop\MiniClaw
npm installNote:
better-sqlite3requires native compilation. If the install fails with build errors, you need to install Windows build tools first:npm install --global windows-build-toolsRun this in an administrator terminal, then try
npm installagain.
Copy .env.example to .env and fill in your credentials:
copy .env.example .envEdit .env with your API keys (see setup guides below).
- Go to discord.com/developers/applications
- Click "New Application" — name it "MiniClaw" (or whatever you want)
- Go to the Bot tab → Click "Reset Token" → Copy the token
- Paste the token as
DISCORD_TOKENin your.envfile
- Under Privileged Gateway Intents, enable:
- ✅ Message Content Intent (required to read messages)
- ✅ Server Members Intent (optional but useful)
- Go to OAuth2 → URL Generator:
- Scopes:
bot - Permissions:
Send Messages,Read Message History,Embed Links,Attach Files
- Scopes:
- Copy the generated URL and open it in your browser to invite the bot to your server
- In Discord, go to Settings → Advanced → Developer Mode (turn it on)
- Right-click your username anywhere → Copy User ID
- Paste it as
DISCORD_OWNER_IDin your.env
Security: The bot will ONLY respond to messages from this user ID. Everyone else is ignored.
- Create a new Discord server (just for you and the bot)
- Invite the bot using the OAuth2 URL from Step 2
- Go to console.cloud.google.com
- Click the project dropdown → "New Project"
- Name: "MiniClaw Calendar" → Click Create
- Make sure the new project is selected
- Go to APIs & Services → Library
- Search for "Google Calendar API" → Click it → Click "Enable"
- Go to APIs & Services → OAuth consent screen
- Select "External" user type → Click Create
- Fill in:
- App name: MiniClaw
- User support email: your email
- Developer contact: your email
- Click Save and Continue through Scopes (skip for now)
- On Test users page, click "Add Users" → add your Gmail address
- Click Save and Continue
Note: The app stays in "Testing" mode (unpublished). This is fine for personal use.
- Go to APIs & Services → Credentials
- Click "Create Credentials" → "OAuth client ID"
- Application type: "Web application"
- Name: "MiniClaw"
- Under Authorized redirect URIs, add:
http://localhost:3000/oauth2callback - Click Create
- Copy Client ID and Client Secret → paste into your
.env
npm run auth- Open the URL it prints in your browser
- Sign in with your Google account
- Click Continue when you see "This app isn't verified" (it's your own app)
- Grant calendar access
- You'll see "Success!" —
google-tokens.jsonis now saved
Important: Add
google-tokens.jsonto.gitignore(already done)
npm startYou should see:
=== MiniClaw Starting ===
[Calendar] Initialized with saved tokens
[MemoryIndex] SQLite hybrid search initialized
[Discord] Logged in as MiniClaw#1234
=== MiniClaw Ready ===
Once the bot is running, try these in your Discord server:
hello, who are you?
remember that my main Godot project uses chunk-based terrain with biome rings
what do you know about my Godot project?
what's on my calendar this week?
add a dentist appointment next Tuesday at 2pm for 1 hour
let's build a shopping list manager
add milk, bread, and eggs to my shopping list
!model claude-haiku-4-5-20251001
what model are you using now?
!model claude-sonnet-4-5-20250929
update your identity file — pick a name and emoji you like
| Command | Description |
|---|---|
!model |
Show current model |
!model <model-id> |
Switch to a different model |
!ping |
Check bot latency |
!reindex |
Rebuild memory search index |
!clear |
Clear conversation history for this channel |
!help |
Show help message |
claude-sonnet-4-5-20250929— Sonnet 4.5 (balanced, default)claude-haiku-4-5-20251001— Haiku 4.5 (fast & cheap)claude-opus-4-5-20250929— Opus 4.5 (most capable)
MiniClaw uses a two-layer memory system inspired by OpenClaw:
- MEMORY.md — Curated long-term facts, preferences, decisions
- Daily Logs (
memory/daily/YYYY-MM-DD.md) — Running notes, append-only
Hybrid Search combines:
- BM25 (keyword) via SQLite FTS5 — finds exact terms
- Vector search via Voyage AI embeddings — finds semantic matches
- Reciprocal Rank Fusion (RRF) — merges results from both methods
Graceful degradation: If Voyage AI is unavailable (no API key or error), falls back to keyword-only search.
Long conversations trigger automatic context management:
-
Soft threshold (~176K tokens) — Silent memory flush
- Claude writes important context to disk before compaction
- User sees nothing (transparent checkpoint)
-
Hard threshold (~180K tokens) — Compaction
- Older messages summarized by fallback model (cheaper)
- Summary + recent messages = new conversation history
- Memory index re-indexed
This means compaction becomes a checkpoint, not data loss.
The skill_builder tool lets you collaboratively build new tools with the AI:
- AI creates project scaffold in
skills/<name>/ - Writes
SKILL.md(instructions),handler.js(code),PROGRESS.md(dev log) - Skill auto-loads on next restart
- Can iterate on skills across sessions (read/update project files)
Each skill is an isolated folder with:
SKILL.md— Instructions for when/how to use this skillhandler.js— Executable logic (exportstoolDefinition+execute)PROGRESS.md— Development notes (tracked across sessions)data/— Persistent data for this skill (e.g., JSON files)
Edit config.json to adjust:
- Model settings — Primary/fallback models, token limits
- Memory settings — Days of logs to load, search result count
- Compaction settings — Token thresholds, memory flush behavior
- Embedding settings — Vector model, chunk size/overlap
You need Windows build tools:
npm install --global windows-build-toolsRun as administrator, then retry npm install.
Run the authorization flow:
npm run authMake sure you complete the browser flow and see "Success!"
This is expected if you don't have a VOYAGE_API_KEY. The system gracefully degrades to keyword-only BM25 search, which works fine for personal use.
To enable vector search, get a free API key from voyageai.com and add it to .env.
- Check that
DISCORD_OWNER_IDin.envmatches your Discord user ID - Make sure Message Content Intent is enabled in Discord Developer Portal
- Check the console for error messages
Make sure you have "type": "module" in package.json (should be there by default).
✅ What's secure:
- Bot only responds to your Discord user ID (owner-only)
- API keys in
.env(never committed) - Google tokens stored locally (never committed)
- Keep your Discord server private (don't invite others)
- Set an Anthropic spending limit in your dashboard
- Review custom skill code before running it (has full file system access)
- Never commit
.envorgoogle-tokens.jsonto git
Your AI's personality lives in SOUL.md and IDENTITY.md. During your first conversation, ask it to fill in its identity. Over time, you can ask it to update these files — it will always tell you when it does.
The vector search currently uses Voyage AI's cloud API. To go fully offline, swap in local embeddings using @xenova/transformers:
npm install @xenova/transformersThis would run a GGUF model locally (~1GB download on first use). Ask the AI: "let's upgrade memory embeddings to use local transformers."
- Shopping list manager — Add/remove/view items
- Daily briefing — Morning summary sent via Discord
- Reminder system — Set reminders, check on timer
- Project notes — Per-project context files
- URL bookmarks — Save and categorize links
- Expense tracker — Log purchases, weekly summaries
MiniClaw/
├── .env # API keys (never commit)
├── config.json # Model, memory, compaction settings
├── package.json
├── SOUL.md # Personality, boundaries, tone
├── IDENTITY.md # Name, creature type, vibe, emoji
├── src/
│ ├── index.js # Entry point
│ ├── claude.js # Anthropic API client + tool loop
│ ├── discord.js # Discord bot
│ ├── memory.js # Markdown memory (read/write/search)
│ ├── memory-index.js # Hybrid BM25 + vector search
│ ├── compaction.js # Context compaction + memory flush
│ ├── calendar.js # Google Calendar OAuth2 + API
│ ├── tools.js # Tool registry (built-in + custom)
│ └── skill-builder.js # Meta-tool for creating skills
├── memory/
│ ├── MEMORY.md # Curated long-term memory
│ └── daily/ # Daily logs (one per day)
├── data/
│ └── memory-index.sqlite # SQLite DB for hybrid search
├── skills/ # Custom skill projects
│ └── shopping-list/ # Example skill
│ ├── SKILL.md
│ ├── handler.js
│ ├── PROGRESS.md
│ └── data/
├── google-tokens.json # OAuth2 tokens (auto-generated)
└── auth-server.js # One-time OAuth2 setup script
MIT
Built with inspiration from OpenClaw
Start simple, build skills as you need them, and it'll grow into exactly the assistant you want.