Imagine a personal assistant in your pocket π± that handles your emails π§, schedule π , and to-do lists β βall through Telegram. That's what this Telegram AI agent does! π€β¨
This project provides a personal assistant agent that manages tasks related to your email inbox, calendar, and Notion to-do list. The assistant communicates with you via Telegram, keeping you informed about your schedule, tasks, and emails. The assistant is equipped with sub-agents for handling specific tasks and tools for efficient task management.
The Telegram Assistant Manager is your personal assistant that orchestrates the tasks and communication between you and the sub-agents. The manager is responsible for:
- Receiving and analyzing your Telegram messages.
- Delegating tasks to the appropriate sub-agent (Email, Calendar, or Notion).
- Communicating updates, messages, and any queries back to you via Telegram.
The project includes three specialized sub-agents:
-
Email Agent: can handle all your email-related tasks, including sending emails, retrieving specific emails, and checking for important messages from your contacts list.
-
Calendar Agent: can manage your calendar by creating new events and retrieving and checking your scheduled events.
-
Notion Agent: can manage your to-do list in Notion, helping you add, remove, or check tasks as needed
All the sub-agents report back to the Telegram Assistant Manager after completing their respective tasks.
This is the detailed flow of the assistant:
- LangGraph & LangChain: Frameworks used for building the AI agents and interacting with LLMs (GPT4, LLAMA3, GEMINI)
- LangSmith: For monitoring the different LLM calls and AI agents interactions.
- Google APIs: Provides access to Google services like Calendar, Contacts, and Gmail.
- Notion Client: Interface for interacting with Notion to manage and update to-do lists.
- Python 3.9+
- Google API credentials (for Calendar, Contacts, and Gmail access)
- Notion API key
- Groq API key (for Llama3)
- Google Gemini API key (for using the Gemini model)
- Create a Telegram Bot
- Necessary Python libraries (listed in
requirements.txt
)
-
Clone the repository:
git clone https://github.com/AIXerum/AI-Telegram-Assistant.git cd AI-Telegram-Assistant
-
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the required packages:
pip install -r requirements.txt
-
Set up environment variables:
Create a
.env
file in the root directory of the project and add your API keys, see.env.example
to know all the parameters you will need. -
Configure Google API credentials:
Follow Google's documentation to set up credentials for Calendar, Contacts, and Gmail APIs. Save the credentials file in a secure location and update the path in the configuration file.
-
Create a Telegram Bot:
To interact with the assistant via Telegram, you will need to create a Telegram bot and obtain the bot token and chat ID. Follow this guide to create your bot and get the necessary information.
-
Run the project:
python main.py
- Communicating with the Assistant: Simply send a message to your Telegram bot, and the assistant will analyze the message, delegate the task to the appropriate sub-agent, and report back with the results.