The Personal Development Coach Telegram Bot is an intelligent assistant designed to help users manage their personal development goals seamlessly through Telegram. Integrated with Todoist, it allows users to track tasks and receive personalized coaching advice powered by advanced AI models.
- Task Management: Sync and manage Todoist tasks directly within Telegram.
- Personalized Coaching: Receive tailored advice on goal setting, motivation, and personal growth.
- Natural Language Processing: Advanced AI understands and responds to user queries effectively.
- Real-time Updates: Get instant feedback and task updates through the Todoist API.
- User-Friendly Interface: Simple commands and interactions designed for ease of use.
The bot uses a modular architecture with clear separation of concerns:
-
Core Components:
agent.py
: Orchestrates the LangGraph workflow and state managementstate.py
: Defines the state management types and merge functionsmodels.py
: Pydantic models for data validation and type safety
-
Nodes:
nodes/chat.py
: Handles AI conversation using LangChain and GPT modelsnodes/get_tasks.py
: Manages Todoist task synchronization
-
Utils:
utils/todoist.py
: Todoist API client implementationutils/telegram.py
: Telegram bot setup and message handlingutils/agent_handler.py
: Agent interaction managementutils/prompts.py
: System prompts and message templates
-
Programming Language: Python 3.8+
-
Core Frameworks:
- Aiogram: Telegram bot framework
- LangGraph: Workflow orchestration
- LangChain: LLM integration
- OpenAI GPT: Language model
- Todoist API: Task management
-
Supporting Libraries:
- Pydantic: Data validation
- HTTPX: Async HTTP client
- python-dotenv: Environment management
- Python 3.8 or higher
- Git
- Todoist Account
- Telegram Account
-
Clone the Repository
git clone https://github.com/saminkhan1/focuscoach.git cd personal-dev-coach-bot ```
-
Create a Virtual Environment
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate ```
-
Install Dependencies
pip install -r requirements.txt ```
-
Environment Variables
Create a
.env
file in the root directory and add the following variables:TELEGRAM_BOT_TOKEN=your_telegram_bot_token TODOIST_API_TOKEN=your_todoist_api_token ``` - **TELEGRAM_BOT_TOKEN:** Obtain from [BotFather](https://telegram.me/BotFather) on Telegram. - **TODOIST_API_TOKEN:** Get from [Todoist Integration Settings](https://todoist.com/prefs/integrations).
-
Additional Configuration
You can customize other settings such as logging levels or API endpoints by modifying the respective configuration files or environment variables as needed.
-
Start the Bot
python telegram_bot.py ``` The bot will start polling for messages. Ensure that your environment variables are correctly set.
-
Interact with the Bot
- /start: Initialize your session and receive a welcome message.
- General Messages: Ask questions or seek advice on personal development topics.
-
Task Management Commands
- Add Task: You can add tasks to your Todoist directly through the bot.
- Close Task: Mark tasks as completed via bot commands.
- View Tasks: Retrieve and view your current tasks.
Contributions are welcome! Please follow these steps to contribute:
-
Fork the Repository
-
Create a Feature Branch
git checkout -b feature/YourFeature ```
-
Commit Your Changes
git commit -m "Add some feature" ```
-
Push to the Branch
git push origin feature/YourFeature ```
-
Open a Pull Request
Submit a pull request detailing your changes for review.
my_coach/
├── my_coach/
│ ├── init.py
│ ├── agent.py # LangGraph workflow definition
│ ├── models.py # Pydantic data models
│ ├── state.py # State management
│ ├── nodes/
│ │ ├── init.py
│ │ ├── chat.py # Chat processing node
│ │ └── get_tasks.py # Task synchronization node
│ └── utils/
│ ├── init.py
│ ├── agent_handler.py # Agent interaction logic
│ ├── prompts.py # System prompts
│ ├── telegram.py # Telegram bot setup
│ └── todoist.py # Todoist API client