Knowledge Entity
Last Updated: 2026-05-08
The Knowledge entity is the core data unit — a single piece of information captured from Slack, the web, or manual entry.
Core Purpose
- Source of Truth: Maps information to its original source (Slack message, URL)
- AI Context: Provides the raw text for AI summary generation
- Sync Anchor: Uses a
notionIdfor bidirectional Notion sync
Entity Definition
- Location:
src/Entity/Knowledge.php - Repository:
src/Repository/KnowledgeRepository.php - Table:
knowledge
Properties
| Property | Type | Required | Description |
|---|---|---|---|
id | int | Auto | Primary key |
title | string | Yes | Item title (max 255 chars) |
content | text | Yes | Main body text (supports Markdown) |
tags | array (JSON) | No | Tags for categorization |
targetGroups | array (JSON) | No | Audience labels |
userId | string | No | Slack user ID of creator |
status | string | No | Lifecycle status (default: 'pending') |
url | string | No | Source URL (max 500 chars) |
urlMetadata | array (JSON) | No | Scraped OpenGraph/URL metadata |
sourceMessage | array (JSON) | No | Original Slack message data (event_id, user_id) |
attachments | array (JSON) | No | Slack file attachments |
summaries | array (JSON) | No | Summary metadata |
highlight | text | No | AI-generated 2-3 sentence Dutch summary |
createdAt | DateTimeImmutable | Auto | Creation timestamp (Gedmo) |
updatedAt | DateTimeImmutable | Auto | Update timestamp (Gedmo) |
Notion Integration
| Property | Type | Description |
|---|---|---|
notionId | string | Notion page ID |
notionUrl | string | Notion page URL (max 2048 chars) |
lastSyncedAt | DateTimeImmutable | Last sync timestamp |
notionLastEditedAt | DateTimeImmutable | Last edit in Notion |
Relationships
| Property | Type | Description |
|---|---|---|
category | ManyToOne | Link to Category entity (FK, ON DELETE SET NULL) |
Indexes
category_id— Fast lookups by categorynotion_id— Notion sync resolutionstatus— Filtering by lifecycle statususer_id— Filtering by creator
Capture Methods
Knowledge items enter the system through three Slack entry points:
| Method | Trigger | Handler |
|---|---|---|
| Message Shortcut | Right-click → "Add to YapHub" | shortcuts.ts |
| Global Shortcut | Lightning bolt → "Quick Add" | shortcuts.ts |
| App Home Button | "Add Knowledge" button | actions.ts |
AI Summary
The highlight field stores a lazy-generated 2-3 sentence Dutch summary. Generated during digest creation using KnowledgeHighlightGenerator. If AI fails, falls back to truncated content (200 chars).