S
Claude Code logoClaude CodePersonal assistant bot that remembers every chat

Claude Telegram Bot With Long-Term Memory

setuproll@setuproll
93.0Overall score

A Claude Sonnet 4.6 Telegram bot that keeps per-user memory across sessions, so it recalls your name, projects, and past decisions instead of starting cold every message. Best for people who want one private assistant in Telegram that actually carries context like a real conversation.

93.0Score
2.8kVotes
5Components

Install this build

Export
terminal
pip install python-telegram-bot anthropic && python bot.py

Components

Model

  • Claude Sonnet 4.6

Stack

  • python-telegram-bot
  • Anthropic SDK
  • SQLite

Memory

  • Per-user history table
  • Rolling summary
  • Prompt caching

How it works

  • Create the bot in BotFather and copy the HTTP token
  • Store each user's turns in SQLite keyed by chat_id
  • On every message, load recent turns plus a running summary into the system prompt
  • Summarize and trim old turns once the context grows past a token budget

Deploy

  • Long polling on a small VPS
  • systemd service
  • Docker optional

Summary

A Claude Sonnet 4.6 Telegram bot that keeps per-user memory across sessions, so it recalls your name, projects, and past decisions instead of starting cold every message. Best for people who want one private assistant in Telegram that actually carries context like a real conversation.

93.0 score 2.8k votes

0 Reviews

Your rating
Sign in to post

Loading discussion...