Skip to content

itsme-mabz/clewmind

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ClewMind

An OpenSource AI agent that speaks your language. Memory that's shared.

Send a voice note in Urdu, Hindi, or Arabic — your whole family or team benefits. Open source, self-hosted, free to run.


What Makes ClewMind Different

Feature ClewMind ChatGPT Discord bots Hermes Agent
Voice-first (hold to speak)
Shared team memory Partial
Non-English native ✅ Urdu/Arabic/Hindi English-first English-first English-first
Works on WhatsApp
Self-hosted, no subscription Partial
Mobile-first web UI Partial

ClewMind is built for families and small teams who communicate in non-English languages on WhatsApp — not for English-speaking developers with Slack.


Quick Start

git clone https://github.com/yourname/clewmind
cd clewmind
bash setup.sh

Then edit .env:

GROQ_API_KEY=your_key_here   # free at console.groq.com
npm run dev
# → http://localhost:3000

That's it. The web UI works immediately — no other config needed.

Add Discord

  1. Create a bot at discord.dev/applications
  2. Copy the token to .env:
    DISCORD_BOT_TOKEN=your_token_here
  3. Restart — ClewMind joins Discord automatically.

Add WhatsApp

WHATSAPP_SESSION_NAME=clewmind

Restart and scan the QR code printed in the terminal with your phone.


How Shared Memory Works

This is ClewMind's core feature. Memory is per-team, not per-user.

🗣️  Ahmed (voice note in Urdu):
    "Kal Lahore jana hai train se"

🧠  ClewMind:
    "Noted! I'll remember your Lahore trip tomorrow by train."

— later —

🗣️  Ammi: "Ahmed ka koi plan hai kal ka?"

🧠  ClewMind:
    "Ji! Ahmed ne bola tha ke kal Lahore ja rahe hain train se."

Every fact is extracted automatically — no /save command needed. Facts are scoped to the team (Discord server, WhatsApp group, or web session), so anyone in the team can ask about anything anyone else has mentioned.


Supported Languages

ClewMind detects language automatically and replies in kind.

Language Code STT TTS
🇵🇰 Urdu ur
🇸🇦 Arabic ar
🇮🇳 Hindi hi
🇧🇩 Bengali bn
🇮🇩 Indonesian id
🇹🇷 Turkish tr
🇨🇳 Chinese zh
🇪🇸 Spanish es
🇵🇹 Portuguese pt
🇫🇷 French fr
🇩🇪 German de
🇮🇹 Italian it
🇷🇺 Russian ru
🇯🇵 Japanese ja
🇬🇧 English en

STT via Groq Whisper · TTS via Microsoft edge-tts (free, no key)


Architecture

┌─────────────────────────────────────────────────────────────┐
│  Channels                                                   │
│  ┌──────────┐  ┌─────────────┐  ┌────────────────────────┐ │
│  │ WhatsApp │  │   Discord   │  │  Web (Express + WS)    │ │
│  └────┬─────┘  └──────┬──────┘  └───────────┬────────────┘ │
│       └───────────────┴──────────────────────┘             │
│                        │ IncomingMessage                    │
│                   ┌────▼──────────────────┐                 │
│                   │       Engine          │                 │
│                   │  1. Commands (/help)  │                 │
│                   │  2. STT (Whisper)     │                 │
│                   │  3. Skills router     │                 │
│                   │  4. Memory context    │                 │
│                   │  5. LLM (Groq)        │                 │
│                   │  6. Fact extraction   │                 │
│                   │  7. TTS (edge-tts)    │                 │
│                   └────────────────────┬─┘                 │
│                                        │ OutgoingMessage   │
│  ┌─────────────────────────────────────▼──────────────────┐│
│  │  Core                                                  ││
│  │  memory.ts · llm.ts · voice.ts                        ││
│  └────────────────────────────────────────────────────────┘│
└─────────────────────────────────────────────────────────────┘

Message flow: Channel → Engine → (skill OR LLM) → async fact extract → (TTS?) → reply


Skills

Three skills ship out of the box:

Skill Triggers Example
Reminders remind me, in 2 hours, kal subah, at 5pm "remind me to call Ali in 30 minutes"
Notes note:, save this, shopping list, yaad rakhna "note: server password is abc123"
Web Search search for, who is, google, dhoondho "who is the president of Pakistan"

Build a Custom Skill

import type { Skill, SkillContext } from '../types.js'

export const WeatherSkill: Skill = {
  name: 'weather',
  description: 'Get current weather for a city',

  canHandle(message: string): boolean {
    return /\bweather\b/i.test(message) || message.includes('barish')
  },

  async execute(message: string, ctx: SkillContext): Promise<string> {
    const city = extractCity(message)
    const data  = await fetchWeather(city)
    return `${city}: ${data.temp}°C, ${data.description}`
  },
}

Register it in src/core/engine.tsloadSkills().


Commands

Command Description
/start Welcome message
/help List all commands
/memory Show team memories
/forget <text> Delete matching memories
/team List team members
/private <msg> Chat without saving to memory
/name <name> Change your display name

Environment Variables

Variable Required Default Description
GROQ_API_KEY Yes LLM + Whisper STT (get free)
OPENROUTER_API_KEY No Fallback LLM provider
DISCORD_BOT_TOKEN No Enables Discord channel
WHATSAPP_SESSION_NAME No Enables WhatsApp channel
DEFAULT_LANGUAGE No en Fallback language code
VOICE_ENABLED No true Set false to disable TTS
DATA_DIR No ./data Where to store memory/notes/reminders
WEB_PORT No 3000 Web UI port

Roadmap

  • Web chat UI with voice recording
  • WhatsApp + Discord channels
  • Shared team memory with auto-extraction
  • Reminders, Notes, Web Search skills
  • Multilingual STT + TTS (15 languages)
  • Persistent reminder restore on server restart
  • WhatsApp group mention (@clewmind)
  • Telegram channel
  • Image understanding (describe photos in voice)
  • Skill marketplace / plugin install via npm
  • Multi-team isolation with invite codes
  • Admin dashboard for memory management

Contributing

PRs welcome. High-priority areas:

  • New channels — Telegram, SMS (Twilio), email
  • New skills — Weather, currency converter, prayer times
  • Language support — More TTS voices, RTL UI fixes
  • Tests — Integration tests for the engine pipeline
git clone https://github.com/yourname/clewmind
cd clewmind && bash setup.sh
npm run dev

File structure is intentionally flat — each file has one job. Read src/types.ts first to understand the data model, then src/core/engine.ts for the message pipeline.


License

MIT © 2025 — free to use, modify, and self-host.

About

The AI agent that speaks your language. Memory that's shared.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors