Cortex Memory

OpenClaw plugin for Cortex memory. Auto-Recall, Auto-Capture, and agent memory tools.

Cortex Memory is an OpenClaw plugin that provides automatic long-term memory with knowledge graph retrieval, built by Matthew at Ubundi. It gives your agent persistent memory that survives across sessions — remembering who you are, what your project does, decisions you made weeks ago, and how things changed over time. With 1,365 weekly downloads and frequent updates, it's a well-maintained option in the OpenClaw memory ecosystem. The plugin operates through two primary mechanisms: Auto-Recall queries Cortex's cloud API before every agent turn and injects semantically relevant memories into context, while Auto-Capture extracts facts from conversations after each turn and submits them to Cortex's async ingestion pipeline. A watermark system ensures each message is sent exactly once — no duplication across turns. The plugin also features Session Goals, where the agent automatically identifies the user's primary objective and biases recall toward goal-relevant memories. What sets Cortex apart is its recovery detection and resilience engineering. If a previous session ended uncleanly (crash, reset without /sleep), the plugin detects this on the next startup and prepends recovery context so the agent can pick up where it left off. It includes exponential backoff retry queues, cold-start detection (disables recall after 3 consecutive hard failures), and latency metrics tracking. The /checkpoint command lets you explicitly save session context, while /audit toggles local audit logging for debugging. Cortex is cloud-based — all memory operations go through Cortex's hosted API at ubundi.com. This means zero local infrastructure but requires an API key and sends conversation data to external servers. Configuration is flexible with 20+ options including recall profiles (auto, factual, planning, incident, handoff), novelty-based deduplication, and agent role specialization (developer, researcher, manager, support, generalist). For users who want something between Supermemory's polish and Engram's local-first complexity, Cortex offers a solid middle ground with unique features like session goals and crash recovery.

Tags: memory, automation

Use Cases

  • Personal AI assistant that remembers your projects, preferences, and decisions across weeks of conversations
  • Development assistant with crash recovery — picks up where you left off after unclean session ends
  • Multi-role agent deployments where different agents need different recall profiles (developer vs researcher vs support)
  • Long-running projects requiring persistent context about code decisions, architecture choices, and debugging sessions
  • Team environments where multiple agents share memory via the same userId

Tips

  • Start with the default config and tune recall/capture settings after observing behavior for a few sessions
  • Use /checkpoint before ending a session to save rich context for recovery detection
  • Set agentRole to match your primary use case (developer, researcher, etc.) for better capture categorization
  • Use /audit on temporarily to see exactly what's being sent to Cortex for debugging
  • Set tools.profile to 'full' immediately after install — this is the #1 setup issue
  • Use the 'combined' recallQueryType (default) for best general-purpose recall — switch to 'factual' or 'codex' for specialized workflows
  • CLI commands are useful for debugging: 'openclaw cortex status', 'openclaw cortex memories', 'openclaw cortex search'

Known Issues & Gotchas

  • OpenClaw defaults to 'messaging' tools profile — you MUST run 'openclaw config set tools.profile full' and restart for memory tools to work
  • Running 'openclaw configure' resets the tools profile to default — re-apply the 'full' setting afterward
  • The plugin is registered as 'openclaw-cortex' (without the @ubundi scope) in config keys — don't use the full npm package name
  • First run generates a unique user ID at ~/.openclaw/cortex-user-id — if you delete this, you lose access to your existing memories
  • Auto-capture sends conversation data to Cortex's cloud servers — evaluate privacy implications
  • Recall timeout defaults to 60 seconds — if Cortex is slow, your agent waits that long before proceeding without memories
  • The noveltyThreshold (0.85 default) may be too aggressive for some use cases — lower it if important memories aren't being saved

Alternatives

  • Supermemory
  • Engram Memory
  • Mem0 Memory

Community Feedback

I built a local memory layer for my OpenClaw agents — Cortex handles the deep knowledge retrieval while memory_search handles the conversation history.

— Reddit r/openclaw

OpenClaw plugin for Cortex — automatic long-term memory with knowledge graph retrieval. Auto-recall injects relevant memories before every agent turn, auto-capture extracts facts after responses, and file sync ingests MEMORY.md and daily logs in the background.

— GitHub

Gives your agent persistent memory that survives across sessions — who you are, what your project does, decisions you made weeks ago, and how things changed over time.

— npm

Frequently Asked Questions

Do I need to set tools.profile to 'full'?

Yes. OpenClaw defaults to the 'messaging' tools profile, which excludes memory tools. The plugin's own tools (cortex_search_memory, cortex_save_memory) work on any profile, but built-in tools like memory_search and read require 'full'. Run 'openclaw config set tools.profile full' and restart.

What happens if my session crashes?

Cortex has recovery detection. If a previous session ended uncleanly (crash, reset without /sleep), the plugin detects this on the next startup and prepends a recovery block with the last known context. Use /checkpoint regularly for better recovery data.

How is the userId generated?

On first run, the plugin generates a unique ID and persists it at ~/.openclaw/cortex-user-id. All memories are scoped to this ID. You can override it in config with a custom userId to share memory across machines or team members.

What are session goals?

When sessionGoal is enabled (default), the agent automatically identifies the primary objective of the current session using the cortex_set_session_goal tool. This biases recall toward goal-relevant memories and tags captured facts with the session's purpose.

Is my conversation data stored in the cloud?

Yes. Cortex is entirely cloud-based — auto-capture sends conversation transcripts to Cortex's API for extraction and storage. Enable auditLog to see exactly what's being sent. If privacy is a concern, consider Engram (local-first) instead.

What recall profiles are available?

Six profiles: 'auto' (picks the best based on context), 'default', 'factual', 'planning', 'incident', and 'handoff'. Set recallProfile in config or let 'auto' choose dynamically. Each profile adjusts the query strategy and scoring weights.

How does deduplication work?

Two layers: a time-based dedupe window (30 minutes default) prevents saving the same memory twice within that period, and a novelty threshold (0.85 default) checks similarity against existing memories. Scores above the threshold are considered duplicates.

Configuration Examples

Basic setup with API key

{
  "plugins": {
    "entries": {
      "openclaw-cortex": {
        "enabled": true,
        "config": {
          "apiKey": "your-cortex-api-key",
          "autoRecall": true,
          "autoCapture": true
        }
      }
    },
    "slots": {
      "memory": "openclaw-cortex"
    }
  }
}

Developer-optimized with session goals

{
  "plugins": {
    "entries": {
      "openclaw-cortex": {
        "enabled": true,
        "config": {
          "apiKey": "your-cortex-api-key",
          "autoRecall": true,
          "autoCapture": true,
          "recallLimit": 20,
          "recallTopK": 10,
          "recallQueryType": "combined",
          "sessionGoal": true,
          "agentRole": "developer",
          "dedupeWindowMinutes": 30,
          "noveltyThreshold": 0.85,
          "auditLog": false
        }
      }
    },
    "slots": {
      "memory": "openclaw-cortex"
    }
  }
}

CLI setup commands

# Install the plugin
openclaw plugins install @ubundi/openclaw-cortex

# Set tools profile to full (REQUIRED)
openclaw config set tools.profile full

# Add your API key
openclaw config set plugins.entries.openclaw-cortex.config.apiKey "your-cortex-api-key"

# Restart gateway
openclaw gateway restart

# Verify
openclaw cortex status

Installation

openclaw plugins install @ubundi/openclaw-cortex