Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Napageneral/mnemonic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

112 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧠 Cortex β€” Workspace Intelligence Layer

A unified communications intelligence layer that aggregates, normalizes, and indexes your communications across all channels (iMessage, Gmail, Slack, X DMs, AI sessions, etc.) into a single queryable event store.

The Problem

Your communications are fragmented across channels:

  • iMessage threads
  • Gmail conversations
  • Slack workspaces
  • X/Twitter DMs
  • AI chat sessions (Cursor, ChatGPT)
  • Phone calls / meeting transcripts

Each has its own format, storage, and access patterns. You can't easily ask:

  • "What did Dad and I talk about across all channels last month?"
  • "Show me everything related to the HTAA project"
  • "Who have I communicated with most this year?"

The Solution

Cortex provides:

  1. Unified Event Store β€” All communications normalized into a single schema
  2. Identity Resolution β€” Union-find structure to link identities across channels
  3. Multi-Channel Adapters β€” Eve (iMessage), gogcli (Gmail), aix (AI sessions), etc.
  4. Flexible Querying β€” Slice by person, time, channel, topic, or any combination
  5. Insight Foundation β€” The data layer that powers your personal CRM

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                     Insight Layer (Markdown)                    β”‚
β”‚  User-defined structure: home/people/, home/timeline/, etc.    β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                     Cortex CLI (this project)                   β”‚
β”‚  Orchestrates adapters, owns event store, provides queries     β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                     Unified Event Store (SQLite)                β”‚
β”‚  events, persons, identities, tags tables                       β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                     Channel Adapters                            β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”           β”‚
β”‚  β”‚   Eve   β”‚  β”‚ gogcli  β”‚  β”‚   aix   β”‚  β”‚  ...    β”‚           β”‚
β”‚  β”‚(iMessage)β”‚  β”‚ (Gmail) β”‚  β”‚(Cursor) β”‚  β”‚         β”‚           β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜           β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Quick Start

# Initialize cortex
cortex init

# Configure your identity
cortex me set --name "Tyler Brandt" --phone "+17072876731" --email "[email protected]"

# Connect adapters
cortex connect imessage    # Uses Eve
cortex connect gmail       # Uses gogcli (requires OAuth setup)

# Sync all channels
cortex sync

# Query your communications
cortex events --person "Dad" --since "2025-01-01"
cortex people --top 20
cortex timeline 2026-01

Commands

Setup

Command Description
cortex init Initialize config and event store
cortex me set Configure your identity
cortex connect <channel> Configure an adapter
cortex adapters List configured adapters

Sync

Command Description
cortex sync Sync all connected adapters
cortex sync imessage Sync specific adapter (positional)
cortex sync --adapter imessage Sync specific adapter
cortex sync --full Full repopulation

Query

Command Description
cortex events Query events with filters
cortex people List/search people
cortex people <name> Show person details
cortex timeline <period> Events in time period
cortex db query <sql> Raw SQL access

Identity Management

Command Description
cortex identify List all people + identities
cortex identify --merge <p1> <p2> Union two people
cortex identify --add <person> --email <email> Add identity

Tags

Command Description
cortex tag list List all tags
cortex tag add --filter <filter> --tag <tag> Apply tag to events

Event Schema

CREATE TABLE events (
    id TEXT PRIMARY KEY,
    timestamp INTEGER NOT NULL,
    channel TEXT NOT NULL,
    content_types TEXT NOT NULL,  -- JSON array: ["text"], ["text", "image"]
    content TEXT,
    direction TEXT NOT NULL,      -- sent, received, observed
    thread_id TEXT,
    reply_to TEXT,
    source_adapter TEXT NOT NULL,
    source_id TEXT NOT NULL,
    UNIQUE(source_adapter, source_id)
);

CREATE TABLE persons (
    id TEXT PRIMARY KEY,
    canonical_name TEXT NOT NULL,
    display_name TEXT,
    is_me INTEGER DEFAULT 0,
    relationship_type TEXT
);

CREATE TABLE identities (
    id TEXT PRIMARY KEY,
    person_id TEXT NOT NULL REFERENCES persons(id),
    channel TEXT NOT NULL,
    identifier TEXT NOT NULL,
    UNIQUE(channel, identifier)
);

CREATE TABLE event_participants (
    event_id TEXT NOT NULL REFERENCES events(id),
    person_id TEXT NOT NULL REFERENCES persons(id),
    role TEXT NOT NULL,  -- sender, recipient, cc, observer
    PRIMARY KEY (event_id, person_id, role)
);

CREATE TABLE tags (
    id TEXT PRIMARY KEY,
    event_id TEXT NOT NULL REFERENCES events(id),
    tag_type TEXT NOT NULL,    -- topic, entity, emotion, project, context
    value TEXT NOT NULL,
    confidence REAL,
    source TEXT NOT NULL       -- user, analysis
);

Configuration

Config: ~/.config/cortex/config.yaml (git-tracked in Nexus)

me:
  canonical_name: "Tyler Brandt"
  identities:
    - channel: imessage
      identifier: "+17072876731"
    - channel: email  
      identifier: "[email protected]"

adapters:
  imessage:
    type: eve
    enabled: true
  gmail:
    type: gogcli
    enabled: true
    account: [email protected]

Data: ~/Library/Application Support/Cortex/cortex.db

Adapters

iMessage (via Eve)

# Prerequisite: Eve installed and synced
brew install Napageneral/tap/eve
eve init && eve sync

# Connect
cortex connect imessage

Gmail (via gogcli)

# Prerequisite: gogcli installed and authenticated
brew install steipete/tap/gogcli
gog auth add [email protected]

# Connect
cortex connect gmail --account [email protected]

AI Sessions (via aix)

# Prerequisite: aix installed and synced
# Connect
cortex connect cursor

Development

cd cortex
go mod tidy
make build
./cortex init

License

MIT

About

Unified communications database and sync engine

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages