Installation
Get Cortex up and running in minutes.
Quick Start
The fastest way to get started with Cortex:
Install the CLI
Install Cortex globally:
$ brew install cortex-memory/tap/cli$ npm install -g @cortexmemory/cliVerify installation
Check that the CLI is installed correctly:
$ cortex --versionShould output: 0.27.4 or higher
Create your first project
Initialize a new Cortex project:
$ cortex init my-cortex-agentThe interactive wizard will guide you through setup in under 5 minutes.
Prerequisites
Before installing Cortex, ensure you have:
Required:
- Node.js >= 20 — Download from nodejs.org
- npm or pnpm — Comes with Node.js
Check your versions:
$ node --version && npm --versionExpected output: Node.js v20.0.0+ and npm 9.0.0+
Convex Account — For cloud deployments (free tier available)
- Sign up at convex.dev
- Required for vector search features
- Not needed for local development
Docker Desktop — For graph database features
- Download from docker.com
- Only needed for advanced graph queries
- Not required for basic Cortex usage
OpenAI API Key — For embeddings
- Get from platform.openai.com
- Or use any other embedding provider
- Cortex works without embeddings (keyword search)
Installation Methods
Method 1: Global Installation (Recommended)
Install the CLI globally to use it from anywhere:
$ brew install cortex-memory/tap/cliHomebrew handles PATH configuration automatically and makes updates easy with brew upgrade.
$ npm install -g @cortexmemory/cli$ yarn global add @cortexmemory/cli$ pnpm add -g @cortexmemory/cliVerify installation:
$ cortex --versionNow create projects anywhere:
$ cortex init my-agent && cortex startThe CLI uses persistent config with absolute paths, so cd is not required.
Method 2: Using npx (No Installation)
Use the CLI without installing it globally:
$ npx @cortexmemory/cli init my-agent- One-time project creation
- Testing before global install
- CI/CD environments
Trade-off: Slightly slower (downloads each time)
Method 3: Project-Specific Installation
Install as a dev dependency in your project:
$ npm install --save-dev @cortexmemory/cli$ yarn add --dev @cortexmemory/cli$ pnpm add -D @cortexmemory/cliAdd to package.json:
{"scripts": { "cortex": "cortex", "dev": "cortex dev", "start": "cortex start", "stop": "cortex stop"}}Then run:
$ npm run cortex init && npm run devVerification
After installation, verify everything works:
Check CLI Installation
$ cortex --versionShould show: 0.27.4 or higher
$ cortex --helpShould display available commands
Test CLI Connection
$ cortex init test-projectStart services (from any directory):
$ cortex startCheck status:
$ cortex statusVerify Convex Dashboard
For local development: Open http://127.0.0.1:3210
For cloud deployment:
$ cortex convex dashboardOpens your deployment in browser
Troubleshooting
Cause: CLI not installed or not in PATH
Fix (Recommended):
$ brew install cortex-memory/tap/cliAlternative (npm):
$ npm install -g @cortexmemory/cliIf using npm, check global bin path is in your PATH:
$ npm config get prefixPossible causes:
- Node.js version < 20
- No internet connection
- npm permissions
Fix (Recommended):
Update Node.js to v20+, then reinstall via Homebrew:
$ brew reinstall cortex-memory/tap/cliAlternative (npm):
$ npm cache clean --force && npm install -g @cortexmemory/cliCause: Dependencies not installed in project
Fix:
$ cd your-project && npm installCause: Convex server not running
Fix:
$ cortex startIf issues persist, restart:
$ cortex stop && cortex startCause: Another Convex instance on same port
Fix: Use interactive dev mode:
$ cortex devPress k to kill conflicting processes.
# General help
cortex --help
# Command-specific help
cortex <command> --help
Still stuck?
Upgrading
To upgrade to the latest version:
$ brew upgrade cortex-memory/tap/cli$ npm install -g @cortexmemory/cli@latest$ yarn global upgrade @cortexmemory/cli$ pnpm add -g @cortexmemory/cli@latestVerify new version:
$ cortex --versionUpdate SDK and Convex in your projects:
$ cortex updateThe cortex update command will:
- Check for newer versions of
@cortexmemory/sdk - Check for newer versions of
convex - Offer to update all projects
- Redeploy backend if needed
Note: The CLI stores project paths in its config, so you can run cortex update from any directory.
Uninstalling
If you need to uninstall:
$ npm uninstall -g @cortexmemory/cli$ yarn global remove @cortexmemory/cli$ pnpm remove -g @cortexmemory/cliRemove from a project:
$ cd your-project && npm uninstall @cortexmemory/sdk convexClean up configuration (optional):
$ rm ~/.cortexrc