Telegram AI Bot: Building Modular Agents with ADK-Rust and Teloxide
Discover how to build a modular, extensible AI-powered Telegram bot using the ADK-Rust framework and Teloxide, featuring persistent sessions, tool modularity, and a modern TUI.
Published on • 2026-05-01
AI Assistant

Building sophisticated AI agents that feel human-like and capable requires more than just connecting an LLM to an API. In this post, we explore a powerful Telegram AI Bot project built with ADK-Rust and Teloxide. This architecture demonstrates how to leverage modern Rust libraries for robust, modular, and persistent AI-powered applications.
Why This Architecture Matters
This Telegram AI Bot is designed for modularity and extensibility. Whether you want to add new capabilities like live web search via Serper.dev, todo management, or a transparent knowledge management system using Markdown wiki pages, the project structure provides a clean, organized path for development.
Key Features
- Multi-Platform AI: Seamlessly integrates with Gemini, Anthropic, or any OpenAI-compatible LLM.
- Persistent Sessions: Conversations are saved via SQLite, ensuring history is preserved keyed by the user’s Telegram ID.
- Hierarchical Sub-Agents: Support for delegating complex tasks to specialized sub-agents.
- Modern TUI: Beyond the Telegram interface, it includes a local interactive terminal agent with a rich TUI experience.
- Transparent KM System: Uses a human-readable Markdown wiki for long-term memory and knowledge management.
Getting Started
To explore or deploy this bot, you can find the complete source code and instructions in the repository:
GitHub Repository: https://github.com/anoochit/telegram_bot
Prerequisites
- Rust (rustup)
- Telegram Bot Token (obtain from @BotFather)
- LLM API Key (Gemini, OpenAI, or ThaiLLM)
Run Modes
The bot provides four flexible ways to interact with your agent:
| Mode | Command | Description |
|---|---|---|
| Telegram Bot | cargo run -- bot | Start the interactive Telegram bot. |
| CLI | cargo run -- cli | Local interactive terminal agent with rich TUI. |
| Run | cargo run -- run "prompt" | Execute a single prompt directly from the CLI. |
| Server | cargo run -- server | Run as an HTTP service. |
Developer Insights
The system uses teloxide for Telegram polling and adk-rust as the core framework for managing agent logic and state. You can customize the bot’s “soul” by editing AGENT.md (name, personality, tone) and USER.md (user context and preferences).
If you are a developer looking to add new capabilities, the tools are organized in src/agent/tools/. The bot automatically updates MEMORIES.md as it learns more about you, and wiki pages are managed in the wiki/ directory.
We encourage you to check out the repo, experiment with the different run modes, and see how easy it is to extend this modular agent framework!