Quickstart

Get up and running with Cortex in 5 minutes.

This guide walks you through installing Cortex, pushing your first memory, and connecting an AI agent.

Prerequisites

  • Node.js 18 or later
  • A Cortex instance (cloud or self-hosted)
  • An agent key (obtained from the dashboard)

Step 1: Install the CLI

npm install -g @cortex-labs/cli

Verify the installation:

cortex --version

Step 2: Authenticate

Log in with your agent key from the dashboard:

cortex login --key crtx_YOUR_KEY_HERE --url https://your-cortex-host

Agent keys look like crtx_... and are created in the Cortex dashboard under Agents. Each key authenticates as the human it acts for, so every write is scope-filtered and audited.

Verify your identity:

cortex whoami

Expected output:

John Doe <john@company.com> — role IC, level Senior
Endpoint: https://your-cortex-host

Step 3: Push Your First Memory

Create a file with some knowledge you want to store:

# API Rate Limiting

All external API endpoints must implement rate limiting:
- Public APIs: 100 requests/minute per IP
- Authenticated APIs: 1000 requests/minute per user
- Internal APIs: unlimited

Use Redis sliding window for tracking.

Push it to Cortex:

cortex push ./api-conventions.md --title "API Rate Limiting Policy" --scope engineering

Step 4: Connect an AI Agent

Claude Code

claude mcp add --transport http cortex https://your-cortex-host/mcp \
  --header "Authorization: Bearer crtx_YOUR_KEY_HERE"

Cursor

Add to .cursor/mcp.json:

{
  "mcpServers": {
    "cortex": {
      "url": "https://your-cortex-host/mcp",
      "headers": {
        "Authorization": "Bearer crtx_YOUR_KEY_HERE"
      }
    }
  }
}

Step 5: Recall Memories

Your agent can now search Cortex. Try asking Claude:

"What's our rate limiting policy for external APIs?"

The agent will use the recall tool to find relevant memories with full citations.

What Just Happened?

sequenceDiagram
    participant User
    participant CLI as Cortex CLI
    participant API as Cortex API
    participant DB as PostgreSQL + Qdrant

    User->>CLI: cortex push api-conventions.md
    CLI->>API: POST /api/memories
    API->>API: Resolve scope & clearance
    API->>DB: Insert memory + vector
    API-->>CLI: Memory stored with ID
    CLI-->>User: ✓ Pushed memory
    
    Note over User,DB: Later...
    
    User->>User: Asks Claude about rate limiting
    Claude->>API: recall("rate limiting policy")
    API->>API: Check RBAC permissions
    API->>DB: Vector search (scoped)
    API-->>Claude: Memory with citation
    Claude-->>User: Answer with source

Next Steps