AI-Powered Chatbot with User History
The project is a Telegram chatbot powered by Ollama AI, introduced in the Telegram Bot API 7.2 update, that maintains chat history with users and provides AI-generated responses. It uses the aiogram
library for handling Telegram bot interactions, aiohttp
for asynchronous HTTP requests, and stores user chat history in a JSON file.
- Maintains a chat history for each user.
- Integrates with an external AI service to generate responses.
- Ignores messages from a specific admin user but still logs them.
- Handles messages asynchronously for better performance.
- Python 3.8+
aiogram
libraryaiohttp
library
-
Setup local ollama: Setup Guide
-
Install the dependencies:
pip install -r requirements.txt
-
Run bot:
python main.py
This project is licensed under the MIT License. See the LICENSE
file for more information.