AI Summaries & Digests
Demo: AI Digest Generation
This recording shows the complete digest generation flow — from configuring the modal to receiving the AI-formatted digest DM, with the Notion digest page appearing on the right side.
Features Demonstrated
- Digest Generation Modal — Configure category, date range, item limit, and distribution options
- Three Date Modes — Last N days, explicit date range, or all-time
- AI Highlight Generation — Each knowledge item gets a 2-3 sentence AI-generated summary in Dutch
- Formatted Digest DM — The compiled digest arrives as a rich Slack message with read times, tags, and Notion links
- Notion Digest Sync — The complete digest is persisted as a Notion page with all highlights and statistics
One of YapHub's core capabilities is automatically generating concise, Dutch-language AI summaries for knowledge items. These summaries power the digest system and provide quick context without reading full articles.
How It Works
When a digest is generated, the system automatically creates a 2–3 sentence AI summary (called a "highlight") for each knowledge item that doesn't already have one. This lazy-generation approach means summaries are only produced when needed.
The AI Prompt
The system uses a single, optimised prompt designed for concise Dutch summaries:
Summarize the following content in 2-3 sentences (in Dutch). If it's a link or short title, infer its context from the extracted text.
The prompt receives three inputs per knowledge item:
- Title — the knowledge item's title
- URL — the source URL (if any)
- Content — the full text content (user input + extracted URL content)
AI Configuration
| Parameter | Value | Rationale |
|---|---|---|
| Temperature | 0.3 | Low creativity for consistent, factual summaries |
| Max Tokens | 150 | Keeps summaries concise (2-3 sentences) |
| Language | Dutch | All summaries are in Dutch |
| Provider | OpenAI / OpenRouter | Configurable via environment variables |
Fallback Behaviour
If the AI call fails (network error, rate limit, etc.), the system falls back to truncating the original content to 200 characters. This ensures digest generation never blocks on AI failures.
Where Summaries Live
AI summaries are stored in two places:
Knowledge.highlight— The primary storage. ATEXTfield on each Knowledge entity holding the 2-3 sentence Dutch summary.Digest.knowledgeHighlights— A JSON snapshot captured at digest generation time. Each entry includes{id, title, highlight, aiSummary, notionUrl, tags, createdAt}. This makes digests immutable — even if the source knowledge changes later, the digest preserves the original output.
The 8-Step Digest Pipeline
When you click "Genereren", the backend runs a full pipeline:
- Category Resolution — Validates the selected category exists and is active
- Date Range Parsing — Converts your input into exact start/end dates (supports absolute dates, relative like "7 days", and Dutch phrases)
- Knowledge Query — Fetches all knowledge items in the category within the date range, ordered by creation date
- AI Highlight Generation — For each knowledge item, calls OpenAI GPT-4o-mini to generate a 2-3 sentence Dutch summary. Falls back to truncation if AI fails
- Content Formatting — Transforms all highlights into structured Dutch Markdown: header section + per-item blocks with AI summary, tags, read time, and Notion link
- Entity Creation — Builds the Digest entity with title, content, statistics (highlight count, token count, generation cost, duration)
- Persistence — Saves the digest to the database
- Notion Sync — Creates a full Notion page for the digest with all highlights, statistics, and links back to original knowledge items
Digest Generation Modal
Click "Digest maken" (Generate Digest) from the App Home quick actions or from a category's overflow menu. The modal provides:
| Field | Description | Default |
|---|---|---|
| Lijst (Category) | Required — which category to generate for | First category |
| Item Limiet (Item Limit) | Cap the number of items included | No limit |
| Dagen (Days) | "Last N days" value | 7 |
| Startdatum (Start Date) | Explicit start date (date picker) | — |
| Einddatum (End Date) | Explicit end date (date picker) | — |
| Datummodus (Date Mode) | Radio: Last N days / Date range / All time | Last N days |
| Deel via DM (Share via DM) | Auto-distribute after generation | Unchecked |
Three Date Modes
- "Afgelopen N dagen" (Last N days) — Default. Enter a number (e.g., 7 for the past week)
- "Datumbereik" (Date range) — Pick explicit start and end dates using Slack's date pickers
- "Alles" (All time) — No date filter. Includes all knowledge items ever added to the category
The Formatted Digest DM
You receive a rich Slack DM containing:
- Header block — Category name, total items included, date range, total estimated read time
- Per-item blocks — Each knowledge item as a section with:
- Title (linked to Notion page)
- AI-generated 2-3 sentence highlight summary
- Tags (if any)
- Estimated read time (based on 200 WPM)
- The message automatically handles Slack's 48-block limit and 2900-character text limit by chunking into multiple messages if needed
Provider Architecture
The AiProviderInterface abstraction allows switching between AI providers without changing business logic. The current implementation supports OpenAI and OpenRouter, configurable via the OPENAI_API_URL environment variable.