feat: AI tip generation via Ollama — contextual advice from user signals #79

Closed
opened 2026-04-16 15:25:11 +00:00 by alvis · 0 comments
Owner

Motivation

Currently tips are raw Todoist tasks surfaced as-is. The magic of oO is supposed to be perfectly-timed, insightful advice. An LLM can synthesize signals (tasks, calendar, habits, time-of-day) into a genuinely useful tip that goes beyond "do this task".

Design

New TipGenerator stage in the pipeline:

Signals → Feature extraction → Candidate generation → Ranking (bandit) → Tip rendering → Delivery
                                    ↑                                        ↑
                              Raw tasks (existing)                    LLM polish (new)
                              AI-generated advice (new)

Candidate types:

  1. Task tip (existing): raw Todoist task, ranked by bandit
  2. AI advice tip (new): LLM generates a tip from aggregated signals
  3. Proactive insight (future): pattern-detected nudge ("you always snooze tasks after 9pm")

Ollama integration:

  • Local model (llama3, mistral, or similar) via http://localhost:11434/api/generate
  • Prompt template: user profile summary + recent signals + time context → one concise tip
  • Cache generated tips per context window (avoid re-generating for same state)
  • Fallback to task-only tips if Ollama is unavailable

Tasks

  • Add Ollama client to ml/serving (Python, reuse existing FastAPI)
  • Design prompt template for tip generation
  • New endpoint: POST /generate-tip that takes signals + context → tip text
  • TipGenerator interface in recommender for pluggable generation strategies
  • Integrate with candidate pipeline (AI tips compete with task tips in bandit)
  • Reward signal for AI-generated tips (same dwell-time model)
  • Rate limit: max N generated tips per user per day (cost/quality tradeoff)
  • ADR for LLM tip generation architecture
## Motivation Currently tips are raw Todoist tasks surfaced as-is. The magic of oO is supposed to be *perfectly-timed, insightful advice*. An LLM can synthesize signals (tasks, calendar, habits, time-of-day) into a genuinely useful tip that goes beyond "do this task". ## Design New `TipGenerator` stage in the pipeline: ``` Signals → Feature extraction → Candidate generation → Ranking (bandit) → Tip rendering → Delivery ↑ ↑ Raw tasks (existing) LLM polish (new) AI-generated advice (new) ``` ### Candidate types: 1. **Task tip** (existing): raw Todoist task, ranked by bandit 2. **AI advice tip** (new): LLM generates a tip from aggregated signals 3. **Proactive insight** (future): pattern-detected nudge ("you always snooze tasks after 9pm") ### Ollama integration: - Local model (llama3, mistral, or similar) via `http://localhost:11434/api/generate` - Prompt template: user profile summary + recent signals + time context → one concise tip - Cache generated tips per context window (avoid re-generating for same state) - Fallback to task-only tips if Ollama is unavailable ## Tasks - [ ] Add Ollama client to `ml/serving` (Python, reuse existing FastAPI) - [ ] Design prompt template for tip generation - [ ] New endpoint: `POST /generate-tip` that takes signals + context → tip text - [ ] `TipGenerator` interface in recommender for pluggable generation strategies - [ ] Integrate with candidate pipeline (AI tips compete with task tips in bandit) - [ ] Reward signal for AI-generated tips (same dwell-time model) - [ ] Rate limit: max N generated tips per user per day (cost/quality tradeoff) - [ ] ADR for LLM tip generation architecture
alvis added this to the M2 — AI tips + multi-source signals milestone 2026-04-16 15:25:11 +00:00
alvis closed this issue 2026-04-17 14:22:49 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: alvis/oO#79