An open API service indexing awesome lists of open source software.

https://github.com/cohe4ko/BotVa

Multi-bot Telegram platform powered by Claude AI with persistent memory, MCP integrations, and team coordination
https://github.com/cohe4ko/BotVa

ai-agent ai-assistant anthropic chatbot claude-ai mcp model-context-protocol multi-bot nodejs self-hosted telegram telegram-bot typescript

Last synced: about 6 hours ago
JSON representation

Multi-bot Telegram platform powered by Claude AI with persistent memory, MCP integrations, and team coordination

Awesome Lists containing this project

README

          

# BotVa

[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
[![Node.js 20+](https://img.shields.io/badge/Node.js-20%2B-green.svg)](https://nodejs.org)
[![TypeScript](https://img.shields.io/badge/TypeScript-strict-blue.svg)](https://www.typescriptlang.org)

[πŸ‡ΊπŸ‡¦ Π£ΠΊΡ€Π°Ρ—Π½ΡΡŒΠΊΠ°](README.md)

Multi-bot Telegram platform powered by Claude AI. One server β€” many bots, each with its own role, memory, knowledge, and integrations.


BotVa Dashboard

## What Makes BotVa Different

- **Memory as a first-class entity.** Facts in SQLite (topic, tags, access_count) + daily diary logs + weekly consolidations via Claude. Consolidation runs automatically every night
- **Bot team.** Bots communicate via Unix sockets (Colleague MCP), a manager distributes tasks in parallel via `Promise.allSettled()`
- **Full isolation.** Each bot is a separate process with its own .env, database, knowledge, memory, voice, and role. All managed from one admin panel
- **Live management.** Web panel for creating bots, image gallery, cron tasks, backups, diagnostics. Model and temperature change without restart; .env changes require restart via UI
- **Dynamic integrations.** MCP servers connect based on env variables β€” add `BITRIX24_WEBHOOK_URL`, restart the bot and it gets CRM. No code changes
- **Philosophy.** The base role (`_soul.md`) is a manifesto: how to think, how to communicate, when to stay silent. Not "certainly!", but a human conversation

## Key Features


Bot in action β€” parallel tools


Parallel execution: web search, image generation, Python chart, currency rates β€” in a single request

- **Multiple bots** from a single Node.js instance
- **12 ready-made roles** β€” from personal assistant to webmaster
- **Memory** β€” facts (long-term storage) + daily diary logs with consolidation
- **Voice** β€” voice messages and responses (Groq STT + Edge TTS)
- **Images** β€” generation and editing via Gemini with auto-gallery
- **Gemini AI** β€” second opinion (AskGemini) and search with citations (GeminiSearch)
- **Bot team** β€” communication via Unix sockets, task delegation
- **Scheduler** β€” cron tasks with full tool access
- **Utilities** β€” currency rates, time, Python sandbox, email, Telegraph
- **Integrations** β€” Google Workspace, smart home, any MCP servers
- **Web search** β€” search, scraping, AI browser (Stagehand)
- **Admin panel** β€” full web interface for management
- **Backups** β€” full and per-bot, with SHA256 verification

## Quick Start

### Install on VPS (fastest way)

Open **https://botva-installer.onrender.com/**, enter your server IP and Telegram token -- and in 3-5 minutes the bot is running. Details: [DEPLOY.md](DEPLOY.md)

### Local Installation

```bash
# 1. Clone
git clone https://github.com/cohe4ko/BotVa.git BotVa
cd BotVa

# 2. Install dependencies and build
./scripts/deploy.sh setup

# 3. Create your first bot (option A: CLI)
npm run new-bot -- my-bot personal-assistant --emoji πŸ§‘β€πŸ’Ό --name "My Bot"

# 3. Create your first bot (option B: web interface)
./scripts/deploy.sh admin # Start admin panel
# Open http://localhost:3000 β†’ Create Bot
# Token and chat ID are entered in the creation form

# 4. Configure tokens (if using CLI)
# Edit bots/my-bot/.env:
# - TELEGRAM_BOT_TOKEN (get from @BotFather in Telegram)
# - ALLOWED_CHAT_ID (send /chatid to the bot after starting)

# 5. Start
./scripts/deploy.sh start
```

After starting, message your bot in Telegram β€” it will respond.

Creating a bot via web interface

Create Bot

Choose a role, enter the Telegram token from @BotFather and your chat ID. API keys can be added later.

Bot created

After creation β€” file structure and next steps.

## Bot Roles

When creating a bot you choose a role β€” it defines specialization, tools, and style.

| Role | Slug | Description |
|------|------|-------------|
| Personal Assistant | `personal-assistant` | Daily tasks, calendar, CRM, smart home |
| Researcher | `researcher` | Deep analysis, fact verification, reports |
| Health | `health-advisor` | Health metrics monitoring, lab results, recommendations |
| Academic | `academic` | Scientific papers, methodology, PhD, teaching |
| Creative | `creative` | Design, images, presentations, copywriting |
| Sales | `sales` | Leads, deals, sales analysis, proposals |
| Planner | `planner` | Tasks, deadlines, prioritization |
| Knowledge Base | `knowledge-base` | Documentation, FAQ, knowledge search |
| Manager | `manager` | Bot team coordination, task delegation |
| Product/Market | `product-market` | CRM analytics, positioning, competitors |
| Webmaster | `webmaster` | Website, content, deploy, SEO |
| Debate Researcher | `debate-researcher` | Analysis from opposing perspectives |

```bash
npm run new-bot -- [--emoji πŸ€–] [--name "Name"]
```

## Features

### Telegram

First interaction with the bot β€” greeting, profile setup, reminders, and search with clarifying questions:


First interaction
AskUser β€” clarifying questions

### Voice

The bot understands voice messages and can respond with voice. STT via Groq Whisper (requires `GROQ_API_KEY`), TTS via Edge-TTS (free). The `/voice` command toggles voice responses.

### Images

Generation and editing via Gemini (`GOOGLE_API_KEY`). Use `/img description` or just ask in chat. All images are saved to the gallery.

### Memory

Three-tier system: facts (persistent storage with topics and tags), daily markdown logs, workspace files (USER.md, MEMORY.md). Consolidation at `NIGHT_OWL_HOUR`.


Saving facts to memory
User profile via AskUser


Left: saving facts via SaveFact/SearchMemory. Right: profile setup via AskUser

### Scheduler

Cron tasks: `/schedule 0 9 * * * What's on my agenda today?`. Standard 5-field cron.

### Bot Team

A manager coordinates work, bots communicate via Colleague MCP (Unix sockets). Each bot can reach the manager via `ask_manager()`.

### Telegram

SendMedia (photos, documents, albums), ForwardMessage, SetReaction, PinMessage, OpenWebApp (Mini App), AskUser (buttons, polls).

### Utilities

CurrencyRates (cash exchange rates), GetCurrentTime, RunPython (sandbox), SendEmail (SMTP), PublishTelegraph.

### Workspace Files

The bot reads and updates its files between sessions: USER.md (profile), MEMORY.md (memory) via ReadWorkspaceFile / WriteWorkspaceFile.

Detailed guide: [MANUAL.md](MANUAL.md)

## Integrations

| Integration | MCP Server | Required Variables |
|-------------|-----------|-------------------|
| Google Calendar, Gmail, Drive | `google-workspace` | `GOOGLE_OAUTH_CLIENT_ID`, `GOOGLE_OAUTH_CLIENT_SECRET` |
| Home Assistant | `home-assistant` | `HA_URL`, `HA_TOKEN` |

## Admin Panel

Dashboard β€” 5 bots

Web interface for bot management. Two ways to start:

```bash
# 1. From Telegram (on-demand, auto-stops after 20 min)
/admin

# 2. As a standalone service (persistent)
./scripts/deploy.sh admin
```

| Section | Description |
|---------|-------------|
| Dashboard | Bot status, requests, costs, services |
| Config | Model, temperature, env variables, workspace files |
| Knowledge | Bot knowledge files |
| Facts | Memory: view, search, edit |
| Tasks | Scheduled cron tasks |
| Settings | Chat settings, sessions |
| Usage | Token analytics and costs |
| System | Builtin tools, MCP servers, skills on/off |
| Images | Generated image gallery |
| Logs | Event audit log |
| Diagnostics | AI-powered system diagnostics |
| Backup | Create and restore backups |
| Team | Bot team management |
| Templates | Role templates |
| Terminal | Browser shell |
| Create Bot | New bot creation wizard |

Detailed guide: [MANUAL.md](MANUAL.md)

## Telegram Commands


Telegram commands
Bot settings


Commands /usage, /model, /facts, /settings β€” manage the bot from Telegram

| Command | Description |
|---------|-------------|
| `/start` | Greeting and chat ID |
| `/chatid` | Show chat ID |
| `/newchat`, `/forget` | Clear session (memory persists) |
| `/voice` | Toggle voice responses |
| `/img ` | Generate an image |
| `/model` | Switch model (Opus/Sonnet/Haiku) |
| `/schedule ` | Create a scheduled task |
| `/usage` | Token statistics |
| `/stats` | Inline stats on/off |
| `/lang` | Interface language |
| `/admin` | Admin panel |
| `/session` | Browse CLI sessions |
| `/cancel` | Cancel current request |

## Project Structure

```
BotVa/
β”œβ”€β”€ src/ # Platform code (TypeScript)
β”‚ β”œβ”€β”€ index.ts # Entry point
β”‚ β”œβ”€β”€ bot.ts # Telegram bot
β”‚ β”œβ”€β”€ agent.ts # Claude agent with MCP
β”‚ β”œβ”€β”€ builtin-tools.ts # Built-in tools
β”‚ β”œβ”€β”€ memory.ts # Memory system
β”‚ β”œβ”€β”€ db.ts # SQLite
β”‚ β”œβ”€β”€ voice.ts # STT/TTS
β”‚ β”œβ”€β”€ imagen.ts # Image generation
β”‚ β”œβ”€β”€ scheduler.ts # Scheduler
β”‚ └── admin/ # Web admin panel
β”œβ”€β”€ roles/ # Role templates
β”‚ β”œβ”€β”€ _soul.md # Base character (for all bots)
β”‚ β”œβ”€β”€ _tools.md # Base tool routing
β”‚ └── *.md # Roles (personal-assistant, researcher, ...)
β”œβ”€β”€ mcp-servers/ # MCP servers
β”‚ β”œβ”€β”€ colleague/ # Inter-bot communication
β”‚ └── manager/ # Manager coordination
β”œβ”€β”€ scripts/ # Management scripts
β”œβ”€β”€ installer/ # Web installer
β”œβ”€β”€ bots/ # Bot data (gitignored)
β”œβ”€β”€ workspace/ # Runtime data (gitignored)
β”œβ”€β”€ .env.example # Configuration template
└── package.json
```

## Management

```bash
./scripts/deploy.sh setup # Install dependencies, build
./scripts/deploy.sh start # Start all bots
./scripts/deploy.sh stop # Stop
./scripts/deploy.sh restart # Restart
./scripts/deploy.sh build # Rebuild TypeScript + MCP
./scripts/deploy.sh status # Status
./scripts/deploy.sh backup # Backup
./scripts/deploy.sh restore # Restore
```

## Deploy

Detailed guide with configuration and all options: [DEPLOY.md](DEPLOY.md)

## Tech Stack

- **Runtime**: Node.js 20+, TypeScript (strict)
- **Telegram**: Grammy
- **AI**: Anthropic Claude Agent SDK
- **Database**: SQLite (built into Node.js)
- **Web**: Hono
- **Voice**: Edge-TTS (synthesis), Groq Whisper (recognition)
- **Images**: Google Gemini
- **Browser**: Stagehand / Playwright
- **Tests**: Vitest 4.x

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md).

## FAQ

**How do I find my chat ID?**
Start the bot and send `/start` or `/chatid`.

**How do I add knowledge to a bot?**
Place .md or .txt files in `bots//knowledge/`. Also available via admin panel (Knowledge).

**How do I connect an integration?**
Add the required variables to the bot's `.env`. After restart, the bot automatically gets the tools.

**How do I migrate to another server?**
See the "Migration" section in [DEPLOY.md](DEPLOY.md).

## License

MIT