Skip to content

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 notionId for bidirectional Notion sync

Entity Definition

  • Location: src/Entity/Knowledge.php
  • Repository: src/Repository/KnowledgeRepository.php
  • Table: knowledge

Properties

PropertyTypeRequiredDescription
idintAutoPrimary key
titlestringYesItem title (max 255 chars)
contenttextYesMain body text (supports Markdown)
tagsarray (JSON)NoTags for categorization
targetGroupsarray (JSON)NoAudience labels
userIdstringNoSlack user ID of creator
statusstringNoLifecycle status (default: 'pending')
urlstringNoSource URL (max 500 chars)
urlMetadataarray (JSON)NoScraped OpenGraph/URL metadata
sourceMessagearray (JSON)NoOriginal Slack message data (event_id, user_id)
attachmentsarray (JSON)NoSlack file attachments
summariesarray (JSON)NoSummary metadata
highlighttextNoAI-generated 2-3 sentence Dutch summary
createdAtDateTimeImmutableAutoCreation timestamp (Gedmo)
updatedAtDateTimeImmutableAutoUpdate timestamp (Gedmo)

Notion Integration

PropertyTypeDescription
notionIdstringNotion page ID
notionUrlstringNotion page URL (max 2048 chars)
lastSyncedAtDateTimeImmutableLast sync timestamp
notionLastEditedAtDateTimeImmutableLast edit in Notion

Relationships

PropertyTypeDescription
categoryManyToOneLink to Category entity (FK, ON DELETE SET NULL)

Indexes

  • category_id — Fast lookups by category
  • notion_id — Notion sync resolution
  • status — Filtering by lifecycle status
  • user_id — Filtering by creator

Capture Methods

Knowledge items enter the system through three Slack entry points:

MethodTriggerHandler
Message ShortcutRight-click → "Add to YapHub"shortcuts.ts
Global ShortcutLightning bolt → "Quick Add"shortcuts.ts
App Home Button"Add Knowledge" buttonactions.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).