Entities & Data Models
Last Updated: 2026-03-09 Version: 2.0 (Consolidated)
The Yappa Knowledge Hub data model is centered around the relationship between captured information, thematic organization, and AI-driven insights.
Entity Relationship Diagram
Primary Entities
🏮 Knowledge Items
The core unit of information. It stores user-submitted content, scraped URL metadata, and links to the source Slack message. It is the parent of all AI summaries.
📘 Thematic Lists (Categories)
Logical groupings for knowledge. Categories define default target groups and serve as the basis for periodic Digest Reports.
👥 Roles
Defines the target audiences for AI summaries (e.g., Developers, Sales, Management). Roles are managed dynamically and determine which prompt templates are used.
🤖 AI Summaries
Versioned, role-specific content generated by GPT-4. These entities track manual edits and are synced back to Notion.
📝 Prompt Templates
The specific instructions sent to the AI. Templates follow an inheritance chain (Global → Category-specific) to provide the most relevant summary possible.
Technical Details
Storage Strategy
- Primary Source: Notion Databases (Cloud).
- Cache Layer: SQLite (Local) via Doctrine ORM.
- Mapping: Standardized via
NotionPropertyMapperand individual Domain Services.
Key Patterns
- Immutability: New versions are created for content changes to preserve history.
- Fluent Interfaces: Entities use standard Symfony/Doctrine patterns for relationship management.
- Notion Linking: All primary entities store
notionIdandnotionUrlfor bidirectional navigation.
NOTE
For the raw SQL schema and indexing strategy, refer to the Database Documentation.
Detailed Entity Guides
For in-depth technical specifications, property lists, and usage examples, refer to the following guides:
🏮 Knowledge Entity
Detailed documentation on the Knowledge domain model, its properties, and Slack-to-Notion mapping.
📘 Category Entity
Understanding how "Thematic Lists" are structured and how they organize the Hub.
👥 Role Entity
Technical details on the audience management system and AI target routing.
🤖 AiSummary Entity
Documentation on versioned summaries, tracking manual edits, and AI metadata.
📝 Prompt Template Entity
Understanding the AI instruction hierarchy and variable injection system.
Technical Context
- Persistence: Managed via Doctrine ORM with an SQLite 3 driver.
- Migrations: Found in
migrations/— always runphp bin/console doctrine:migrations:migrateafter updating entities. - Validation: All entities use Symfony
Assertattributes for data integrity.
TIP
Use the Database Schema Guide if you need to perform raw SQL queries or understand the underlying table indexes.