Package Exports
- alvin-bot
- alvin-bot/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (alvin-bot) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
π€ Alvin Bot β Autonomous AI Agent
Your personal AI assistant β on Telegram, WhatsApp, Discord, Signal, Terminal, and Web.
Alvin Bot is an open-source, self-hosted AI agent that lives where you chat. Built on a multi-model engine with full system access, memory, plugins, and a rich web dashboard. Not just a chatbot β an autonomous agent that remembers, acts, and learns.
πΈ Preview
π¬ Chat (Dark Mode)![]() |
π Dashboard![]() |
π€ AI Models & Providers![]() |
π Personality Editor![]() |
π¬ Telegram![]() |
π± Messaging Platforms![]() |
π§ Custom Tools![]() |
π©Ί Health & Maintenance![]() |
πΌοΈ More Screenshots (click to expand)
| Feature | Screenshot |
|---|---|
| Login | ![]() |
| Chat (Light) | ![]() |
| Memory Manager | ![]() |
| Active Sessions | ![]() |
| File Browser | ![]() |
| Scheduled Jobs | ![]() |
| Plugins & MCP | ![]() |
| WhatsApp Groups | ![]() |
| WA Group Details | ![]() |
| User Management | ![]() |
| Web Terminal | ![]() |
| Settings & Env | ![]() |
| Telegram Commands | ![]() |
| macOS Installer | ![]() |
β¨ Features
π§ Intelligence
- Multi-Model Engine β Claude (Agent SDK with full tool use), OpenAI, Groq, NVIDIA NIM, Google Gemini, OpenRouter, or any OpenAI-compatible API
- Automatic Fallback β If one provider fails, seamlessly tries the next
- Heartbeat Monitor β Pings providers every 5 minutes, auto-failover after 2 failures, auto-recovery
- User-Configurable Fallback Order β Rearrange provider priority via Telegram (
/fallback), Web UI, or API - Adjustable Thinking β From quick answers (
/effort low) to deep analysis (/effort max) - Persistent Memory β Remembers across sessions via vector-indexed knowledge base; session state (Claude SDK resume tokens, conversation history, language, effort) survives bot restarts (v4.11.0)
- Multi-Session Workspaces β Run multiple parallel, context-isolated sessions on the same bot β one per Slack channel or per Telegram
/workspaceβ each with its own working directory, purpose, and persona. Memory, skills, and sub-agents stay globally shared (v4.12.0). How-to β - Background Sub-Agents β Claude autonomously uses
run_in_background: truefor long audits/research; main session stays responsive, results deliver as separate messages (v4.10.0) - Smart Tool Discovery β Scans your system at startup, knows exactly what CLI tools, plugins, and APIs are available
- Skill System β 12 built-in SKILL.md files (code, data analysis, email, docs, research, sysadmin, browse, etc.) auto-activate based on message context
- Self-Awareness β Knows it IS the AI model β won't call external APIs for tasks it can do itself
- Automatic Language Detection β Detects user language (EN/DE/ES/FR) and adapts; learns preference over time
π¬ Multi-Platform
- Telegram β Full-featured with streaming, inline keyboards, voice, photos, documents
- Slack β Socket Mode bot via
@slack/bolt, DMs + @mentions, file attachments, reactions,assistant.threads.setStatustyping indicator. One channel = one isolated workspace. See Multi-Session Workspaces below. - WhatsApp β Via WhatsApp Web: self-chat as AI notepad, group whitelist with per-contact access control, full media support (photos, docs, audio, video)
- WhatsApp Group Approval β Owner gets approval requests via Telegram (or WhatsApp DM fallback) before the bot responds to group messages. Silent β group members see nothing.
- Discord β Server bot with mention/reply detection, slash commands
- Signal β Via signal-cli REST API with voice transcription
- Terminal β Rich TUI with ANSI colors and streaming (
alvin-bot tui) - Web UI β Full dashboard with chat, settings, file manager, terminal, workspace overview
π§ Capabilities
- 52+ Built-in Tools β Shell, files, email, screenshots, PDF, media, git, system control
- Plugin System β 6 built-in plugins (weather, finance, notes, calendar, email, smarthome)
- MCP Client β Connect any Model Context Protocol server
- Cron Jobs β Scheduled tasks with AI-driven creation ("check my email every morning")
- Voice β Speech-to-text (Groq Whisper) + text-to-speech (Edge TTS)
- Vision β Photo analysis, document scanning, screenshot understanding
- Image Generation β Via Google Gemini / DALLΒ·E (with API key)
- Web Browsing β Fetch and summarize web pages
π₯οΈ Web Dashboard
- Live Chat β WebSocket streaming, same experience as Telegram
- Model Switcher β Change AI models on the fly
- Platform Setup β Configure all messengers and providers via UI, WhatsApp group management inline
- File Manager β Browse, edit, create files in the working directory
- Memory Editor β View and edit the agent's knowledge base
- Session Browser β Inspect conversation history
- Terminal β Run commands directly from the browser
- Maintenance β Health checks, backups, bot controls
π Quick Start
npm install -g alvin-bot
alvin-bot setup
alvin-bot startThat's it. The setup wizard validates everything:
- β Tests your AI provider key
- β Verifies your Telegram bot token
- β Confirms the setup works before you start
Requires: Node.js 18+ (nodejs.org) Β· Telegram bot token (@BotFather) Β· Your Telegram user ID (@userinfobot)
Free AI providers available β no credit card needed. Privacy-first? Pick the π Offline β Gemma 4 E4B option in setup for a fully local LLM via Ollama (macOS/Linux: automated install; Windows: manual).
π First-time setup walkthroughs
Step-by-step guides with screenshots and screen-for-screen instructions:
| Platform | PDF (printable) |
|---|---|
π macOS (with launchd background service) |
Download PDF |
| πͺ Windows (with Task Scheduler / Startup folder) | Download PDF |
Both guides cover: Node.js install Β· Telegram bot creation Β· first-time setup Β· foreground test Β· background service Β· offline Gemma 4 mode Β· troubleshooting. ~15 min end-to-end for a first-time user.
macOS: use launchd instead of pm2 (recommended)
If you're on macOS and using Claude Code (Max subscription) as your provider, run the bot as a LaunchAgent β it inherits the GUI login session so the macOS Keychain stays unlocked and the Claude OAuth token just works without any manual security unlock-keychain dance:
alvin-bot launchd install # writes ~/Library/LaunchAgents/com.alvinbot.app.plist and starts the agent
alvin-bot launchd status # show PID + recent stdout/stderr logs
alvin-bot launchd uninstall # unload + remove the plistPm2 still works and remains the default on Linux/Windows β but on macOS with Claude Code, launchd is the only path that reliably keeps Keychain access over restarts.
π Handbook
For a full walkthrough of everything Alvin Bot can do β providers, sub-agents, cron jobs, plugins, MCP, security audit, web UI β read docs/HANDBOOK.md.
AI Providers
| Provider | Cost | Best for |
|---|---|---|
| Groq | Free | Getting started fast |
| Google Gemini | Free | Image understanding, embeddings |
| NVIDIA NIM | Free | Tool use, 150+ models |
| OpenAI | Paid | GPT-4o quality |
| OpenRouter | Paid | 100+ models marketplace |
| Claude SDK | Paid* | Full agent with tool use |
*Claude SDK requires a Claude Max subscription ($20/mo) or Anthropic API access. The setup wizard checks this automatically.
Alternative Installation
One-line install script (Linux/macOS)
curl -fsSL https://raw.githubusercontent.com/alvbln/Alvin-Bot/main/install.sh | bashDownloads, builds, and runs the setup wizard automatically.
Desktop App (macOS)
| Platform | Download | Architecture |
|---|---|---|
| macOS | DMG | Apple Silicon (M1+) |
| Windows | Coming soon | x64 |
| Linux | Coming soon | x64 |
The desktop app auto-starts the bot and provides a system tray icon with quick controls.
Docker
git clone https://github.com/alvbln/Alvin-Bot.git
cd Alvin-Bot
cp .env.example .env # Edit with your tokens
docker compose up -dNote: Claude SDK is not compatible with Docker (requires interactive CLI login).
From Source (contributors)
git clone https://github.com/alvbln/Alvin-Bot.git
cd Alvin-Bot
npm install
npm run build
node bin/cli.js setup # Interactive wizard
npm run dev # Start in dev modeProduction (PM2)
npm install -g pm2
pm2 start ecosystem.config.cjs
pm2 save && pm2 startupTroubleshooting
alvin-bot doctor # Check configuration & validate connectionsIf your AI provider isn't working, run doctor β it tests the actual API connection and shows exactly what's wrong.
π Commands
| Command | Description |
|---|---|
/help |
Show all commands |
/start |
Session status overview |
/new |
Fresh conversation (reset context) |
/model |
Switch AI model (inline keyboard) |
/effort <low|medium|high|max> |
Set thinking depth |
/voice |
Toggle voice replies |
/imagine <prompt> |
Generate images |
/web <query> |
Search the web |
/remind <time> <text> |
Set reminders (e.g., /remind 30m Call mom) |
/cron |
Manage scheduled tasks |
/recall <query> |
Search memory |
/remember <text> |
Save to memory |
/export |
Export conversation |
/dir <path> |
Change working directory |
/workspaces |
List all configured workspaces (v4.12.0) |
/workspace [name] |
Show or switch the active workspace β /workspace default resets (v4.12.0) |
/status |
Current session & cost info |
/setup |
Configure API keys & platforms |
/system <prompt> |
Set custom system prompt |
/fallback |
View & reorder provider fallback chain |
/skills |
List available skills & their triggers |
/lang <de|en|auto> |
Set or auto-detect response language |
/cancel |
Abort running request |
/reload |
Hot-reload personality (SOUL.md) |
ποΈ Architecture
ββββββββββββββββ
β Web UI β (Dashboard, Workspaces, Chat, Settings)
ββββββββ¬ββββββββ
β HTTP/WS
ββββββββββββ βββββββββ ββββββββββββ ββββββββββββ ββββββββββββ
β Telegram β β Slack β β WhatsApp β β Discord β β Signal β
ββββββ¬ββββββ βββββ¬ββββ ββββββ¬ββββββ ββββββ¬ββββββ ββββββ¬ββββββ
β β β β β
ββββββββββββββ΄ββββββββββββ΄ββββββββββββββ΄βββββββββββββββ
β
βββββββββββ΄βββββββββββ
β Workspace Resolver β (per-channel context: cwd + persona)
βββββββββββ¬βββββββββββ
β
ββββββββ΄ββββββββ
β Engine β (Query routing, fallback)
ββββββββ¬ββββββββ
β
ββββββββββββββββββΌβββββββββββββββββ
β β β
ββββββββ΄βββββββ βββββββ΄βββββββ ββββββββ΄βββββββ
β Claude SDK β β OpenAI β β Custom β
β (full agent)β β Compatible β β Models β
βββββββββββββββ ββββββββββββββ βββββββββββββββProvider Types
| Provider | Tool Use | Streaming | Vision | Auth |
|---|---|---|---|---|
| Claude SDK | β Full (native Bash, Read, Write, Web) | β | β | Claude CLI (OAuth) |
| OpenAI, Groq, Gemini | β Full (Shell, Files, Python, Web) | β | Varies | API Key |
| NVIDIA NIM | β Full (Shell, Files, Python, Web) | β | Varies | API Key (free) |
| OpenRouter | β Full (Shell, Files, Python, Web) | β | β | API Key |
| Other OpenAI-compatible | β‘ Auto-detect | β | Varies | API Key |
Universal Tool Use: Alvin Bot gives full agent capabilities to any provider that supports function calling β not just Claude. Shell commands, file operations, Python execution, web search, and more work across all major providers. If a provider doesn't support tool calls, Alvin Bot automatically falls back to text-only chat mode.
Project Structure
alvin-bot/
βββ src/
β βββ index.ts # Entry point
β βββ engine.ts # Multi-model query engine
β βββ config.ts # Configuration
β βββ handlers/ # Message & command handlers
β βββ middleware/ # Auth & access control
β βββ platforms/ # Telegram, Slack, WhatsApp, Discord, Signal adapters
β βββ providers/ # AI provider implementations
β βββ services/ # Memory, voice, cron, plugins, workspaces, tool discovery
β βββ tui/ # Terminal UI
β βββ web/ # Web server, APIs, setup wizard
βββ web/public/ # Web UI (HTML/CSS/JS, zero build step)
βββ plugins/ # Plugin directory (6 built-in)
βββ docs/
β βββ install/ # Setup guides (macOS, Windows, Slack)
β βββ custom-models.json # Custom model configurations
βββ TOOLS.md # Custom tool definitions (Markdown)
βββ SOUL.md # Agent personality
βββ bin/cli.js # CLI entry point
βββ ecosystem.config.cjs # PM2 configurationπ§ Multi-Session Workspaces (v4.12.0)
Run multiple parallel Alvin sessions on the same bot β one per project, context-isolated, memory shared. Think Claude Coworker, but on your own machine with your own tools. Each workspace has its own working directory, purpose, and optional persona. Sub-agents spawned in one workspace stay in that workspace. Memory, skills, and the knowledge base are globally shared across all of them.
Why you'd want this
Without workspaces, Alvin has one big blob of context. If you ask about Alev-B deployment right after debugging a trading bot, Claude pollutes one context with the other. Workspaces solve this: Slack channel = session, or on Telegram, /workspace alev-b = session. Each one has its own Claude SDK resume token, history, and current project CLAUDE.md loaded via its working directory.
How it works
- Drop a markdown file into
~/.alvin-bot/workspaces/<name>.mdwith YAML frontmatter. - Alvin hot-reloads the workspace registry (no restart needed β same pattern as skills).
- On Slack, workspaces resolve by explicit channel ID first, then by channel name match (
#alev-bβworkspaces/alev-b.md, case-insensitive). - On Telegram, run
/workspace <name>to switch β next message uses the new persona and cwd. - Nothing configured? Alvin falls back to the "default" workspace exactly like pre-v4.12 β no breaking changes.
Example workspace file
Create ~/.alvin-bot/workspaces/alev-b.md:
---
purpose: Alev-B consulting website dev
cwd: ~/Projects/alev-b-website
emoji: "π’"
color: "#6366f1"
channels: ["C01ABCDEF"]
---
You are focused on the Alev-B consulting website. Stack: React + Express +
Drizzle + MySQL. Production VPS 72.62.34.230, deploy via rsync. Prefer
concise, directly actionable answers about features, deployment, and
Stripe integration.The cwd auto-loads the project-specific CLAUDE.md via Claude SDK's settingSources: ["user", "project"], so each workspace inherits its project's conventions automatically. channels is optional β omit it to match by filename.
Slack setup (5 minutes)
- Download the setup guide + manifest from the latest release:
slack-setup.mdβ step-by-step instructions with screenshotsslack-manifest.jsonβ copy-paste ready Slack App manifest
- Create a Slack App from the manifest at https://api.slack.com/apps β Create New App β From an app manifest
- Enable Socket Mode, generate an App-Level Token (starts with
xapp-) - Install the app to your workspace, copy the Bot User OAuth Token (starts with
xoxb-) - Add both to
~/.alvin-bot/.env:SLACK_APP_TOKEN=xapp-1-... SLACK_BOT_TOKEN=xoxb-... SLACK_ALLOWED_USERS=U01ABCDEF # optional, comma-separated
- Restart Alvin. You should see
π¬ Slack connected (Alvin @ YourWorkspace)in the log. - Invite Alvin to channels with
/invite @Alvin. DMs work without an invite.
Telegram /workspace commands
| Command | Effect |
|---|---|
/workspaces |
List all configured workspaces with emojis and purposes (active one marked β ) |
/workspace |
Show the currently active workspace |
/workspace <name> |
Switch to <name> β next message uses its persona and cwd |
/workspace default |
Reset to the default workspace (global cwd, no persona) |
Workspace selection is per Telegram user, persisted across bot restarts via ~/.alvin-bot/state/sessions.json (v2 envelope format, backwards compatible with v4.11).
Web UI
The dashboard has a dedicated π§ Workspaces tab (Data section in the sidebar). Each workspace shows as a color-coded card with emoji, purpose, cwd, mapped channels, session count, message count, and cumulative cost. Useful for spotting which project is burning the most tokens.
Or query directly:
curl -s http://localhost:3100/api/workspaces | jqArchitecture guarantees
- Memory is global. Facts Alvin learns in
#alev-bare visible in#homesvia the sharedMEMORY.mdand embeddings index. Per-workspace memory layer is on the v4.13 roadmap. - Sub-agents are per-session. Each workspace can spawn its own
run_in_backgroundagents β results come back to the same channel automatically (v4.10.0). - Session state survives restart. Claude SDK
resumetokens, conversation history, language, effort, andworkspaceNameall persist viasession-persistence.ts(v4.11.0). - Backwards compatible. If you don't create any workspace files, everything behaves exactly like v4.11. Upgrade is a no-op.
βοΈ Configuration
Environment Variables
# Required
BOT_TOKEN=<Telegram Bot Token>
ALLOWED_USERS=<comma-separated Telegram user IDs>
# AI Providers (at least one needed)
# Claude SDK uses CLI auth β no key needed
GROQ_API_KEY=<key> # Groq (voice + fast models)
NVIDIA_API_KEY=<key> # NVIDIA NIM models
GOOGLE_API_KEY=<key> # Gemini + image generation
OPENAI_API_KEY=<key> # OpenAI models
OPENROUTER_API_KEY=<key> # OpenRouter (100+ models)
# Provider Selection
PRIMARY_PROVIDER=claude-sdk # Primary AI provider
FALLBACK_PROVIDERS=nvidia-kimi-k2.5,nvidia-llama-3.3-70b
# Optional Platforms
WHATSAPP_ENABLED=true # Enable WhatsApp (needs Chrome)
DISCORD_TOKEN=<token> # Enable Discord
SIGNAL_API_URL=<url> # Signal REST API URL
SIGNAL_NUMBER=<number> # Signal phone number
SLACK_BOT_TOKEN=xoxb-... # Slack Bot User OAuth Token (Socket Mode)
SLACK_APP_TOKEN=xapp-1-... # Slack App-Level Token (connections:write scope)
SLACK_ALLOWED_USERS=U01... # Optional: comma-separated Slack user IDs allowlist
# Multi-Session (v4.12.0)
SESSION_MODE=per-channel # per-user (default) | per-channel | per-channel-peer
# per-channel gives each Slack channel / group its own isolated session
# Optional
WORKING_DIR=~ # Default working directory (used when no workspace is resolved)
MAX_BUDGET_USD=5.0 # Cost limit per session
WEB_PORT=3100 # Web UI port
WEB_PASSWORD=<password> # Web UI auth (optional)
CHROME_PATH=/path/to/chrome # Custom Chrome path (for WhatsApp)
MEMORY_EXTRACTION_DISABLED=1 # Opt out of v4.11.0 auto-fact-extraction in compactionCustom Models
Add any OpenAI-compatible model via docs/custom-models.json:
[
{
"key": "my-local-llama",
"name": "Local Llama 3",
"model": "llama-3",
"baseUrl": "http://localhost:11434/v1",
"apiKeyEnv": "OLLAMA_API_KEY",
"supportsVision": false,
"supportsStreaming": true
}
]Personality
Edit SOUL.md to customize the bot's personality. Changes apply on /reload or bot restart.
WhatsApp Setup
WhatsApp uses whatsapp-web.js β the bot runs as your own WhatsApp account (not a separate business account). Chrome/Chromium is required.
1. Enable WhatsApp
Set WHATSAPP_ENABLED=true in .env (or toggle via Web UI β Platforms β WhatsApp). Restart the bot.
2. Scan QR Code
On first start, a QR code appears in the terminal (and in the Web UI). Scan it with WhatsApp on your phone (Settings β Linked Devices β Link a Device). The session persists across restarts.
3. Chat Modes
| Mode | Env Variable | Description |
|---|---|---|
| Self-Chat | (always on) | Send yourself messages β bot responds. Your AI notepad. |
| Groups | WHATSAPP_ALLOW_GROUPS=true |
Bot responds in whitelisted groups. |
| DMs | WHATSAPP_ALLOW_DMS=true |
Bot responds to private messages from others. |
| Self-Chat Only | WHATSAPP_SELF_CHAT_ONLY=true |
Disables groups and DMs β only self-chat works. |
All toggles are also available in the Web UI (Platforms β WhatsApp). Changes apply instantly β no restart needed.
4. Group Whitelist
Groups must be explicitly enabled. In the Web UI β Platforms β WhatsApp β Group Management:
- Enable a group to let the bot listen
- Allowed Contacts β Select who can trigger the bot (empty = everyone)
- @ Mention Required β Bot only responds when mentioned (voice/media bypass this)
- Process Media β Allow photos, documents, audio, video
- Approval Required β Owner must approve each message via Telegram before the bot responds. Group members see nothing β completely transparent.
Note: Your own messages in groups are never processed (you ARE the bot on WhatsApp). The bot only responds to other participants. In self-chat, your messages are always processed normally.
5. Approval Flow (when enabled per group)
- Someone writes in a whitelisted group
- You get a Telegram notification with the message preview + β Approve / β Deny buttons
- Approve β bot processes and responds in WhatsApp. Deny β silently dropped.
- Fallback channels if Telegram is unavailable: WhatsApp self-chat β Discord β Signal
- Unapproved messages expire after 30 minutes.
π Plugins
Built-in plugins in plugins/:
| Plugin | Description |
|---|---|
| weather | Current weather & forecasts |
| finance | Stock prices & crypto |
| notes | Personal note-taking |
| calendar | Calendar integration |
| Email management | |
| smarthome | Smart home control |
Plugins are auto-loaded at startup. Create your own by adding a directory with an index.js exporting a PluginDefinition.
π― Skills
Built-in skills in skills/:
| Skill | Triggers | Description |
|---|---|---|
| code-project | code, build, implement, debug, refactor | Software development workflows, architecture patterns |
| data-analysis | analyze, chart, csv, excel, statistics | Data processing, visualization, statistical analysis |
| document-creation | document, report, letter, pdf, write | Professional document creation and formatting |
| email-summary | email, inbox, unread, newsletter | Email triage, summarization, priority sorting |
| system-admin | server, deploy, docker, nginx, ssl | DevOps, deployment, system administration |
| web-research | research, compare, find, review | Deep web research with source verification |
Skills activate automatically when your message matches their trigger keywords. The skill's SKILL.md content is injected into the system prompt, giving the agent specialized expertise for that task.
π οΈ CLI
alvin-bot setup # Interactive setup wizard
alvin-bot tui # Terminal chat UI β¨
alvin-bot chat # Alias for tui
alvin-bot doctor # Health check
alvin-bot update # Pull latest & rebuild
alvin-bot start # Start the bot (background via pm2)
alvin-bot start -f # Start in foreground
alvin-bot stop # Stop the bot
alvin-bot launchd install # macOS only: install as LaunchAgent
alvin-bot launchd status # macOS only: show LaunchAgent state
alvin-bot launchd uninstall # macOS only: remove LaunchAgent
alvin-bot audit # Security health check
alvin-bot search # Search assets/memories/skills
alvin-bot version # Show versionπΊοΈ Roadmap
- Phase 1 β Multi-Model Engine (provider abstraction, fallback chains)
- Phase 2 β Memory System (vector search, user profiles, smart context)
- Phase 3 β Rich Interactions (video messages, browser automation, email)
- Phase 4 β Plugins & Tools (plugin ecosystem, MCP client, custom tools)
- Phase 5 β CLI Installer (setup wizard, Docker, health check)
- Phase 6 β Web Dashboard (chat, settings, file manager, terminal)
- Phase 7 β Multi-Platform (Telegram, Discord, WhatsApp, Signal adapters)
- Phase 8 β Universal Tool Use (NEW) β All providers get agent powers:
- β Shell execution, file read/write/edit, directory listing
- β Python execution (Excel, PDF, charts, data processing)
- β Web fetch & search
- β Auto-detect function calling support per provider
- β Graceful fallback to text-only for providers without tool support
- Phase 9 β Skill System + Self-Awareness + Language Adaptation:
- β SKILL.md files for specialized domain knowledge (email, data analysis, code, docs, research, sysadmin)
- β Auto-matching: skill triggers activate contextual expertise on demand
- β Self-Awareness Core: agent knows it IS the AI (no external LLM calls for text tasks)
- β Automatic language detection and adaptation (EN default, learns user preference)
- β Human-readable cron schedules + visual schedule builder in WebUI
- β Platform Manager refactor: all adapters via unified registration system
- β Cron notifications for all platforms (Telegram, WhatsApp, Discord, Signal)
- β PM2 auto-refresh on Maintenance page
- β WhatsApp group whitelist with per-contact access control
- β Owner approval gate (Telegram β WhatsApp DM β Discord β Signal fallback)
- β Full media processing: photos, documents, audio/voice, video across all platforms
- β File Browser: create, edit, delete files with safety guards
- β Git history sanitized (personal data removed via git-filter-repo)
- Phase 10 β Anthropic API Provider + WebUI Provider Management
- Anthropic API key test case in WebUI (validation endpoint)
- "Add Provider" flow in WebUI β add new providers post-setup without editing
.env - Claude SDK guided setup from WebUI (install check, login status, step-by-step)
-
.env.exampleupdate withANTHROPIC_API_KEY
- Phase 11 β WebUI Professional Redesign
- Replace emoji icons with Lucide SVG icons (60+ icons, sidebar, pages, buttons)
- i18n framework (
i18n.js) β bilingual DE/EN with browser-locale detection (~400 keys) - Language toggle in sidebar footer (DE | EN)
- Typography upgrade (Inter webfont via Google Fonts)
- Gradient accents + subtle glassmorphism on cards
- Smooth page transitions (fade animation on page switch)
- Skeleton loading states + status pulse animations
- Command Palette (Cmd+K / Ctrl+K) with fuzzy search
- Phase 12 β Native Installers (Non-Techie Friendly)
- Electron wrapper (embedded Node.js + WebUI + tray icon)
- macOS
.dmgbuild via electron-builder (arm64) - Windows
.exe(NSIS) via electron-builder - Linux
.AppImage+.debvia electron-builder - Auto-update mechanism (electron-updater)
- GUI Setup Wizard (provider selection, Telegram token, first-run experience)
- Homebrew formula (
brew install alvin-bot) - Scoop manifest for Windows
- One-line install script
- Docker Compose polish (production-ready
docker-compose.yml)
- Phase 13 β npm publish (security audit)
- Phase 14 β Async Sub-Agents (v4.10.0)
-
run_in_background: truesystem prompt hint for Claude SDK - Async-agent watcher polling
outputFileJSONL, delivering results as separate messages - Session-bound sub-agents (each session spawns its own background workers)
-
- Phase 15 β Memory Persistence + Smart Loading (v4.11.0)
- Session persistence across bot restarts (debounced atomic flush, v2 envelope)
- SDK memory injection (MEMORY.md in every system prompt, not just tool-call dependent)
- Semantic recall on SDK first-turn via embeddings
- Layered memory stack (L0 identity / L1 preferences / L2 projects / L3 vector search)
- Auto-fact extraction during compaction (Mem0-style)
- Phase 16 β Multi-Session + Slack Interface (v4.12.0)
- Session-key fix: platform-message.ts routes through
buildSessionKey() - Workspace registry with hot-reload (
~/.alvin-bot/workspaces/*.md) - Workspace resolver in platform handlers (per-channel persona + cwd)
- Slack adapter polish: progress ticker (
chat.update), typing status (assistant.threads.setStatus), channel name cache - Telegram
/workspace+/workspacescommands (feature parity) - Per-workspace cost aggregation + Web UI workspace cards
- Slack setup guide + copy-paste app manifest (in GitHub Release assets)
- Session-key fix: platform-message.ts routes through
- Phase 17 β Memory + Workspace polish (v4.13.0+)
- SQLite migration of the embeddings index (currently 128 MB JSON)
- Per-workspace memory layer (additive over global) β facts learned in
#alev-bstay inalev-bunless explicitly promoted to global - Per-workspace provider override (
provider:in frontmatter) β e.g. Alev-B uses Claude Opus, JobSnack uses cheap Gemini - Per-workspace skill allowlist β scope Apple Notes to personal workspace, sysadmin only to devops workspace, etc.
- Multi-User Slack (real
per-channel-peermode) β different users in the same Slack channel get their own sub-sessions - Workspace cloning / templates β
/workspace clone alev-b as homes-devspins up a new workspace from an existing one - Slack slash commands (
/alvin workspace,/alvin status,/alvin new) β native Slack command integration via Bolt - Daily log decay / archive β older daily logs move to cold storage after N days
- Phase 18 β Security + Platform hardening (from v4.12.1 audit, prioritized)
- P1 β Electron major upgrade (35 β 41+) β fixes 1 HIGH + 5 MODERATE Electron CVEs in the Desktop-Build path. Major version jump, requires full rebuild + test of
.dmgflow. Separate release (likely bundled with Windows.exework). - P1 β Prompt injection defense strategy β not a single fix but a design debate: heuristic filters vs allow-list vs no-sandbox-accept-the-risk. Currently handled as a documented design-constraint (README security section), not as a code filter. When we decide the policy, implement it across all message entry points.
- P2 β TypeScript 5 β 6 upgrade β major release, likely breaking changes in strict mode. Needs a dedicated release + test sweep. Low priority since 5.x is still supported.
- P0 for v5.0 β MCP plugin sandboxing β currently MCP servers run with full Node privileges. Plan: run each MCP in a child process with restricted FS + network policy (similar to deno-permission model). Architectural change, v5.0 territory.
- P1 β Electron major upgrade (35 β 41+) β fixes 1 HIGH + 5 MODERATE Electron CVEs in the Desktop-Build path. Major version jump, requires full rebuild + test of
π Security
β οΈ Important: Alvin has full shell + filesystem access
Alvin Bot is an autonomous AI agent built on the Claude Agent SDK with shell, filesystem, and network access to the machine it runs on. This is by design β it's the point of the project. But it means:
- Treat the bot like
sudoaccess β only install it on machines where you'd trust Claude Code to run without supervision.- Never expose the Web UI (port 3100) to the internet without HTTPS, rate limiting, and a strong
WEB_PASSWORD. It binds tolocalhostby default.- On multi-user systems, verify
~/.alvin-bot/.envis chmod600(v4.12.2+ enforces this automatically on startup).ALLOWED_USERSis your first line of defense β v4.12.2+ refuses to start if it's empty and Telegram is enabled.Read the full threat model and hardening guide:
docs/security.md
Access control
- User whitelist β Only
ALLOWED_USERScan interact with the bot (hard-enforced at startup since v4.12.2) - WhatsApp group approval β Per-group participant whitelist + owner approval gate via Telegram (with WhatsApp DM / Discord / Signal fallback). Group members never see the approval process.
- Slack allowlist β
SLACK_ALLOWED_USERSrestricts who can DM or @mention the bot in Slack - DM pairing β Optional 6-digit code flow for new users via owner approval (
AUTH_MODE=pairing)
Execution hardening
EXEC_SECURITY=allowlist(default) β Shell commands must match a whitelist of safe binaries and cannot contain shell metacharacters (;,|,&,`,$(...), redirects). Rejected by v4.12.2's exec-guard metachar filter.- Cron shell jobs go through the same exec-guard (v4.12.2+) β cron is no longer a bypass vector.
- Sub-agent toolset presets β spawn sub-agents with
toolset: "readonly"or"research"to restrict what they can do, regardless of the parent's privileges. - Timing-safe webhook auth β
POST /api/webhookusescrypto.timingSafeEqual(v4.12.2+) to prevent timing side-channel token extraction.
Data hardening
- Self-hosted β Your data stays on your machine. No cloud sync, no external logging of prompts or responses.
- No telemetry β Zero tracking, zero analytics, zero phone-home.
- File permissions β
.env,sessions.json, memory logs, cron jobs, and all sensitive state files are chmod0o600on every write and repaired at startup (v4.12.2+). - Owner protection β Owner account cannot be deleted via UI.
- Encrypted sudo credentials β If you enable sudo exec, passwords are stored encrypted with an XOR key in a separate file, both chmod
0o600.
Known limitations (documented honestly)
- Prompt injection cannot be reliably filtered β we document this as a capability tradeoff rather than pretending to solve it. See
docs/security.mdfor the full discussion. - Not yet hardened for public-internet deployment β current scope is "on your own machine". VPS deployment works but requires additional reverse-proxy + TLS + rate-limit setup that we don't automate.
- Electron Desktop build has known CVEs (Phase 18 roadmap). The primary distribution is npm global install, not Desktop β if you don't use the Desktop wrapper, you're not affected.
π License
MIT β See LICENSE.
π€ Contributing
Issues and PRs welcome! Please read the existing code style before contributing.
git clone https://github.com/alvbln/Alvin-Bot.git
cd alvin-bot
npm install
npm run dev # Development with hot reload




















