OpenClaw Plugin (Recommended)

The Hippocortex OpenClaw plugin gives your agent persistent memory with zero code changes. Once enabled, every conversation is automatically captured and every prompt is enriched with relevant context from past sessions.

This is the recommended integration for OpenClaw users. It provides the full Hippocortex pipeline: capture, synthesize (semantic search, graph retrieval, collective brain, behavioral context), learn, vault, and the Context Engine for infinite sessions.

Package: @hippocortex/hippocortex@3.2.1 on npm

Installation

Option 1: Setup Wizard (Recommended)

One command does everything — checks your OpenClaw version, installs the plugin, configures your API key, enables the Context Engine, and restarts the gateway.

npx @hippocortex/setup

That's it. Your agent now has infinite memory.

Option 2: Manual Configuration

Add the plugin to your openclaw.json:

{
  "plugins": {
    "entries": {
      "hippocortex": {
        "enabled": true,
        "config": {
          "apiKey": "hx_live_...",
          "baseUrl": "https://api.hippocortex.dev",
          "capture": true,
          "retrieval": true,
          "contextEngine": {
            "enabled": true,
            "maxRecentMessages": 50,
            "retrievalBudget": 4000
          }
        }
      }
    }
  }
}

Then restart the gateway:

openclaw gateway restart

How It Works

On every incoming message:

  1. The plugin intercepts the prompt build phase.
  2. It calls synthesize() with the user's message to retrieve relevant past context — using semantic search, graph retrieval, collective brain, and behavioral context.
  3. It prepends a structured knowledge block to the system prompt.
  4. The LLM receives both the memory context and the original message.

After every response:

  1. The plugin captures the full conversation turn (user input + assistant output).
  2. Events are sent to the Hippocortex API in the background.
  3. The auto-compile pipeline processes new events every 10 captures.
  4. The vault automatically detects and encrypts any secrets in captured events.

Context Engine

The Context Engine enables infinite sessions. Instead of sending the full conversation history to the LLM (which overflows at ~200k tokens), the plugin:

  • Keeps only the most recent messages in context
  • Retrieves relevant older history from Hippocortex automatically
  • Sessions never overflow, no matter how long they run

Enable it via the setup wizard or by adding contextEngine to your config.

Available Tools

The plugin registers tools that the agent can call explicitly:

hippocortex_remember

Stores facts as persistent memories.

hippocortex_remember(["Always run migrations before deploying to staging"])

hippocortex_health

Returns the current status of the Hippocortex connection.

hippocortex_vault_query

Searches the vault for secrets by natural language query. Returns metadata only — not actual secret values.

hippocortex_vault_reveal

Retrieves the actual decrypted value of a specific vault secret. Permission-gated and audited.

Circuit Breaker

The plugin includes a built-in circuit breaker for resilience. If the Hippocortex API becomes temporarily unavailable:

  • The circuit breaker opens after 3 consecutive failures.
  • While open, the plugin skips memory operations silently (no errors, no delays).
  • It retries after 60 seconds and closes the circuit if the API is healthy again.

Your agent continues working normally without memory enrichment during an outage.

Configuration Options

OptionTypeDefaultDescription
apiKeystringRequiredYour Hippocortex API key
baseUrlstringhttps://api.hippocortex.devAPI endpoint
capturebooleantrueCapture conversations automatically
retrievalbooleantrueInject memory context automatically
sessionIdstringAuto-generatedCustom session ID
tokenBudgetnumber2000Max tokens for injected context
contextEngineobject{}Context Engine settings

Reliability

The OpenClaw plugin achieves approximately 95% reliability for the full memory pipeline. The 5% gap comes from edge cases where the before_prompt_build hook is skipped by certain OpenClaw message types. For most conversational use cases, memory works on every turn.