-
Notifications
You must be signed in to change notification settings - Fork 0
Setup
- Download Cortex.dmg from Releases
- Drag Cortex.app to
/Applications - Strip the quarantine attribute:
xattr -cr /Applications/Cortex.app
- Open Cortex from Applications
- Follow the setup wizard to configure your LLM backend and grant permissions
- Use the in-app Connect Chrome/Edge button to install the browser extension
The desktop app bundles the daemon, dashboard, and system tray. No Python, Node.js, or terminal setup required.
| Requirement | Install |
|---|---|
| macOS 13+ (Ventura or later) | Required — Linux/Windows not supported |
| Python 3.11 or 3.12 |
brew install python@3.11 or python.org
|
| Node.js 18+ |
brew install node or nodejs.org
|
| pnpm | npm install -g pnpm |
| LLM backend | AWS Bedrock (default), GCP Vertex, or direct Anthropic API — see Provider Setup |
| Redis (optional) |
brew install redis && brew services start redis — auto-falls back to in-memory |
Apple Silicon: Use native ARM Python, not Rosetta. Verify:
python3 -c "import platform; print(platform.machine())"should printarm64.
git clone https://github.com/StevenWang-CY/cortex.git
cd cortex # repo root
python3 -m venv .venv
source .venv/bin/activateCopy the example config:
cp cortex/.env.example .envCortex talks to Claude exclusively via the Anthropic SDK. Three transport providers ship today, all selected with a single env var:
CORTEX_LLM__PROVIDER=bedrock # default — AWS Bedrock
# CORTEX_LLM__PROVIDER=vertex # GCP Vertex AI
# CORTEX_LLM__PROVIDER=direct # Anthropic API (ANTHROPIC_API_KEY)The same value is mirrored into ANTHROPIC_PROVIDER at startup so the
underlying SDK picks the right transport.
CORTEX_LLM__PROVIDER=bedrock
CORTEX_LLM__BEDROCK__AWS_REGION=us-east-2The bearer token lives in macOS Keychain — never in .env:
security add-generic-password -s cortex.bedrock -a bearer_token -w YOUR_BEDROCK_TOKEN
# CORTEX_LLM__USE_KEYCHAIN=true is the default; the daemon reads
# from Keychain and exports AWS_BEARER_TOKEN_BEDROCK for the SDK.CORTEX_LLM__PROVIDER=vertexAuthenticate Vertex per the standard gcloud flow (gcloud auth application-default login). The Anthropic SDK reads the resulting
credentials directly.
CORTEX_LLM__PROVIDER=direct
export ANTHROPIC_API_KEY=sk-ant-...Useful when you have an Anthropic API key and want to bypass the Bedrock / Vertex transports.
If every transport fails the daemon falls back to a deterministic
rule-based plan (CORTEX_LLM__FALLBACK_MODE=rule_based, the default),
so a missing key never crashes the session — you just lose the
LLM-generated copy until the provider comes back.
Leave CORTEX_CAPTURE__DEVICE_ID commented out for automatic selection. Cortex will:
- Enumerate cameras via AVFoundation
- Skip iPhone/iPad Continuity Camera devices
- Prefer the MacBook's built-in camera
- Probe only non-Continuity indices as fallback
- Reject any camera it cannot verify by name
Camera selection runs once at daemon startup. Restart the daemon after turning off an iPhone.
To override:
CORTEX_CAPTURE__DEVICE_ID=0 # or 1, 2, etc.pip install -e "./cortex[dev]"Verify:
python -c "from cortex.libs.config.settings import get_config; print(f'LLM provider: {get_config().llm.provider}')"python -m cortex.scripts.seed_config --root .Creates the storage/ directory tree and a default baseline profile.
Cortex needs two permissions, both prompted automatically on first use:
Camera — macOS asks when the daemon first opens the webcam. Click Allow.
Input Monitoring — required for keyboard/mouse telemetry:
System Settings → Privacy & Security → Input Monitoring → add your terminal app
If you launch the daemon from the browser extension, it runs via Terminal.app — grant permission to Terminal.app specifically.
source .venv/bin/activate
cortex-devStarts:
- REST API on
http://127.0.0.1:9472 - WebSocket on
ws://127.0.0.1:9473 - All capture, signal processing, state engine, and intervention services
cortex-captureOpens a window showing the webcam feed with face detection overlays and FPS counter. Press q to quit.
cd cortex/apps/browser_extension
pnpm install| Browser | Build | Load from |
|---|---|---|
| Chrome | npx plasmo build |
chrome://extensions → Developer mode → Load unpacked → build/chrome-mv3-prod/
|
| Edge | npx plasmo build --target=edge-mv3 |
edge://extensions → Developer mode → Load unpacked → build/edge-mv3-prod/
|
For development with hot reload: pnpm dev
cd /path/to/repo-root
python -m cortex.scripts.install_native_hostThis auto-detects all installed Chromium browsers and patches native_host.py with the absolute venv Python path. No manual extension ID needed.
Then fully restart your browser (Cmd+Q, reopen). Native messaging manifests only load at browser startup.
First-time dialogs:
- macOS: "Chrome/Edge wants to control Terminal. Allow?" — click Allow (one-time)
- A Terminal window opens when the daemon starts — this is normal
cortex-calibrate --duration 120Sit relaxed for 2 minutes while Cortex learns your resting heart rate, HRV, blink rate, and posture. Results saved to storage/baselines/. See Calibration for details.
cd cortex/apps/vscode_extension
npm install && npm run compile
code --install-extension cortex-somatic-0.1.0.vsixProvides editor context (open file, diagnostics, cursor position) to the daemon for more accurate interventions.
pytest # all tests
pytest tests/unit/ # unit tests only
pytest tests/integration/ # integration tests
pytest --cov=cortex --cov-report=html # with coverage
pytest -m "not requires_webcam" # skip hardware tests