Chat2Task is a Telegram-first task copilot. Send it a messy message like "besok ingetin saya bayar listrik, rangkum meeting ini, terus bikin draft WA ke tim" and it parses it into structured actions β reminders, summaries, and drafts β then lets you approve and execute each one.
| Feature | Description |
|---|---|
| Multi-action parsing | Extracts multiple actions from a single message |
| Approval-first workflow | Nothing executes without your confirmation |
| Smart reminders | One-time and recurring, with snooze and timezone support |
| Summaries | Concise, structured text summaries on demand |
| Draft generation | Ready-to-send messages for WhatsApp, email, etc. |
| π Voice messages | Send a voice note β it gets transcribed and parsed automatically |
| π€ Multi-turn clarification | Bot asks follow-up questions for ambiguous requests |
| π Google Calendar sync | Approved reminders auto-create Google Calendar events |
| π Notion sync | Approved tasks auto-create pages in your Notion database |
| π₯ Group chat support | Add bot to groups β responds only when @mentioned or replied to |
| π Web dashboard | Dark-themed dashboard at /dashboard to view & filter tasks |
| Multilingual | Works in English, Indonesian, and other languages |
| Daily digest | Morning summary of your tasks and reminders |
| REST API | Task inbox accessible via API alongside Telegram |
| Provider-agnostic LLM | Works with any OpenAI-compatible API (NVIDIA NIM, OpenRouter, local models) |
| Persistent scheduling | Reminders survive restarts |
app/
βββ main.py # FastAPI entrypoint & lifespan
βββ config.py # Pydantic settings from .env
βββ database.py # SQLAlchemy engine & session
βββ models/ # DB models (User, Task, Reminder, ActionLog)
βββ schemas/ # Pydantic schemas (actions, tasks, users)
βββ llm/
β βββ provider.py # Abstract LLM interface
β βββ openai_compat.py # OpenAI-compatible client (default)
β βββ parser.py # Task extraction engine
β βββ summarizer.py # Summary generation
β βββ drafter.py # Draft generation
β βββ prompts.py # Prompt templates
βββ services/
β βββ task_service.py # Task lifecycle management
β βββ reminder_service.py # Reminder scheduling
β βββ user_service.py # User CRUD & preferences
β βββ digest_service.py # Daily digest builder
β βββ voice_service.py # π Voice transcription (Whisper API)
β βββ conversation.py # π€ Multi-turn state manager
β βββ gcal_service.py # π
Google Calendar integration
β βββ notion_service.py # π Notion integration
βββ scheduler/ # APScheduler engine & reminder jobs
βββ telegram/
β βββ bot.py # Bot & Dispatcher factory
β βββ handlers/ # Command, message, voice, callback handlers
β βββ keyboards.py # Inline keyboard builders
β βββ formatting.py # Message formatting helpers
βββ routers/ # FastAPI routes (webhook, tasks API, health)
β βββ dashboard.py # π Web dashboard routes
βββ templates/ # Jinja2 HTML templates (dashboard UI)
- Python 3.11+
- A Telegram bot token (from @BotFather)
- An OpenAI-compatible API key (OpenAI, NVIDIA NIM, OpenRouter, etc.)
git clone https://github.com/your-username/chat2task.git
cd chat2task
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txtcp .env.example .env
# Edit .env with your tokens:
# TELEGRAM_BOT_TOKEN=your-bot-token
# LLM_API_KEY=your-api-key
# LLM_BASE_URL=https://integrate.api.nvidia.com/v1 (or any OpenAI-compatible endpoint)
# LLM_MODEL=meta/llama-3.1-8b-instruct# Local development (long polling mode β no webhook needed)
make dev
# Or directly:
uvicorn app.main:app --host 0.0.0.0 --port 8000 --reloadOpen your bot in Telegram and send a message:
Besok ingetin saya bayar listrik jam 10, rangkum meeting ini, terus bikin draft WA ke tim
The bot will respond with detected actions and approval buttons.
cp .env.example .env
# Edit .env
docker compose up --buildYou: Remind me to call the dentist tomorrow at 3pm
Chat2Task: π― Detected Actions
β° #1 β Call the dentist Type:
reminderπ’ π 2025-01-15 15:00
[β Approve][β Cancel]
You: besok ingetin saya bayar listrik, rangkum meeting ini, terus bikin draft WA ke tim
Chat2Task: π― Detected Actions
β° #1 β Bayar listrik Type:
reminderπ’ π 2025-01-15π #2 β Rangkum meeting Type:
summaryπ‘βοΈ #3 β Draft WA ke tim Type:
draftπ‘ π¨ To: Tim (WhatsApp)
[β Approve All][β #1][β #1][β #2][β #2][β #3][β #3][π Ignore All]
Chat2Task: β° Reminder
π Bayar listrik
What would you like to do?
[β Done][β° 10m][β° 1h][π Tomorrow]
| Variable | Default | Description |
|---|---|---|
TELEGRAM_BOT_TOKEN |
β | Your Telegram bot token (required) |
WEBHOOK_URL |
β | Webhook URL (leave empty for polling mode) |
WEBHOOK_SECRET |
change-me |
Secret for webhook verification |
LLM_BASE_URL |
https://integrate.api.nvidia.com/v1 |
OpenAI-compatible API base URL |
LLM_API_KEY |
β | API key for the LLM provider |
LLM_MODEL |
meta/llama-3.1-8b-instruct |
Model identifier |
LLM_TIMEOUT |
30 |
Request timeout in seconds |
LLM_TEMPERATURE |
0.1 |
LLM temperature for parsing |
DATABASE_URL |
sqlite:///./chat2task.db |
Database connection string |
DEFAULT_TIMEZONE |
Asia/Jakarta |
Fallback timezone |
DEFAULT_REMINDER_HOUR |
9 |
Default hour for reminders without time |
STT_BASE_URL |
β | Whisper-compatible STT endpoint (blank = use LLM_BASE_URL) |
STT_API_KEY |
β | STT API key (blank = use LLM_API_KEY) |
STT_MODEL |
whisper-1 |
STT model name |
GOOGLE_CALENDAR_ENABLED |
false |
Enable Google Calendar sync |
GOOGLE_CREDENTIALS_FILE |
credentials.json |
Path to Google OAuth credentials |
GOOGLE_TOKEN_FILE |
token.json |
Path to cached Google auth token |
NOTION_ENABLED |
false |
Enable Notion sync |
NOTION_API_KEY |
β | Notion integration API key |
NOTION_DATABASE_ID |
β | Target Notion database ID |
The app exposes a lightweight REST API alongside the Telegram interface:
GET /healthβ Health checkGET /api/tasks/?telegram_id=123β List user tasksGET /api/tasks/{id}β Get task detailsPATCH /api/tasks/{id}β Update taskPOST /api/tasks/{id}/approveβ Approve taskPOST /api/tasks/{id}/cancelβ Cancel taskGET /docsβ Interactive API docs (Swagger UI)GET /dashboardβ Web dashboard (task overview & stats)GET /dashboard/tasksβ Task list with status filter
make test
# Or:
pytest tests/ -v- Implement
app/llm/provider.py::LLMProviderinterface - Create your provider class (e.g.,
app/llm/anthropic.py) - Update the provider instantiation in message handlers
- Install
psycopg2-binary - Update
DATABASE_URLin.env:DATABASE_URL=postgresql+psycopg2://user:pass@localhost:5432/chat2task - Uncomment the PostgreSQL service in
docker-compose.yml
- Add the type to
ActionTypeenum inapp/schemas/action.py - Update the LLM prompt in
app/llm/prompts.py - Add execution logic in
app/telegram/handlers/callback.py::_execute_task
- Multi-turn clarification & settings state machine
- Google Calendar sync
- Notion integration
- Voice message transcription β action extraction
- Group chat support with @mention parsing
- Web dashboard for task management
- Alembic migrations for production schema management
- Todoist / CalDAV integration
- Rate limiting and usage quotas
- Multi-model fallback chain
- Docker production-ready image
- Webhook mode with HTTPS reverse proxy guide
MIT β see LICENSE.