A high-performance, event-driven Telegram AI Agent engineered with Aiogram 3.x and integrated directly with the state-of-the-art Google Gemini 3.5 Flash Lite model via the native Google AI Studio API. Designed as an intelligent, responsive personal mentor, it dynamically conducts step-by-step programming, web layout, and Computer Science tutorials without the need for manual, hardcoded lecture libraries.
- The Problem: Traditional educational bots rely heavily on rigid inline menus, pre-written texts, and static databases. This approach makes content expansion extremely resource-intensive and leaves the student with no adaptive feedback when they write custom code or make mistakes.
- The Solution: A fully interactive AI Sandbox. The bot orchestrates a customized prompt-driven persona—a strict, charismatic Senior Developer—who guides users through 25 dynamic tech categories. It serves tailored theory blocks, instantly reviews user-submitted code in the chat, and tracks educational context seamlessly.
- Native Gemini 3.5 Flash Lite Integration: Built using clean, non-blocking asynchronous REST API requests via
aiohttp, skipping heavy, bloated external SDKs for faster execution times. - Advanced Context & State Management: Powered by Aiogram's built-in FSM (Finite State Machine). The bot actively tracks the user's selected technology track, passing unified context layers to the model to ensure precise code-reviews and sequential exercises.
- Background Data Layer Parsing: Implements an asynchronous web scraper combining
aiohttpandBeautifulSoup4(lxml). This architecture scans documentation networks completely in the background without causing thread-blocking freezes for active users. - Production-Grade Design Patterns: Features modular directory routing, full PEP 8 code discipline, clean environment variable isolation (
python-dotenv), and optimal package export declarations using native__all__definitions.
Teacher-Bot/
├── .gitignore
├── LICENSE
├── README.md
├── banner.png
├── main.py
├── requirements.txt
└── app/
├── __init__.py
├── config.py
├── ui_text.py
│
├── keyboards/
│ ├── __init__.py
│ └── inline.py
│
├── services/
│ ├── __init__.py
│ ├── ai_engine.py
│ └── web_parser.py
│
└── handlers/
├── __init__.py
├── commands.py
└── education.py
- Clone the repository:
git clone https://github.com/Hades-db/Teacher-Bot
- Navigate to the project directory:
cd Teacher-Bot - Install the asynchronous environment stack:
pip install -r requirements.txt
- Create a
.envconfiguration file in the root root folder:TOKEN_TG_BOT=YOUR_TELEGRAM_BOT_TOKEN AI_API_KEY=YOUR_GOOGLE_AI_STUDIO_KEY
- Launch the AI Agent:
python main.py
