Ludext is a self-hosted assistant that runs on a Raspberry Pi. Every morning it collects your emails, calendar events, tasks, and news from your own infrastructure, summarizes everything with a local AI model, and sends you a Telegram message before you start your day.
No data ever leaves your home network. No subscriptions. No third-party AI APIs.
Most AI assistants send your personal data to external servers. Ludext is built around a different principle: your data stays yours.
- π§ Local AI β Ollama runs the language model directly on your Raspberry Pi. Your emails and calendar are never sent to OpenAI, Anthropic, or any cloud provider.
- π Self-hosted data β Nextcloud stores your calendar, tasks, notes, and news feeds on hardware you own and control.
- πΈ No subscriptions β Once set up, Ludext runs for free indefinitely.
| Layer | Technology | Role |
|---|---|---|
| Gmail (IMAP) | Fetches and filters unread messages | |
| Self-hosted data | Nextcloud | Calendar, tasks, news feeds, notes |
| AI | Ollama + Llama 3.2 3B | Summarizes everything locally, no cloud |
| Delivery | Telegram Bot | Sends the briefing and accepts commands |
| Runtime | Raspberry Pi 4/5 | Runs the whole stack, 24/7 |
- π§ Unread emails β filtered and summarized, only what matters
- π Calendar β events for today and tomorrow
- β Pending tasks β most urgent ones highlighted
- π° News β relevant articles from your Nextcloud News feeds
- π Medicines β which ones to take today and at what time
- π€ AI summary β generated by a local LLM, sent to Telegram
Manage tasks, calendar events, medicines, shopping list, car expenses, and wishlist directly from Telegram. The bot also monitors system health and sends automatic alerts for high CPU temperature, RAM, or disk usage.
β Full command reference
β Feature documentation
- Raspberry Pi 4 or 5 (8 GB RAM recommended)
- Calendar β for CalDAV events and tasks
- News β for RSS feed summaries
- Notes β for shopping list, car expenses, and medicine tracking
- A Gmail account with IMAP enabled
- A Telegram account to create a bot
nmapinstalled on the Pi (for the/redcommand)
git clone https://github.com/iamLudok/ludext.git ~/Ludext
cd ~/Ludextbash deploy/setup.shThis installs system dependencies, creates a Python virtual environment, sets up Ollama with Llama 3.2 3B, configures the daily cron job at 7:30, and installs the Telegram bot as a systemd service.
cp .env.example .env
nano .env| Variable | Description |
|---|---|
GMAIL_USER |
Your Gmail address |
GMAIL_APP_PASSWORD |
Gmail app password (see below) |
NEXTCLOUD_URL |
Your Nextcloud URL, e.g. http://192.168.1.50:8080 |
NEXTCLOUD_USER |
Your Nextcloud username |
NEXTCLOUD_PASSWORD |
Your Nextcloud password |
NEXTCLOUD_CALDAV_URL |
Usually NEXTCLOUD_URL/remote.php/dav |
OLLAMA_URL |
Leave as http://localhost:11434 |
OLLAMA_MODEL |
Leave as llama3.2:3b |
TELEGRAM_TOKEN |
Your Telegram bot token |
TELEGRAM_CHAT_ID |
Your Telegram chat ID |
Gmail requires an app-specific password for IMAP access:
- Go to myaccount.google.com/security
- Enable 2-Step Verification if not already active
- Go to App passwords and create a new one named "Ludext"
- Copy the 16-character code into
.envβGMAIL_APP_PASSWORD
- Open Telegram and search for @BotFather
- Send
/newbotand follow the steps - Copy the token into
.envβTELEGRAM_TOKEN - Send any message to your new bot, then open:
https://api.telegram.org/bot<YOUR_TOKEN>/getUpdates - Find
"id"inside"chat"β that's yourTELEGRAM_CHAT_ID
This makes Telegram show the command menu when you type / in the chat.
Run setMyCommands once with whichever commands you want to expose (replace <YOUR_TOKEN>):
curl -X POST "https://api.telegram.org/bot<YOUR_TOKEN>/setMyCommands" \
-H "Content-Type: application/json" \
-d '{
"commands": [
{"command": "ayuda", "description": "Muestra todos los comandos"},
{"command": "tareas", "description": "Lista tus tareas pendientes"}
]
}'Full list of available commands: /ayuda inside the bot or docs/commands.md.
You only need to do this once β the commands persist on Telegram's side and survive bot restarts.
source ~/ludext-env/bin/activate
python3 ludext.pyUse --debug to inspect the prompt sent to the AI:
python3 ludext.py --debug
cat /tmp/ludext_prompt.txtLudext/
βββ .env.example β Template for .env
βββ .gitignore β Excludes files from git
βββ LICENSE β MIT license
βββ ludext.py β Daily briefing script (runs via cron)
βββ README.md β Project documentation
βββ bot/
β βββ __main__.py β Telegram polling and background threads
β βββ background.py β Background alerts
β βββ handlers.py β Telegram bot command handlers
βββ calendar/
β βββ events.py β Event CRUD (Nextcloud CalDAV)
β βββ tasks.py β Task CRUD (Nextcloud CalDAV)
βββ core/
β βββ ai.py β Builds the prompt and queries Ollama
β βββ config.py β Reads .env and exposes CONFIG
β βββ sources.py β Data collection (emails, calendar, tasks, news)
βββ deploy/
β βββ setup.sh β Automated installation script
βββ docs/
β βββ commands.md β Full Telegram command reference
β βββ features.md β Feature documentation
βββ notes/
β βββ api.py β Nextcloud Notes interface
β βββ car.py β Car expenses
β βββ medicine.py β Medicine tracking
β βββ shopping.py β Shopping list
β βββ wishlist.py β Wishlist
βββ system/
βββ monitor.py β System monitor (CPU temp, RAM, disk, uptime)
βββ network.py β Network device scanner
By default Ludext uses Llama 3.2 3B, which runs comfortably on a Raspberry Pi 5 with 8 GB RAM. If you have more RAM available:
ollama pull llama3.2:8b # Better quality, needs ~6 GB RAM
ollama pull gemma2:2b # Lighter alternativeThen update OLLAMA_MODEL in your .env.
crontab -l # daily briefing schedule
sudo systemctl status ludext-bot # Telegram bot service
cat ~/ludext.log # daily briefing logs
journalctl -u ludext-bot -n 50 --no-pager # bot logsMIT License β see LICENSE for details.