Task Genie

AI-Powered Task Management Telegram Bot

Python 3.11FastAPILangGraphLangChainMongoDBRedisAiogramDocker

Task Genie is an intelligent Telegram bot that helps you manage tasks and reminders through natural conversation. Instead of clicking through menus or using strict commands, just tell the bot what you need to do in plain English! The bot uses a **custom LangGraph AI agent** powered by OpenAI to understand your intent, extract task details, and manage your schedule intelligently.

Natural Language Processing

  • Conversational Interface
  • Smart Date Parsing ("tomorrow", "next Monday")
  • Timezone Aware scheduling
  • Advanced Intent Recognition

Task Management

  • Create, edit, delete tasks via chat
  • Organize with tags and priority levels
  • Recurring tasks support
  • Task statistics and summaries

Smart Reminders

  • Automatic reminders before deadlines
  • Custom reminder times
  • Timezone-aware notifications
  • Multiple reminders per task

Security & Privacy

  • Encrypted API key storage (Fernet)
  • Personal workspace for each user
  • Secure MongoDB data storage
  • No data sharing between users

System Architecture

┌─────────────────────────────────────────────────────────┐
│                    Telegram User                        │
└───────────────────┬─────────────────────────────────────┘
                    │
                    ▼
┌─────────────────────────────────────────────────────────┐
│              Aiogram Bot (Telegram API)                 │
│  • Command Handlers (/start, /settings, /stats)         │
│  • Natural Language Message Handler                     │
│  • FSM State Management (Redis)                         │
└───────────────────┬─────────────────────────────────────┘
                    │
                    ▼
┌─────────────────────────────────────────────────────────┐
│              LangGraph AI Agent                         │
│  ┌─────────────────────────────────────────────────┐    │
│  │  Custom Graph Workflow:                         │    │
│  │  START → agent → [decide] → tools → agent       │    │
│  └─────────────────────────────────────────────────┘    │
│  • Conversation Memory (MongoDB Checkpointing)          │
└───────────────────┬─────────────────────────────────────┘
                    │
                    ▼
┌─────────────────────────────────────────────────────────┐
│                   LangChain Tools                       │
│  • create_task     • edit_task                          │
│  • list_tasks      • mark_task_done                     │
└─────────────────────────────────────────────────────────┘

Bot Layer

Built with Aiogram, handling Telegram API interactions, command routing, and FSM state management via Redis. It provides the interactive UI with inline keyboards.

AI Layer

A custom LangGraph Agent with explicit control over behavior. It uses MongoDB for conversation memory and a set of LangChain tools to perform actions.

Usage Examples

Creating a Task

You: Remind me to call mom tomorrow at 5pm

Bot: ✅ I've created a reminder: "Call mom"

Due: Tomorrow at 5:00 PM

Managing Tasks

You: Show me all my pending tasks

Bot: 📋 You have 3 pending tasks:

1. 🔴 Team meeting - Mon, 10:00 AM

2. 🟡 Buy groceries - Tue, 5:00 PM

Technical Stack

Core
  • • Python 3.11+
  • • FastAPI
  • • Aiogram
  • • Pydantic
AI & ML
  • • LangChain
  • • LangGraph
  • • OpenAI API
  • • Fernet Encryption
Data & Infra
  • • MongoDB (Beanie ODM)
  • • Redis (FSM)
  • • Docker Compose