Knowledge Graph Schema for Contextual AI Assistant

This document outlines the comprehensive knowledge graph schema for the Contextual AI Assistant, focusing on the Neo4j graph database component. The schema is designed to capture rich relationships between entities across different applications while maintaining flexibility for future expansion.

1. Node Types

1.1 Core Entity Nodes

Node Label Description Key Properties
Person Represents individuals (users, contacts, team members) id, name, role, email
Message Communication content across platforms id, content, timestamp, status
Document Files, notes, and other text content id, title, content, type
Task Activities, to-dos, and assignments id, title, description, status, priority, due_date
Event Meetings, deadlines, and calendar items id, title, description, start_time, end_time
Team Groups of people working together id, name, description
Project Work initiatives containing tasks id, name, description, status
PullRequest Code review requests id, number, title, description, status, repo
Comment Remarks on various entities id, content, timestamp
Application Software applications being used id, name, type

1.2 Special Nodes

Node Label Description Key Properties
User The central user of the system id, name, preferences
Context Captures situational context id, type, timestamp, metadata
ScreenCapture Raw screen data point id, timestamp, content_hash, app_type

2. Relationship Types

2.1 Communication Relationships

Relationship Type Source → Target Description Key Properties
AUTHORED PersonMessage Person created a message timestamp
RECEIVED_BY MessagePerson Message was received by person read_status, timestamp
REPLIED_TO MessageMessage Message is a reply to another timestamp
MENTIONS MessagePerson Message mentions a person context
REFERENCES Message{Document\|Task\|PullRequest} Message refers to another entity context

2.2 Organizational Relationships

Relationship Type Source → Target Description Key Properties
MEMBER_OF PersonTeam Person belongs to team role, join_date
WORKS_ON PersonProject Person works on project role, start_date
ASSIGNED_TO TaskPerson Task is assigned to person assignment_date
PART_OF TaskProject Task belongs to project priority
REPORTS_TO PersonPerson Reporting relationship relationship_type

2.3 Content Relationships

Relationship Type Source → Target Description Key Properties
CREATED Person{Document\|Task\|PullRequest} Person created content timestamp
COMMENTED_ON Person{Document\|Task\|PullRequest} Person commented on content timestamp
MODIFIED Person{Document\|Task\|PullRequest} Person modified content timestamp
REVIEWED PersonPullRequest Person reviewed PR approval_status, timestamp
RELATED_TO {Document\|Task\|PullRequest}{Document\|Task\|PullRequest} Content items are related relationship_type

2.4 Temporal Relationships

Relationship Type Source → Target Description Key Properties
SCHEDULED PersonEvent Person scheduled event timestamp
ATTENDING PersonEvent Person attending event response_status
PRECEDES {Task\|Event}{Task\|Event} Temporal ordering gap_duration
DEADLINE_FOR Event{Task\|Project} Event is a deadline importance

2.5 Application Context Relationships

Relationship Type Source → Target Description Key Properties
CAPTURED_IN {Message\|Document\|Task\|PullRequest}Application Entity was observed in app timestamp
DERIVED_FROM {Any Entity}ScreenCapture Entity extracted from screen confidence
INTERACTED_WITH PersonApplication Person used application timestamp, duration

2.6 Context Relationships

Relationship Type Source → Target Description Key Properties
IN_CONTEXT {Any Entity}Context Entity appeared in context relevance_score
CONTEXT_TRANSITION ContextContext Sequential contexts transition_type
USER_FOCUS User{Any Entity} User was focusing on entity duration, timestamp