memoryrelay/openclaw-plugin

OpenClaw memory plugin for MemoryRelay API - long-term memory with semantic search (v0.6.2+)

0

stars

77

commits

TypeScript

primary language

Aug 6, 2026

updated

api.memoryrelay.net

README

MemoryRelay AI

Engineering Knowledge Platform for OpenClaw

Persistent memory, architectural decisions, reusable patterns, and project orchestration for AI agents.

npm version OpenClaw Compatible

Why MemoryRelay?

MemoryRelay is designed for engineering teams managing complex, long-running projects. It is not general-purpose Q&A memory.

FeatureMemoryRelayMem0OpenClaw-Projects
Semantic searchYes (pgvector)YesNo
SessionsYes (auto-sync with OpenClaw sessions)NoNo
Architectural Decision RecordsYes (record, check, supersede)NoNo
Reusable patternsYes (create, adopt, suggest)NoNo
Project orchestrationYes (10 tools, dependency graphs)NoBasic
Entities / knowledge graphYes (create, link, graph)YesNo
Multi-agent collaborationYes (agent scoping, subagent tracking)LimitedNo
Auto-capture with privacy tiersYes (off/conservative/smart/aggressive)BasicNo
V2 Async StorageYesNoNo
Direct commands17~50
Lifecycle hooks1400
Tools42~100

Quick Start

1. Install the plugin

openclaw plugins install @memoryrelay/plugin-memoryrelay-ai

1b. Install native dependencies (for local SQLite cache)

The local cache requires better-sqlite3, which includes native bindings. After plugin installation, run:

cd ~/.openclaw/extensions/plugin-memoryrelay-ai && npm install --omit=dev

Or install globally: npm install -g better-sqlite3

Note: If you skip this step, the plugin still works — it falls back to API-only mode (no local cache).

2. Set your API key

export MEMORYRELAY_API_KEY="mem_prod_your_key_here"

Or configure inline:

openclaw config set plugins.entries.plugin-memoryrelay-ai.config '{"apiKey": "mem_prod_..."}'

3. Verify

/memory-health

Auto-recall and smart auto-capture are enabled by default. The plugin injects relevant memories into context every turn and captures important information automatically.

Use Cases

Tech Lead managing 3+ projects:

  • Record architectural decisions with decision_record so future agents (and teammates) check before re-deciding
  • Create reusable patterns (pattern_create) and adopt them across projects
  • Use project_impact to understand blast radius before cross-cutting changes

DevOps Engineer:

  • Store infrastructure decisions as ADRs: "Why we chose Fargate over ECS on EC2"
  • Capture runbooks and operational procedures as patterns
  • Track dependencies between services with project_add_relationship

Solo Developer:

  • Build a personal knowledge base of memories, entities, and decisions
  • Use memory_recall for semantic search across everything you have stored
  • Link entities to memories for a navigable knowledge graph

Coding Agent:

  • Auto-capture learns from conversations without explicit tool calls
  • Pattern adoption ensures consistent code style across sessions
  • Session tracking provides continuity when context windows reset

Features -- 42 Tools by Category

Memory (9 tools) -- group: memory

ToolDescription
memory_storeStore a memory with optional project scoping, deduplication, importance, and tier
memory_recallSemantic search across memories with project/tier/importance filters
memory_forgetDelete a memory by ID or search query
memory_listList recent memories with pagination
memory_getRetrieve a specific memory by ID
memory_updateUpdate content of an existing memory
memory_batch_storeStore multiple memories in one call
memory_contextBuild a token-budget-aware context window from relevant memories
memory_promoteUpdate a memory's importance score and tier

Entity (4 tools) -- group: entity

ToolDescription
entity_createCreate a knowledge graph node (person, place, org, project, concept)
entity_linkLink an entity to a memory with a relationship label
entity_listList entities with pagination
entity_graphExplore an entity's neighborhood in the knowledge graph

Agent (3 tools) -- group: agent

ToolDescription
agent_listList available agents
agent_createCreate a new agent (memory namespace)
agent_getGet agent details by ID

Session (4 tools) -- group: session

ToolDescription
session_startStart a work session with title and project
session_endEnd a session with a summary
session_recallGet session details and timeline
session_listList sessions filtered by project or status

Decision (4 tools) -- group: decision

ToolDescription
decision_recordRecord an architectural decision with rationale and alternatives
decision_listList decisions filtered by project, status, or tags
decision_supersedeReplace a decision with a new one (old is marked superseded)
decision_checkSemantic search for existing decisions before making new ones

Pattern (4 tools) -- group: pattern

ToolDescription
pattern_createCreate a reusable convention with example code
pattern_searchSemantic search for established patterns
pattern_adoptAdopt an existing pattern for a project
pattern_suggestGet pattern suggestions based on project stack

Project (10 tools) -- group: project

ToolDescription
project_registerRegister a project with slug, name, stack, and repo URL
project_listList all registered projects
project_infoGet project details
project_add_relationshipAdd relationship between projects (depends_on, extends, etc.)
project_dependenciesList projects that a project depends on
project_dependentsList projects that depend on a project
project_relatedList all related projects (any direction)
project_impactAnalyze blast radius of a proposed change
project_shared_patternsFind patterns shared between two projects
project_contextLoad full project context (memories, decisions, patterns, sessions)

V2 Async (3 tools) -- group: v2

ToolDescription
memory_store_asyncStore a memory asynchronously and return a job ID
memory_statusCheck the processing status of an async memory job
context_buildBuild a ranked context bundle from relevant memories

Health (1 tool) -- group: health

ToolDescription
memory_healthCheck API connectivity and health status

Direct Commands

These slash commands bypass the LLM and execute immediately.

Inspection Commands

CommandDescription
/memory-search <query>Semantic search across stored memories
/memory-contextBuild ranked context bundle from memories
/memory-sessionsList sessions (optional: active, closed, or project slug)
/memory-decisionsList architectural decisions (optional: project slug)
/memory-patternsList or search patterns (optional: search query)
/memory-entitiesList entities (optional: entity type filter)
/memory-projectsList registered projects
/memory-agentsList registered agents

Diagnostic Commands

CommandDescription
/memory-statusConnection status, tool counts, and memory stats
/memory-statsDaily statistics (total, growth, top categories)
/memory-healthAPI health check with response time
/memory-logsRecent debug log entries (optional: limit, tool filter)
/memory-metricsPer-tool call counts, success rates, and latency
/memory-validateProduction readiness checks
/memory-configDisplay current plugin configuration

Management Commands

CommandDescription
/memory-forget <id>Delete a specific memory by ID

⚠️ Migration Notes

v0.20.0 — autoCapture is now opt-in (breaking change)

autoCapture is disabled by default as of v0.20.0. If you were relying on automatic memory capture, add to your config:

{ "autoCapture": true }

Also updated defaults: recallLimit 5→3, recallThreshold 0.3→0.5.


Configuration Reference

openclaw config set plugins.entries.plugin-memoryrelay-ai.config '{
  "apiKey": "mem_prod_...",
  "agentId": "iris",
  "defaultProject": "my-api",
  "autoRecall": true,
  "autoCapture": { "enabled": true, "tier": "smart", "confirmFirst": 5 }
}'
KeyTypeDefaultDescription
apiKeystring--MemoryRelay API key
agentIdstring--Unique agent identifier
apiUrlstringhttps://api.memoryrelay.netAPI endpoint
defaultProjectstring--Default project slug for sessions, decisions, and memories
enabledToolsstringallComma-separated tool groups to enable
autoRecallbooleantrueInject relevant memories into context each turn
autoCaptureboolean | objecttrueAuto-capture config (see tiers below)
recallLimitnumber5Max memories injected per turn (1-20)
recallThresholdnumber0.3Minimum similarity score for recall (0-1)
excludeChannelsstring[][]Channel IDs to skip auto-recall
sessionTimeoutMinutesnumber120Idle time before session auto-close (10-1440)
sessionCleanupIntervalMinutesnumber30Stale session check interval (5-360)
localCacheobjectsee belowLocal SQLite cache configuration (v0.17.0+)
debugbooleanfalseEnable debug logging of API calls
verbosebooleanfalseInclude request/response bodies in logs
maxLogEntriesnumber100Circular buffer size for in-memory logs (10-10000)

Environment Variables

VariableMaps to
MEMORYRELAY_API_KEYapiKey
MEMORYRELAY_AGENT_IDagentId
MEMORYRELAY_API_URLapiUrl
MEMORYRELAY_DEFAULT_PROJECTdefaultProject

Local Cache Configuration (v0.17.0+)

{
  "localCache": {
    "enabled": true,
    "dbPath": "~/.openclaw/memoryrelay-cache.db",
    "syncIntervalMinutes": 5,
    "maxLocalMemories": 10000,
    "vectorSearch": { "enabled": false, "provider": "sqlite-vec" },
    "ttl": { "hot": 72, "warm": 168, "cold": 720 }
  }
}
KeyTypeDefaultDescription
localCache.enabledbooleantrueEnable local SQLite cache
localCache.dbPathstring~/.openclaw/memoryrelay-cache.dbPath to SQLite database
localCache.syncIntervalMinutesnumber5Background sync interval (1-60)
localCache.maxLocalMemoriesnumber10000Max memories stored locally
localCache.vectorSearch.enabledbooleanfalseEnable sqlite-vec vector search
localCache.vectorSearch.providerstringsqlite-vecVector extension provider
localCache.ttl.hotnumber72Hot tier TTL in hours (3 days)
localCache.ttl.warmnumber168Warm tier TTL in hours (7 days)
localCache.ttl.coldnumber720Cold tier TTL in hours (30 days)

Auto-Capture Tiers

TierBehaviorUse When
offManual memory_store onlyFull control, no surprises
conservativeCaptures only low-risk technical factsSensitive environments
smart (default)Balanced automation with privacy blocklistMost teams
aggressiveMaximum capture, minimal filteringSolo prototyping

The confirmFirst setting (default: 5) prompts for confirmation on the first N captures before running silently. The blocklist array accepts regex patterns for content that should never be captured.

{
  "autoCapture": {
    "enabled": true,
    "tier": "smart",
    "confirmFirst": 5,
    "blocklist": ["password", "secret", "Bearer\\s+\\S+"],
    "categories": {
      "credentials": true,
      "preferences": true,
      "technical": true,
      "personal": false
    }
  }
}

Performance (v0.17.0+)

With local cache enabled (default in v0.17.0), most operations skip API round-trips entirely:

OperationAPI-only (v0.16)Local cache (v0.17)Improvement
Recall~200–500ms<5ms40–100×
Capture~150–300ms<2ms75–150×
Status probe~100ms<1ms100×

The local cache uses SQLite (better-sqlite3) with FTS5 for full-text search. An optional sqlite-vec extension enables local vector similarity search without API round-trips.

SyncDaemon runs in the background, pushing buffered writes and pulling remote changes on a configurable interval (default: 5 minutes).

Note: v0.17.0 also fixes the · unavailable status display in openclaw status — the plugin now returns real memory counts from the local cache.

Architecture & Privacy

Data Flow

Agent <-> Plugin <-> MemoryRelay API (HTTPS) <-> PostgreSQL + pgvector

All data in transit is encrypted via HTTPS. The plugin communicates with api.memoryrelay.net using bearer token authentication.

Privacy Controls

  • Blocklist regex patterns in auto-capture config filter passwords, API keys, credit card numbers, SSNs, and other sensitive data before storage
  • Redaction hooks on before_message_write and tool_result_persist apply blocklist patterns to messages and tool results before persistence
  • No credential storage by default -- the personal category requires explicit opt-in
  • Channel exclusions prevent auto-recall on sensitive channels

Multi-Agent Support

  • Each agent has its own memory namespace via agentId
  • Projects, decisions, and patterns are shared across agents
  • Subagent spawning and completion are tracked via lifecycle hooks (subagent_spawned, subagent_ended)
  • Sender identity is auto-injected into memory metadata for traceability

Lifecycle Hooks

The plugin registers 14 lifecycle hooks:

HookPurpose
before_agent_startAuto-recall and workflow injection
agent_endAuto-capture from completed conversations
session_startAuto-create MemoryRelay session from OpenClaw session
session_endAuto-end MemoryRelay session
before_tool_callReserved for future tool blocking/audit
after_tool_callSession activity tracking and metrics
before_compactionSave key context before compaction
before_resetSave key context before session reset
message_receivedActivity timestamp updates
message_sendingReserved for future extensibility
before_message_writePrivacy redaction
subagent_spawnedTrack multi-agent collaboration
subagent_endedStore subagent completion summaries
tool_result_persistPrivacy redaction on tool results

Skills

The plugin ships with 5 skills providing guided workflows on top of the raw tools:

  • memory-workflow — Session lifecycle, storing/retrieving memories
  • decision-tracking — ADR management, checking before deciding
  • pattern-management — Reusable conventions, search before create
  • project-orchestration — Multi-project context loading and impact analysis
  • entity-and-context — Knowledge graph, linking entities to memories

Updating

To update to the latest version:

openclaw plugins update plugin-memoryrelay-ai

Or from within a conversation, run /memory-update to see the exact command.

Important: The plugin ID is plugin-memoryrelay-ai (not memory-memoryrelay). Using the wrong ID will fail with "No install record."

After updating, restart the gateway:

openclaw restart

Troubleshooting

Connection refused / API key issues

# Test the API directly
curl -H "X-API-Key: $MEMORYRELAY_API_KEY" https://api.memoryrelay.net/v1/health

# Check plugin status
/memory-health

# Run full validation
/memory-validate

If /memory-health shows connected: false, verify your API key is set correctly via environment variable or config. Keys start with mem_prod_.

Auto-recall not working

  1. Confirm autoRecall is true (it is by default)
  2. Verify memories exist: run /memory-search test to check
  3. Lower recallThreshold to 0.1 for broader matching
  4. Check your channel is not in excludeChannels
  5. Run /memory-status to see the full plugin state

Debug logging

Enable debug mode to see all API calls:

{
  "debug": true,
  "verbose": true,
  "maxLogEntries": 1000
}

Then inspect with /memory-logs or /memory-metrics to identify slow or failing calls.

Known Limitations

  • memory_batch_store: May return 500 errors on large batches (use individual memory_store as workaround)

VPS Setup

Complete guide for running Claude Code with MemoryRelay on a VPS (Ubuntu).

Prerequisites

1. Install the MCP server

npm install -g @memoryrelay/mcp-server

2. Configure Claude Code settings

Add the MemoryRelay MCP server to ~/.claude/settings.json:

{
  "mcpServers": {
    "MemoryRelay": {
      "command": "memoryrelay-mcp",
      "args": ["--agent-id", "YOUR_AGENT_UUID"],
      "env": {
        "MEMORYRELAY_API_KEY": "mem_prod_your_key_here"
      }
    }
  }
}

Important: agentId must be a UUID obtained from GET /v1/agents — not a name string. Using a name string will cause authentication failures.

3. Install the OpenClaw plugin

openclaw plugins install @memoryrelay/plugin-memoryrelay-ai

4. Add .mcp.json to each project

Create .mcp.json in each project worktree root. This is required for MCP tools to be available in Claude sessions (including claude --print):

{
  "mcpServers": {
    "MemoryRelay": {
      "command": "memoryrelay-mcp",
      "args": ["--agent-id", "YOUR_AGENT_UUID"],
      "env": {
        "MEMORYRELAY_API_KEY": "mem_prod_your_key_here"
      }
    }
  }
}

5. Install Alteriom Claude Skills (optional)

git clone git@github.com:Alteriom/alteriom-claude-skills.git ~/.alteriom-claude-skills

These provide curated skill files for common workflows across projects.

Known Issues

IssueStatusWorkaround
openclaw status shows · unavailable on OpenClaw 2026.3.28Cosmetic — plugin is functionalFix planned in v0.17.0 (local cache with MemorySearchManager-compatible schema)
plugins update --all doesn't reliably update extensionsOpenClaw CLI bugrm -rf ~/.openclaw/extensions/plugin-memoryrelay-ai && openclaw plugins install @memoryrelay/plugin-memoryrelay-ai
agentId must be a UUID from GET /v1/agentsBy designDo not use agent name strings — retrieve the UUID from the API

Roadmap

v0.17.0 — Local SQLite cache layer (Epic #62)

  • Local SQLite cache for offline-first memory access
  • SyncDaemon for background API synchronization
  • Local vector search via sqlite-vec
  • MemorySearchManager-compatible schema (fixes openclaw status display)
  • Issues #63#72

Development

git clone https://github.com/memoryrelay/openclaw-plugin.git
cd openclaw-plugin
npm install
npm test

License

MIT

Contributors

sparck75

53 commits

Copilot

12 commits

memoryrelay/openclaw-plugin

OpenClaw memory plugin for MemoryRelay API - long-term memory with semantic search (v0.6.2+)

0

stars

77

commits

TypeScript

primary language

Aug 6, 2026

updated

api.memoryrelay.net

README

MemoryRelay AI

Engineering Knowledge Platform for OpenClaw

Persistent memory, architectural decisions, reusable patterns, and project orchestration for AI agents.

npm version OpenClaw Compatible

Why MemoryRelay?

MemoryRelay is designed for engineering teams managing complex, long-running projects. It is not general-purpose Q&A memory.

FeatureMemoryRelayMem0OpenClaw-Projects
Semantic searchYes (pgvector)YesNo
SessionsYes (auto-sync with OpenClaw sessions)NoNo
Architectural Decision RecordsYes (record, check, supersede)NoNo
Reusable patternsYes (create, adopt, suggest)NoNo
Project orchestrationYes (10 tools, dependency graphs)NoBasic
Entities / knowledge graphYes (create, link, graph)YesNo
Multi-agent collaborationYes (agent scoping, subagent tracking)LimitedNo
Auto-capture with privacy tiersYes (off/conservative/smart/aggressive)BasicNo
V2 Async StorageYesNoNo
Direct commands17~50
Lifecycle hooks1400
Tools42~100

Quick Start

1. Install the plugin

openclaw plugins install @memoryrelay/plugin-memoryrelay-ai

1b. Install native dependencies (for local SQLite cache)

The local cache requires better-sqlite3, which includes native bindings. After plugin installation, run:

cd ~/.openclaw/extensions/plugin-memoryrelay-ai && npm install --omit=dev

Or install globally: npm install -g better-sqlite3

Note: If you skip this step, the plugin still works — it falls back to API-only mode (no local cache).

2. Set your API key

export MEMORYRELAY_API_KEY="mem_prod_your_key_here"

Or configure inline:

openclaw config set plugins.entries.plugin-memoryrelay-ai.config '{"apiKey": "mem_prod_..."}'

3. Verify

/memory-health

Auto-recall and smart auto-capture are enabled by default. The plugin injects relevant memories into context every turn and captures important information automatically.

Use Cases

Tech Lead managing 3+ projects:

  • Record architectural decisions with decision_record so future agents (and teammates) check before re-deciding
  • Create reusable patterns (pattern_create) and adopt them across projects
  • Use project_impact to understand blast radius before cross-cutting changes

DevOps Engineer:

  • Store infrastructure decisions as ADRs: "Why we chose Fargate over ECS on EC2"
  • Capture runbooks and operational procedures as patterns
  • Track dependencies between services with project_add_relationship

Solo Developer:

  • Build a personal knowledge base of memories, entities, and decisions
  • Use memory_recall for semantic search across everything you have stored
  • Link entities to memories for a navigable knowledge graph

Coding Agent:

  • Auto-capture learns from conversations without explicit tool calls
  • Pattern adoption ensures consistent code style across sessions
  • Session tracking provides continuity when context windows reset

Features -- 42 Tools by Category

Memory (9 tools) -- group: memory

ToolDescription
memory_storeStore a memory with optional project scoping, deduplication, importance, and tier
memory_recallSemantic search across memories with project/tier/importance filters
memory_forgetDelete a memory by ID or search query
memory_listList recent memories with pagination
memory_getRetrieve a specific memory by ID
memory_updateUpdate content of an existing memory
memory_batch_storeStore multiple memories in one call
memory_contextBuild a token-budget-aware context window from relevant memories
memory_promoteUpdate a memory's importance score and tier

Entity (4 tools) -- group: entity

ToolDescription
entity_createCreate a knowledge graph node (person, place, org, project, concept)
entity_linkLink an entity to a memory with a relationship label
entity_listList entities with pagination
entity_graphExplore an entity's neighborhood in the knowledge graph

Agent (3 tools) -- group: agent

ToolDescription
agent_listList available agents
agent_createCreate a new agent (memory namespace)
agent_getGet agent details by ID

Session (4 tools) -- group: session

ToolDescription
session_startStart a work session with title and project
session_endEnd a session with a summary
session_recallGet session details and timeline
session_listList sessions filtered by project or status

Decision (4 tools) -- group: decision

ToolDescription
decision_recordRecord an architectural decision with rationale and alternatives
decision_listList decisions filtered by project, status, or tags
decision_supersedeReplace a decision with a new one (old is marked superseded)
decision_checkSemantic search for existing decisions before making new ones

Pattern (4 tools) -- group: pattern

ToolDescription
pattern_createCreate a reusable convention with example code
pattern_searchSemantic search for established patterns
pattern_adoptAdopt an existing pattern for a project
pattern_suggestGet pattern suggestions based on project stack

Project (10 tools) -- group: project

ToolDescription
project_registerRegister a project with slug, name, stack, and repo URL
project_listList all registered projects
project_infoGet project details
project_add_relationshipAdd relationship between projects (depends_on, extends, etc.)
project_dependenciesList projects that a project depends on
project_dependentsList projects that depend on a project
project_relatedList all related projects (any direction)
project_impactAnalyze blast radius of a proposed change
project_shared_patternsFind patterns shared between two projects
project_contextLoad full project context (memories, decisions, patterns, sessions)

V2 Async (3 tools) -- group: v2

ToolDescription
memory_store_asyncStore a memory asynchronously and return a job ID
memory_statusCheck the processing status of an async memory job
context_buildBuild a ranked context bundle from relevant memories

Health (1 tool) -- group: health

ToolDescription
memory_healthCheck API connectivity and health status

Direct Commands

These slash commands bypass the LLM and execute immediately.

Inspection Commands

CommandDescription
/memory-search <query>Semantic search across stored memories
/memory-contextBuild ranked context bundle from memories
/memory-sessionsList sessions (optional: active, closed, or project slug)
/memory-decisionsList architectural decisions (optional: project slug)
/memory-patternsList or search patterns (optional: search query)
/memory-entitiesList entities (optional: entity type filter)
/memory-projectsList registered projects
/memory-agentsList registered agents

Diagnostic Commands

CommandDescription
/memory-statusConnection status, tool counts, and memory stats
/memory-statsDaily statistics (total, growth, top categories)
/memory-healthAPI health check with response time
/memory-logsRecent debug log entries (optional: limit, tool filter)
/memory-metricsPer-tool call counts, success rates, and latency
/memory-validateProduction readiness checks
/memory-configDisplay current plugin configuration

Management Commands

CommandDescription
/memory-forget <id>Delete a specific memory by ID

⚠️ Migration Notes

v0.20.0 — autoCapture is now opt-in (breaking change)

autoCapture is disabled by default as of v0.20.0. If you were relying on automatic memory capture, add to your config:

{ "autoCapture": true }

Also updated defaults: recallLimit 5→3, recallThreshold 0.3→0.5.


Configuration Reference

openclaw config set plugins.entries.plugin-memoryrelay-ai.config '{
  "apiKey": "mem_prod_...",
  "agentId": "iris",
  "defaultProject": "my-api",
  "autoRecall": true,
  "autoCapture": { "enabled": true, "tier": "smart", "confirmFirst": 5 }
}'
KeyTypeDefaultDescription
apiKeystring--MemoryRelay API key
agentIdstring--Unique agent identifier
apiUrlstringhttps://api.memoryrelay.netAPI endpoint
defaultProjectstring--Default project slug for sessions, decisions, and memories
enabledToolsstringallComma-separated tool groups to enable
autoRecallbooleantrueInject relevant memories into context each turn
autoCaptureboolean | objecttrueAuto-capture config (see tiers below)
recallLimitnumber5Max memories injected per turn (1-20)
recallThresholdnumber0.3Minimum similarity score for recall (0-1)
excludeChannelsstring[][]Channel IDs to skip auto-recall
sessionTimeoutMinutesnumber120Idle time before session auto-close (10-1440)
sessionCleanupIntervalMinutesnumber30Stale session check interval (5-360)
localCacheobjectsee belowLocal SQLite cache configuration (v0.17.0+)
debugbooleanfalseEnable debug logging of API calls
verbosebooleanfalseInclude request/response bodies in logs
maxLogEntriesnumber100Circular buffer size for in-memory logs (10-10000)

Environment Variables

VariableMaps to
MEMORYRELAY_API_KEYapiKey
MEMORYRELAY_AGENT_IDagentId
MEMORYRELAY_API_URLapiUrl
MEMORYRELAY_DEFAULT_PROJECTdefaultProject

Local Cache Configuration (v0.17.0+)

{
  "localCache": {
    "enabled": true,
    "dbPath": "~/.openclaw/memoryrelay-cache.db",
    "syncIntervalMinutes": 5,
    "maxLocalMemories": 10000,
    "vectorSearch": { "enabled": false, "provider": "sqlite-vec" },
    "ttl": { "hot": 72, "warm": 168, "cold": 720 }
  }
}
KeyTypeDefaultDescription
localCache.enabledbooleantrueEnable local SQLite cache
localCache.dbPathstring~/.openclaw/memoryrelay-cache.dbPath to SQLite database
localCache.syncIntervalMinutesnumber5Background sync interval (1-60)
localCache.maxLocalMemoriesnumber10000Max memories stored locally
localCache.vectorSearch.enabledbooleanfalseEnable sqlite-vec vector search
localCache.vectorSearch.providerstringsqlite-vecVector extension provider
localCache.ttl.hotnumber72Hot tier TTL in hours (3 days)
localCache.ttl.warmnumber168Warm tier TTL in hours (7 days)
localCache.ttl.coldnumber720Cold tier TTL in hours (30 days)

Auto-Capture Tiers

TierBehaviorUse When
offManual memory_store onlyFull control, no surprises
conservativeCaptures only low-risk technical factsSensitive environments
smart (default)Balanced automation with privacy blocklistMost teams
aggressiveMaximum capture, minimal filteringSolo prototyping

The confirmFirst setting (default: 5) prompts for confirmation on the first N captures before running silently. The blocklist array accepts regex patterns for content that should never be captured.

{
  "autoCapture": {
    "enabled": true,
    "tier": "smart",
    "confirmFirst": 5,
    "blocklist": ["password", "secret", "Bearer\\s+\\S+"],
    "categories": {
      "credentials": true,
      "preferences": true,
      "technical": true,
      "personal": false
    }
  }
}

Performance (v0.17.0+)

With local cache enabled (default in v0.17.0), most operations skip API round-trips entirely:

OperationAPI-only (v0.16)Local cache (v0.17)Improvement
Recall~200–500ms<5ms40–100×
Capture~150–300ms<2ms75–150×
Status probe~100ms<1ms100×

The local cache uses SQLite (better-sqlite3) with FTS5 for full-text search. An optional sqlite-vec extension enables local vector similarity search without API round-trips.

SyncDaemon runs in the background, pushing buffered writes and pulling remote changes on a configurable interval (default: 5 minutes).

Note: v0.17.0 also fixes the · unavailable status display in openclaw status — the plugin now returns real memory counts from the local cache.

Architecture & Privacy

Data Flow

Agent <-> Plugin <-> MemoryRelay API (HTTPS) <-> PostgreSQL + pgvector

All data in transit is encrypted via HTTPS. The plugin communicates with api.memoryrelay.net using bearer token authentication.

Privacy Controls

  • Blocklist regex patterns in auto-capture config filter passwords, API keys, credit card numbers, SSNs, and other sensitive data before storage
  • Redaction hooks on before_message_write and tool_result_persist apply blocklist patterns to messages and tool results before persistence
  • No credential storage by default -- the personal category requires explicit opt-in
  • Channel exclusions prevent auto-recall on sensitive channels

Multi-Agent Support

  • Each agent has its own memory namespace via agentId
  • Projects, decisions, and patterns are shared across agents
  • Subagent spawning and completion are tracked via lifecycle hooks (subagent_spawned, subagent_ended)
  • Sender identity is auto-injected into memory metadata for traceability

Lifecycle Hooks

The plugin registers 14 lifecycle hooks:

HookPurpose
before_agent_startAuto-recall and workflow injection
agent_endAuto-capture from completed conversations
session_startAuto-create MemoryRelay session from OpenClaw session
session_endAuto-end MemoryRelay session
before_tool_callReserved for future tool blocking/audit
after_tool_callSession activity tracking and metrics
before_compactionSave key context before compaction
before_resetSave key context before session reset
message_receivedActivity timestamp updates
message_sendingReserved for future extensibility
before_message_writePrivacy redaction
subagent_spawnedTrack multi-agent collaboration
subagent_endedStore subagent completion summaries
tool_result_persistPrivacy redaction on tool results

Skills

The plugin ships with 5 skills providing guided workflows on top of the raw tools:

  • memory-workflow — Session lifecycle, storing/retrieving memories
  • decision-tracking — ADR management, checking before deciding
  • pattern-management — Reusable conventions, search before create
  • project-orchestration — Multi-project context loading and impact analysis
  • entity-and-context — Knowledge graph, linking entities to memories

Updating

To update to the latest version:

openclaw plugins update plugin-memoryrelay-ai

Or from within a conversation, run /memory-update to see the exact command.

Important: The plugin ID is plugin-memoryrelay-ai (not memory-memoryrelay). Using the wrong ID will fail with "No install record."

After updating, restart the gateway:

openclaw restart

Troubleshooting

Connection refused / API key issues

# Test the API directly
curl -H "X-API-Key: $MEMORYRELAY_API_KEY" https://api.memoryrelay.net/v1/health

# Check plugin status
/memory-health

# Run full validation
/memory-validate

If /memory-health shows connected: false, verify your API key is set correctly via environment variable or config. Keys start with mem_prod_.

Auto-recall not working

  1. Confirm autoRecall is true (it is by default)
  2. Verify memories exist: run /memory-search test to check
  3. Lower recallThreshold to 0.1 for broader matching
  4. Check your channel is not in excludeChannels
  5. Run /memory-status to see the full plugin state

Debug logging

Enable debug mode to see all API calls:

{
  "debug": true,
  "verbose": true,
  "maxLogEntries": 1000
}

Then inspect with /memory-logs or /memory-metrics to identify slow or failing calls.

Known Limitations

  • memory_batch_store: May return 500 errors on large batches (use individual memory_store as workaround)

VPS Setup

Complete guide for running Claude Code with MemoryRelay on a VPS (Ubuntu).

Prerequisites

1. Install the MCP server

npm install -g @memoryrelay/mcp-server

2. Configure Claude Code settings

Add the MemoryRelay MCP server to ~/.claude/settings.json:

{
  "mcpServers": {
    "MemoryRelay": {
      "command": "memoryrelay-mcp",
      "args": ["--agent-id", "YOUR_AGENT_UUID"],
      "env": {
        "MEMORYRELAY_API_KEY": "mem_prod_your_key_here"
      }
    }
  }
}

Important: agentId must be a UUID obtained from GET /v1/agents — not a name string. Using a name string will cause authentication failures.

3. Install the OpenClaw plugin

openclaw plugins install @memoryrelay/plugin-memoryrelay-ai

4. Add .mcp.json to each project

Create .mcp.json in each project worktree root. This is required for MCP tools to be available in Claude sessions (including claude --print):

{
  "mcpServers": {
    "MemoryRelay": {
      "command": "memoryrelay-mcp",
      "args": ["--agent-id", "YOUR_AGENT_UUID"],
      "env": {
        "MEMORYRELAY_API_KEY": "mem_prod_your_key_here"
      }
    }
  }
}

5. Install Alteriom Claude Skills (optional)

git clone git@github.com:Alteriom/alteriom-claude-skills.git ~/.alteriom-claude-skills

These provide curated skill files for common workflows across projects.

Known Issues

IssueStatusWorkaround
openclaw status shows · unavailable on OpenClaw 2026.3.28Cosmetic — plugin is functionalFix planned in v0.17.0 (local cache with MemorySearchManager-compatible schema)
plugins update --all doesn't reliably update extensionsOpenClaw CLI bugrm -rf ~/.openclaw/extensions/plugin-memoryrelay-ai && openclaw plugins install @memoryrelay/plugin-memoryrelay-ai
agentId must be a UUID from GET /v1/agentsBy designDo not use agent name strings — retrieve the UUID from the API

Roadmap

v0.17.0 — Local SQLite cache layer (Epic #62)

  • Local SQLite cache for offline-first memory access
  • SyncDaemon for background API synchronization
  • Local vector search via sqlite-vec
  • MemorySearchManager-compatible schema (fixes openclaw status display)
  • Issues #63#72

Development

git clone https://github.com/memoryrelay/openclaw-plugin.git
cd openclaw-plugin
npm install
npm test

License

MIT

Contributors

sparck75

53 commits

Copilot

12 commits

Languages

TypeScript

97.0%

JavaScript

3.0%