Personal Telegram memory assistant. Send photos, PDFs, voice notes, text, and forwards.
The bot extracts structured facts with inexpensive LLMs via ProxyAPI,
stores originals on disk, indexes embeddings in Postgres/pgvector, and answers questions
with source cards.
- Single-user whitelist (
TELEGRAM_USER_ID) - Inline actions: Save / This is a question / Cancel
- Vision OCR, speech-to-text, JSON field extraction, embeddings, RAG answers
- Original file storage +
/get <id> - Docker Compose deployment (USA VPS friendly for Telegram access)
Telegram → aiogram bot → Save/Ask buttons
│
├─ Save → STT/Vision/Extract/Embed → Postgres + files
└─ Ask → Embed + hybrid retrieval → LLM answer + cards
cp .env.example .envRequired values:
| Variable | Description |
|---|---|
TELEGRAM_BOT_TOKEN |
From @BotFather |
TELEGRAM_USER_ID |
Your numeric Telegram id |
PROXYAPI_API_KEY |
API key from proxyapi.ru |
docker compose up -d --build
docker compose logs -f botThen send /start to the bot from your whitelisted account.
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
export PYTHONPATH=bot
pytest --cov=app --cov-report=term-missing| Command | Description |
|---|---|
/start |
Help |
/recent |
Latest saved records |
/get <id> |
Record card + original file |
/ask <question> |
Ask immediately without buttons |
| Role | Model |
|---|---|
| Vision | inclusionai/ling-3.0-flash-vl |
| STT | openai/gpt-4o-mini-transcribe |
| Embeddings | qwen/qwen3-embedding-8b (EMBED_DIMENSIONS=1024) |
| Extract | z-ai/glm-5.3-flash |
| Chat / RAG | deepseek/deepseek-v4.1-flash |
helper-bot/
bot/app/ # application package
tests/ # unit tests (100% coverage target)
db/init/ # Postgres schema
docker-compose.yml
pyproject.toml
pytest --cov=app --cov-report=term-missingCoverage is enforced at 100% via pyproject.toml.
- Never commit
.env - Rotate keys if they leak into chat/logs
- Whitelist blocks every non-owner Telegram account
MIT — see LICENSE.