Cortex AI
Every time you explain to an AI assistant what file you're looking at or what meeting you just left, you're providing context your computer already has. Cortex AI connects that context to any MCP-compatible coding assistant, without anything leaving your machine.
Cortex AI runs as an MCP server on macOS. It continuously indexes your local environment: screen activity via OCR, calendar events, git history, shell commands, and browser history. AI coding assistants can then query this context to understand what you are working on without you manually explaining it.
It scores items by relevance (recency, text similarity, source diversity, user feedback) and serves ranked context on demand. I chose SQLite with FTS5 over any external database because this runs on a developer's laptop, not a server, and the query performance is identical for this workload.
All data stays local in ~/.cortex/. Nothing leaves your machine.
Architecture
The system has four layers: connectors that ingest data from five macOS sources, a SQLite storage layer with full-text search, an intelligence engine that scores and correlates signals, and an MCP server that exposes 20+ tools to AI assistants.
Connectors
Five connectors continuously sync data from macOS sources into a normalized schema.
| Source | Method | Data Captured |
|---|---|---|
| Calendar | JXA (macOS native) | Events, attendees, times |
| Screen | screenpipe OCR | Active apps, visible text |
| Git | CLI | Commits, branches, diffs |
| Shell | History file | Recent commands |
| Browser | SQLite DBs | URLs, titles, timestamps |
Tools
The MCP server exposes 20+ tools that AI coding assistants can call to query context.
| Category | Tools | Purpose |
|---|---|---|
| Context | get_context, search, briefing | Ranked context retrieval |
| Schedule | get_schedule, meeting_prep | Calendar and meeting context |
| Activity | get_activity, get_git, get_shell | Recent work activity |
| Intelligence | work_streams, find_entity | Pattern detection |
| Admin | status, sync, feedback, purge | System management |