Add persistent memory to Eliza AI agents.

Eliza Integration

CortexDB integrates with the Eliza agent framework to provide persistent, cross-session memory.

Installation

npm install cortexdbai

Setup

import { createAgent } from "eliza";
import { cortexPlugin } from "cortexdbai";

const agent = createAgent({
  plugins: [
    cortexPlugin({
      apiKey: process.env.CORTEX_API_KEY!,
      tenantId: "my-app",
    }),
  ],
});

// The plugin automatically:
// 1. Recalls relevant context before the agent responds
// 2. Stores conversation turns in CortexDB
// 3. Provides memory tools the agent can invoke directly

Plugin Capabilities

The Eliza plugin provides:

| Capability | Description | |---|---| | Auto-recall | Automatically fetches relevant memories for each conversation turn | | Auto-remember | Stores conversation turns after agent response | | Memory tools | remember, recall, forget available as agent actions |

Configuration

| Parameter | Default | Description | |---|---|---| | apiKey | $CORTEX_API_KEY | CortexDB API key | | tenantId | Required | Tenant identifier | | autoRecall | true | Auto-recall on each turn | | autoRemember | true | Auto-store conversation turns |

Under the Hood

The integration wrapper maps to CortexDB's REST API:

# remember("User prefers dark mode")
curl -X POST https://api.cortexdb.ai/v1/remember \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "User prefers dark mode",
    "tenant_id": "my-app"
  }'
# Returns: { "event_id": "019d6359-d3cc-7671-9e4c-9151011fa016" }

# recall("user preferences")
curl -X POST https://api.cortexdb.ai/v1/recall \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "user preferences",
    "tenant_id": "my-app"
  }'
# Returns: { "context": "...", "confidence": 0.90, "latency_ms": 12 }