https://github.com/jonaskahn/rimaimy
A telegram bot to remind your task based on sent messages with Groq AI and Superbase
https://github.com/jonaskahn/rimaimy
ai ai-powered groq superbase telegrambot
Last synced: 3 days ago
JSON representation
A telegram bot to remind your task based on sent messages with Groq AI and Superbase
- Host: GitHub
- URL: https://github.com/jonaskahn/rimaimy
- Owner: jonaskahn
- License: mit
- Created: 2026-03-07T05:17:15.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2026-03-07T05:31:11.000Z (3 months ago)
- Last Synced: 2026-03-07T13:30:51.339Z (3 months ago)
- Topics: ai, ai-powered, groq, superbase, telegrambot
- Language: TypeScript
- Homepage:
- Size: 39.1 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Rimaimy – Telegram Task Bot
> *Rimaimy: pronounced "remind me"*
A Telegram bot that extracts tasks from messages using an LLM, stores them in Supabase, and sends reminders based on
urgency. Runs on Cloudflare Workers.
## Stack
| Service | Free Tier |
|--------------------|-----------------------------------|
| Cloudflare Workers | 100,000 requests/day |
| Groq | Free tier (Llama, GPT-OSS models) |
| Supabase | 500MB DB, unlimited API |
| Telegram Bot API | Free |
## Features
- Multi-user — each Telegram user sees only their own tasks
- Forward or send any message — the LLM extracts a task title, description, and due date
- Smart reminders — reminder frequency scales with how close the due date is
- Inline action buttons on each task: Done, Undone, Due, Delete
- Link back to the original forwarded message
- Commands:
- List: `/list`, `/list by created`, `/list done`, `/remaining`, `/today`
- Create: `/add `, `/add | `
- Update: `/update due `, `/update title `
- Delete: `/delete `
- Status: `/done `, `/undone `
- Accepted date formats: `2026-03-10`, `4/3/2026`, `tomorrow`, `today`, `next week`, `in 2 days`
## Setup
### 1. Create a Telegram Bot
1. Open Telegram and message [@BotFather](https://t.me/BotFather)
2. Send `/newbot` and follow the prompts
3. Copy the bot token — it looks like `123456789:ABCdef...`
### 2. Create a Supabase Project
1. Go to [supabase.com](https://supabase.com) and create a free project
2. In **Project Settings → API**, copy:
- **Project URL** → this is your `SUPABASE_URL`
- **service_role** key → this is your `SUPABASE_SERVICE_KEY` (use the service_role key, not the anon key)
### 3. Create a Groq API Key
1. Go to [console.groq.com](https://console.groq.com) and create a free account
2. Generate an API key → this is your `GROQ_API_KEY`
### 4. Run the Database Schema
In Supabase, go to **SQL Editor** and run the contents of `supabase/schema.sql`. This creates the tasks table.
### 5. Configure `wrangler.toml`
Copy the example config and fill in your values:
```bash
cp wrangler.toml.example wrangler.toml
```
Open `wrangler.toml` and replace the placeholder values under `[vars]`:
```toml
[vars]
TELEGRAM_BOT_TOKEN = "your-telegram-bot-token"
SUPABASE_URL = "https://your-project.supabase.co"
SUPABASE_SERVICE_KEY = "eyJ..."
GROQ_API_KEY = "gsk_..."
GROQ_MODEL = "openai/gpt-oss-20b" # or openai/gpt-oss-120b for better accuracy
CRON_SECRET = "any-random-string" # used to protect the /cron-reminder endpoint
```
`wrangler.toml` is listed in `.gitignore` and will not be committed.
### 6. Install and Deploy
```bash
npm install
npm run deploy
```
After deploying, Wrangler will print your worker URL:
```
https://remind-me-bot..workers.dev
```
### 7. Register the Telegram Webhook
Tell Telegram where to send updates. Replace the values below with your bot token and worker URL:
```bash
curl "https://api.telegram.org/bot/setWebhook?url=https://remind-me-bot..workers.dev/webhook"
```
A successful response looks like:
```json
{"ok":true,"result":true,"description":"Webhook was set"}
```
### 8. Set Up Reminders (Cron)
The cron handler runs at `/cron-reminder?secret=` and checks all users' tasks.
**Option A: Cloudflare Cron Triggers** (requires Workers Paid plan, $5/month)
The cron schedule is already set in `wrangler.toml` (`0 * * * *` = every hour). No extra setup needed if you have a paid
plan.
**Option B: External Cron (free)**
Use [cron-job.org](https://cron-job.org) or any HTTP cron service:
- URL: `https://remind-me-bot..workers.dev/cron-reminder?secret=`
- Method: GET
- Schedule: every hour (`0 * * * *`)
The `CRON_SECRET` value must match what you set in `wrangler.toml`.
## Reminder Schedule
| Time until due date | Reminder frequency |
|------------------------|--------------------|
| No due date or overdue | Every hour |
| Less than 1 day | Every hour |
| 1–3 days | Every 4 hours |
| 3–5 days | Every 8 hours |
| More than 5 days | No reminder |
## Local Development
```bash
cp .dev.vars.example .dev.vars
# Fill in .dev.vars with your credentials (same keys as wrangler.toml [vars])
npm run dev
```
To test the Telegram webhook locally, expose your local server with [ngrok](https://ngrok.com) or Cloudflare Tunnel,
then register that URL as your webhook.
## Usage
**Create a task**
- Forward or send any message: *"Call mom tomorrow at 5pm"*
- Or use the command: `/add Buy groceries` or `/add Finish report | tomorrow`
**List tasks**
- `/list` — all pending tasks, sorted by due date
- `/list by created` — sorted by creation date
- `/list done` — includes completed tasks
- `/remaining` — incomplete tasks only
- `/today` — tasks due today
**Manage tasks**
- `/update due tomorrow` or `/update title New title`
- `/done ` / `/undone `
- `/delete ` — permanent, no confirmation
## Multi-User
Each user is identified by their Telegram user ID. All data is scoped per user — tasks, reminders, and commands only
affect the requesting user's data. No registration required.
## Project Structure
```
rimaimy/
├── src/
│ ├── index.ts # Webhook + cron handler
│ ├── llm.ts # LLM task extraction
│ ├── db.ts # Supabase CRUD
│ ├── telegram.ts # Telegram API helpers
│ └── types.ts # TypeScript types
├── supabase/
│ └── schema.sql # Database schema
├── wrangler.toml # Cloudflare config (gitignored, contains secrets)
├── wrangler.toml.example
└── package.json
```
## License
MIT