← 返回
未分类 中文

Correlation Memory Search

Correlation-aware memory search plugin for OpenClaw — automatically retrieves related decision contexts when you query memory. Zero external dependencies. In...
OpenClaw 的关联感知记忆搜索插件——在查询记忆时自动检索相关决策上下文。零外部依赖。
ether-btc
未分类 clawhub v2.1.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 357
下载
💾 0
安装
1
版本
#latest

概述

Correlation Memory Plugin

Correlation-aware memory search for OpenClaw — automatically retrieves related contexts when you query memory.

What It Does

When you search memory for topic X, this plugin also fetches related contexts Y and Z that consistently matter together — based on correlation rules you define.

Example: search for "backup error" → plugin also retrieves "last backup time", "recovery procedures", and "similar errors" — because those contexts are correlated by rule.

Key Features

  • Decision-context retrieval — surfacing related information before you ask for it
  • Word-boundary keyword matching — no false positives from partial matches
  • Confidence scoring — filter/sort by how reliable a correlation is
  • Multiple matching modes — auto, strict, lenient
  • Result limitingmax_results parameter prevents output bloat
  • mtime cache — rules reloaded only when correlation-rules.json changes
  • LRU regex cache — bounded at 500 entries, no memory leaks
  • Debug tool — understand why a given context triggered specific correlations
  • Lifecycle states — rules can be promoted/archived/disabled without deletion

Security

  • Zero external runtime dependencies (index.ts only imports openclaw/plugin-sdk)
  • Read-only local file operations (no network, no writes)
  • No credential or environment variable access
  • Workspace path resolved via OpenClaw SDK only
  • npm install fetches only openclaw (peerDep) + vitest (devDep, not bundled) — no postinstall scripts

Correlation Rules

Rules live in memory/correlation-rules.json in your workspace. Example:

{
  "id": "cr-config-001",
  "trigger_context": "config-change",
  "trigger_keywords": ["config", "setting", "openclaw.json", "modify"],
  "must_also_fetch": ["backup-location", "rollback-instructions"],
  "relationship_type": "constrains",
  "confidence": 0.95,
  "lifecycle": { "state": "promoted" }
}

Active states: promoted, active, testing, validated, proposal

Tools Provided

ToolDescription
-------------------
memory_search_with_correlationEnhanced memory search — automatically fetches correlated contexts from correlation rules
correlation_checkDebug tool — shows which rules matched and why without performing searches

Installation

cd ~/.openclaw/extensions
git clone https://github.com/ether-btc/openclaw-correlation-plugin.git correlation-memory
cd correlation-memory && npm install

# Add to openclaw.json
openclaw plugins install correlation-memory
openclaw gateway restart

Requires OpenClaw >= 2026.1.26.

Note: npm install pulls the OpenClaw peer dependency and vitest (dev/test only). The runtime plugin makes no network calls and has zero external dependencies.

See Also

  • README.md — Full documentation with examples, configuration, architecture
  • correlation-rules.example.json — Production-quality rule examples
  • docs/schema.md — Full rule schema reference
  • .sanitization-audit.md — Security audit results
  • tests/correlation.test.ts — Unit tests

版本历史

共 1 个版本

  • v2.1.0 当前
    2026-05-07 07:08 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

Caveman Input Compression

ether-btc
将工作区引导文件压缩为简化语言以减少每次会话加载时的输入token,覆盖前会自动创建.original.md备份
★ 0 📥 438

Exec Truncate

ether-btc
AI代理工具,用于压缩/执行shell命令并提供领域感知的输出截断。适用于需要压缩exec工具输出或运行gi...
★ 0 📥 343

OpenClaw Config Safety v2

ether-btc
安全地验证、规范化、导出和导入 openclaw.json 配置文件,自动备份并在应用更改或升级前进行模式校验。
★ 0 📥 307