Companion is a Telegram capture bot for thoughts, tasks, reminders, and
lightweight reflection prompts.
Instead of a menu-heavy slash-command flow, it uses intent routing: the model decides whether a message should be stored as a task, treated as an idea, answered directly, or turned into a follow-up prompt. The bot keeps separate state per allowed user, stores memory in SQLite, and works with text, images, and voice notes.
- captures ideas, tasks, and reminders in a low-friction chat flow
- routes messages through structured model output instead of brittle command parsing
- keeps user state isolated inside a small SQLite-backed memory layer
- runs as a simple long-polling bot with background reminder jobs
- A real Telegram bot with long-polling and background reminder jobs
- Structured LLM output with a strict JSON contract
- Multi-user state isolation on top of SQLite
- Simple operations surface:
.env,systemd, rotating logs, one-process deploy - A practical "capture first, organize later" workflow instead of a chat-first bot
- Python
python-telegram-bot- SQLite /
aiosqlite - Gemini and MiMo-compatible model clients
systemdfor deployment
- Create a virtual environment and install dependencies:
python3 -m venv venv
./venv/bin/pip install -U pip
./venv/bin/pip install -r requirements.txt- Copy the example config and fill in your values:
cp .env.example .env- Start the bot:
./venv/bin/python bot.pyThe bot uses Telegram long polling, so it does not need an inbound port.
TELEGRAM_TOKEN: Telegram bot token from BotFatherALLOWED_USER_IDS: comma-separated Telegram user IDs allowed to use the botDISPLAY_NAMES: optionalid:namepairs for friendlier repliesMIMO_API_KEY,MIMO_BASE_URL,MIMO_MODEL: MiMo-compatible model settingsGOOGLE_API_KEY,GEMINI_MODEL: Gemini-compatible model settingsDB_PATH: SQLite file path, defaultcompanion.dbREMINDER_HOUR: daily reminder scan hour in local timeMORNING_DIGEST_HOUR: optional daily digest hourHERMES_ENDPOINT: optional future integration point
- Messages are normalized into a model request plus a user-specific state snapshot.
- The model returns strict JSON:
intent,reply, andextracted. - The bot turns that structured output into storage updates, buttons, or follow-up prompts.
- Reminder jobs scan stored tasks and send one compact nudge instead of noisy repeated pings.
This public version intentionally excludes live tokens, databases, logs, backups, and personal runtime data. Deployment details are documented at a high level, but the live service unit and machine-specific runtime files are not included here.