← 返回
未分类 中文

Openclaw Local Memory

Brain-like local memory plugin for OpenClaw — stores, searches, and injects memories with importance scoring, entity extraction, and automatic consolidation.
类脑本地记忆插件,支持 OpenClaw 的记忆存储、搜索与注入,具备重要性评分、实体抽取和自动整合功能。
flexrox flexrox 来源
未分类 clawhub v0.4.2 1 版本 100000 Key: 无需
★ 0
Stars
📥 489
下载
💾 1
安装
1
版本
#latest

概述

🧠 Local Memory Plugin v0.4

A brain-like memory system for OpenClaw. Remembers what matters, forgets what doesn't, and builds a persistent understanding of you over time.

> Zero-config, no external service, no API key, works out of the box.

Features

🧠 Brain-Like Memory Architecture

  • Hierarchical Memory: Exchanges → Summaries → Profile
  • Importance Scoring: Each memory scored 0-1 based on significance
  • Time Decay: Importance decreases over time (adjustable rate)
  • Entity Tracking: Extracts and tracks people, places, things
  • Semantic Chunking: Long content auto-split into manageable pieces

🔍 Smart Recall

  • Multi-Factor Scoring: Combines relevance, importance, AND recency
  • Profile Injection: Builds and injects user profile periodically
  • Context Window: Tracks conversation turns and manages memory refresh

💾 Intelligent Capture

  • Significance Detection: Only captures meaningful content
  • Auto-Deduplication: Won't store the same thing twice
  • Periodic Consolidation: Summarizes accumulated content when context grows long
  • Category Detection: Auto-categorizes as preference, fact, decision, entity, skill

🗑️ Self-Maintaining

  • Auto-Pruning: Removes old/unimportant memories when limit reached
  • Importance Protection: High-value memories kept longer
  • Memory Stats: Track memory health and composition

Tools

ToolDescription
-------------------
local_memory_searchSearch memories by natural language (semantic)
local_memory_storeManually save a specific memory
local_memory_listList all memories, optionally filtered by category
local_memory_profileView user profile (entities, preferences, facts)
local_memory_statsView memory statistics
local_memory_recentGet recently accessed memories
local_memory_forgetDelete memory matching a query
local_memory_wipeDelete ALL memories (irreversible)

How It Works

Memory Lifecycle

  1. Capture → User + Assistant exchange
  2. Significance Assessment → Score based on patterns (decisions score high, greetings low)
  3. Storage → If significant enough, store with extracted entities and tags
  4. Importance Calculation → Based on category, length, entities, source
  5. Decay Over Time → Importance decreases exponentially
  6. Recall → On query, combine TF-IDF relevance + importance + recency
  7. Pruning → When max reached, lowest combined-score memories removed

Recall Scoring Formula

score = (relevanceWeight × tfidf_similarity) 
      + (importanceWeight × decayed_importance)
      + (recencyWeight × recency_factor)

Significance Detection Patterns

PatternCategoryWeight
---------------------------
entschieden, geplant, wird, werdendecision0.30
ich bin, mein, unser Unternehmenidentity0.25
bevorzug, immer, nie, preferpreference0.25
api_key, password, tokencredential0.20
skill, können, fähigskill0.20
projekt, build, deployproject0.15

Configuration

{
  "autoRecall": true,
  "autoCapture": true,
  "captureInterval": 8,
  "captureSignificantOnly": true,
  "minSignificanceScore": 0.5,
  "profileFrequency": 15,
  "includeProfileOnFirstTurn": true,
  "maxRecallResults": 5,
  "similarityThreshold": 0.35,
  "maxMemoryInjections": 3,
  "contextBudget": 2000,
  "maxMemories": 500,
  "pruneOlderThanDays": 30,
  "decayRate": 0.05,
  "chunkSize": 800,
  "importanceWeight": 0.25,
  "recencyWeight": 0.25,
  "relevanceWeight": 0.5
}
OptionDefaultDescription
------------------------------
autoRecalltrueInject relevant memories before each turn
autoCapturetrueAuto-capture conversation exchanges
captureInterval8Capture every N turns (higher = less storage)
captureSignificantOnlytrueOnly capture significant content
minSignificanceScore0.5Min score to capture (higher = stricter)
profileFrequency15Inject profile every N turns (higher = less context)
maxRecallResults5Max memories injected per turn
similarityThreshold0.35Min relevance to inject
maxMemoryInjections3Max memories to show per recall
contextBudget2000Max chars of memory context injected
maxMemories500Maximum memories to keep
pruneOlderThanDays30Auto-delete memories older than N days
decayRate0.05Importance decay speed
importanceWeight0.25Weight of importance in scoring
recencyWeight0.25Weight of recency in scoring
relevanceWeight0.5Weight of TF-IDF relevance in scoring

Data Storage

All memories stored locally in:

~/.openclaw/memory/<containerTag>.json

Default: ~/.openclaw/memory/openclaw_local_memory.json

Privacy

  • 100% Local: No data leaves your machine
  • You Control: Auto-capture can be disabled
  • Significance Filter: Won't store every random message
  • No External APIs: No internet required

Requirements

  • OpenClaw 2026.1.29 or later
  • Node.js (built-in TF-IDF, no external dependencies)

Tips

For Best Results

  1. Let it run for a few days — memory improves over time
  2. Manually store important facts with local_memory_store
  3. Check profile with local_memory_profile periodically
  4. Adjust importanceWeight, recencyWeight, relevanceWeight to your preference

If Context Gets Long

  • Reduce summariseThreshold to trigger earlier consolidation
  • Increase decayRate to forget older stuff faster
  • Lower maxMemories to prune more aggressively

Forgot Something?

  • Use local_memory_forget query="what to forget" to delete
  • Use local_memory_search to find what you're looking for

版本历史

共 1 个版本

  • v0.4.2 当前
    2026-05-03 05:40 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-agent

Agent Browser

rez0
用于 AI 代理的浏览器自动化 CLI。当用户需要与网站交互(包括浏览页面、填写表单、点击按钮、截图等)时使用。
★ 852 📥 334,727
ai-agent

self-improving agent

pskoett
记录自身发现以实现自我改进的技能
★ 4,138 📥 912,783
ai-agent

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,424 📥 326,667