trace-cortex/cortex-app

Cortex local-first personal memory app

The problem it solves

Every AI chatbot starts from zero each time. Cortex keeps a running model of who you are and how you work — built from your own notes and past AI conversations — and loads that model into your tools, so they answer the way you would. Everything runs on your own Mac by default, no cloud account required.

The core loop (4 steps)

Step What happens
Connect Bring in local notes (e.g. Obsidian), an AI-chat export, or sign in and import your history
Review You approve what's useful, archive the noise — your memory stays trustworthy
Ask Get cited answers yourself, or let a connected AI tool retrieve only what you've approved
Control Every read, save, export, and tool connection stays visible and revocable

Five systems that make it work

  • It dreams — A background pass runs while you're away: it resolves only contradictions that pass deterministic safety rules (your original sources stay authoritative, every decision is logged) and pre-warms verified "hot-context" packs, so the next request comes from a checked cache.
  • It recalls associatively — Retrieval walks a trust-aware knowledge graph with budgeted multi-hop recall, including a personalized-PageRank mode that surfaces what's connected to your query, not just lexically similar. Every hop carries provenance.
  • It packs context as a protocol — The Contextual Memory Protocol (CMP) packs a model-calibrated envelope with a token-aware knapsack, then runs a per-session delta channel that never re-sends what an agent already holds. Retrieval fuses BM25 full-text, sqlite-vec vector similarity, temporal, and intent signals, reranks on-device, and cites sources or abstains rather than guessing.
  • It models judgment — Deterministic extractors and an LLM condenser build seven typed layers (voice, preferences, decisions, facts, episodic, entities, topics) into a whole-person map. Agents call GET /v1/agent-adaptation to load your calibration brief before they work.
  • It compounds as an asset you own — Packs are SHA256-addressed and replayable. The model lives as plain Markdown plus a rebuildable index on your Mac, vendor-portable, inspectable, and erasable in one act. Switch assistants — your model comes with you.

How it's built

Layer Choice
App Native SwiftUI app for macOS 13+ (Developer ID signed, Apple-notarized)
Engine Local FastAPI server on 127.0.0.1:8766
Storage SQLite (full-text + sqlite-vec vectors), mirrored to a human-readable, Obsidian-style vault you own
Protocol MCP (Model Context Protocol) for connecting to AI tools; CMP (Contextual Memory Protocol) for packing context

Then: Sources → Review inbox → Layered memory → Profile + knowledge graph → Context Assembly Engine → Your AI tools (Claude Desktop, Cursor, Windsurf, Zed, any MCP client).

Trust, privacy, and sync

  • Local-first by default — no account, no cloud, no ambient recording (no screen, no microphone). Cortex reads a source only after you explicitly connect it.
  • Trust controls — Scoped, revocable per-tool permissions, with redaction on by default.
  • Optional cloud sync — An end-to-end-encryption design for multi-device sync; opt-in and account-based, data stays local unless you turn it on.

Install & build

  • Install: Download the latest DMG (macOS 13+), drag Cortex into Applications, launch (opens with no warning — Apple-notarized), then point it at a notes folder, import AI chats, review, and connect a tool. It auto-updates.
  • Build from source: ./macos/build.sh for the SwiftUI app; for the backend engine, use Python 3.11+, a venv, pip install -r backend/runtime-requirements.txt, then run pytest backend/tests; an offline retrieval-quality gate runs via python3 scripts/retrieval_eval.py.

Who's behind it

Built at the University of Waterloo (Faculty of Engineering) as an applied research project on local-first personal operating models, sponsored by Composio. Released under the MIT License, © 2026 Doppl.

Related

  • Project
  • Project
  • Project
  • Project