Documentation

Quick Start

One command to set up memory for your AI agent:

npx cortex-memory-init

This will open the dashboard to create an API key, detect your installed editors (Claude, Kiro, Cursor), and configure them automatically.

Or if you already have a key:

npx cortex-memory-init ctx_your_key_here

MCP Server (Recommended)

The fastest way to add memory to any MCP-compatible agent.

// Add to your MCP client config (Claude, Kiro, etc.)
{
  "mcpServers": {
    "cortex": {
      "command": "npx",
      "args": ["cortex-memory-mcp"],
      "env": {
        "CORTEX_API_KEY": "ctx_your_key_here"
      }
    }
  }
}

REST API

Save a Memory

POST /memories
Authorization: Bearer ctx_your_key

{
  "content": "User prefers dark mode and Python",
  "tags": ["preference"],
  "agent_id": "my-agent"
}

Search Memories

GET /memories/search?q=user+preferences&limit=5
Authorization: Bearer ctx_your_key

Update a Memory

PUT /memories/{memory_id}
Authorization: Bearer ctx_your_key

{
  "content": "User prefers dark mode, Python, and VS Code",
  "tags": ["preference"]
}

Delete a Memory

DELETE /memories/{memory_id}
Authorization: Bearer ctx_your_key

Authentication

All API requests require a valid API key passed in the Authorization header as a Bearer token. Keys are scoped to your account — your memories are private and isolated.