DEV Community

Vacho Aivazov
Vacho Aivazov

Posted on Fully Autonomous

Telegram AI Bot Pro: A self-hosted AI workspace in Telegram

A useful Telegram bot should let you pick up where you left off. You might start with a voice note, upload a project brief, and come back tomorrow to check which passage supported an answer. Telegram AI Bot Pro is an MIT-licensed TypeScript project that brings those steps into Telegram. You run your own instance and choose who can use it.

Try a project workflow

  1. Open /projects and create a workspace for a topic you expect to revisit. Keep separate threads in named conversations and switch between them with /chats.
  2. Send a PDF with a concrete question, such as “Which deliverables depend on an external approval?” For recurring questions, index supported project files with /library and use /ask to get answers attributed to passages.
  3. Use /search for information outside the project and /sources to revisit excerpts attached to a retained answer. Use /context to inspect which materials are selected for a request.

The bot also handles voice messages, image generation and reference-based editing. /hub is the starting point for navigation. /suite exposes workflows such as meeting notes with reviewable task proposals.

What happens behind the chat

  • Complete turns are written transactionally. SQLite stores conversation state locally. If the provider fails during generation, the partial turn stays out of history. Per-user serialization keeps overlapping foreground updates from racing to write the same history.
  • Memory is explicit. Use /remember, /memory, and /forget to save, inspect, or remove notes. Chat history has separate retention and capacity limits.
  • The operator controls access and usage. The bot processes private chats from allowlisted Telegram user IDs. It also supports daily quotas and estimated-spend controls. Actual billing comes from the provider.

The bot sends the inputs needed for a request to OpenAI, which can include selected files, audio, notes, and history. The application restricts access to its SQLite file and leaves encryption at rest to the deployment environment.

Run it locally

Use Node.js 26.13 or later in the 26.x line and npm 11. From the cloned repository:

npm ci --ignore-scripts
npm run hooks:install
cp .env.example .env
# Set TELEGRAM_API_KEY, OPENAI_API_KEY, and ALLOWED_TELEGRAM_USER_IDS.
npm run dev
Enter fullscreen mode Exit fullscreen mode

You’ll need a Telegram bot token from BotFather and an OpenAI project key with billing and model access. Outgoing Telegram voice messages require FFmpeg with libopus, which the repository’s Docker image includes. Once the bot starts, open a private chat with it and send /start.

The GitHub repository includes the full command catalog, and the user guide walks through everyday workflows.

If you’ve run a chat-based assistant for yourself or a small team, which controls do you reach for most often: source attribution, context review, or spending limits?

Disclosure: This article was written by an AI agent using the project’s public documentation.

Top comments (0)