Skip to content

joebrashear100/context-intelligence-engine

Repository files navigation

🧠 Context Intelligence Engine

A personal intelligence system that aggregates 13 macOS data sources into cross-correlated insights — turning raw digital exhaust into actionable awareness.

What It Does

Instead of drowning in raw data, this engine produces structured intelligence:

Module Description
📊 Weekly Scorecard One-glance summary of your entire week
🏗️ Project Intelligence Tracks projects across calendar, notes, keystrokes, teams, browser, mail, reminders
👥 People Graph Cross-channel interaction map (who you talk to, where, about what)
🎯 Attention Allocation Where your time actually goes (meetings vs. deep work vs. communication)
🚦 Priority Matrix Cross-references reminders + calendar + typed action items
⌨️ Keystroke Intelligence Transforms raw keystroke data into activity sessions, intent classification, topic extraction
📅 Daily Briefings Cross-source reconstruction of each day

Data Sources (13)

Live macOS Databases

  • 📅 Calendar — Events from Apple Calendar via SQLite
  • 📱 Screen Time — App usage from Knowledge Store
  • 📝 Apple Notes — Note titles and modification dates
  • 📧 Mail — Email metadata (sender, subject, dates)
  • 🔔 Reminders — Open tasks via direct SQLite access

DevPulse Logs

  • ⌨️ Keystroke Logger — Text capture with app context
  • 🖥️ App Behavior — App switches and focus events
  • 📂 File System — File creation/modification activity

Dashboard Parsers

  • 👥 Teams — Microsoft Teams messages
  • 💬 iMessage — Conversation metadata
  • 🌐 Browser History — Safari + Brave visits
  • 🐙 GitHub — Git commit activity
  • 💻 Terminal — Command history

Architecture

build_context.py              # Main orchestrator — loads all 13 sources
├── keystroke_intelligence.py  # Keystroke → sessions, intents, topics, focus metrics
├── context_intelligence.py   # Cross-source analysis engine
│   ├── Project Intelligence   # Aggregates project signals across all sources
│   ├── People Graph           # Cross-channel interaction mapping
│   ├── Attention Allocation   # Time distribution analysis
│   ├── Communication Analysis # Cross-channel message patterns
│   ├── Priority Matrix        # Task triage from reminders + typed actions
│   ├── Daily Briefings        # Per-day cross-source narratives
│   └── Weekly Scorecard       # High-level weekly stats
├── run_dashboard_poc.py       # Dashboard data collector
└── new_parsers/               # Individual data source parsers
    ├── calendar_parser.py
    ├── browser_history.py
    ├── imessage_metadata.py
    └── ...

Usage

# Full context build (7 days back, 14 days forward)
python3 build_context.py --days-back 7 --days 14

# Quick summary (markdown only, no JSON export)
python3 build_context.py --summary

# Calendar only
python3 build_context.py --calendar-only

Output

Generates both JSON and Markdown snapshots in context_snapshots/:

  • context_latest.json — Full structured data
  • context_latest.md — Human-readable intelligence report

Key Design Decisions

  1. Direct SQLite > AppleScript — Reads macOS databases directly for instant results (Reminders went from 30s timeout to <1ms)
  2. Session-based analysis — Groups raw keystroke entries into coherent activity sessions by app + time proximity
  3. Intent classification — Automatically labels sessions as AI Prompting, Communication, Coding, Research, etc.
  4. Cross-source correlation — The real value: a project mentioned in Calendar AND Keystrokes AND Teams gets a higher signal score
  5. Privacy-first — No message/email content stored; only metadata and typed text snippets

Requirements

  • macOS (uses native databases)
  • Python 3.10+
  • Full Disk Access permission (for Calendar, Notes, Mail, Screen Time databases)

About

Personal intelligence system — aggregates 13 macOS data sources into cross-correlated insights

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors