← 返回
开发者工具 中文

Smart Memory

Zero-cost persistent memory that makes your bot smarter over time. Automatically extracts, stores, and retrieves key facts, preferences, and decisions from c...
零成本持久记忆功能,让您的机器人随时间推移变得更智能。自动提取、存储并检索关键事实、偏好和决策。
jcools1977
开发者工具 clawhub v1.0.0 1 版本 99863.6 Key: 无需
★ 0
Stars
📥 732
下载
💾 2
安装
1
版本
#latest

概述

Smart Memory — Persistent Intelligence for OpenClaw

You have access to a persistent local memory system. Use it to remember important

information across conversations so the user never has to repeat themselves.

Core Principle

Remember everything important. Forget nothing the user cares about. Cost nothing.

All memory is stored locally in ~/.openclaw/smart-memory/ as plain JSON files.

No external APIs. No cloud storage. No cost. Just local files and shell commands.

When to STORE a Memory

Automatically extract and store memories whenever the user shares:

  • Preferences: "I prefer dark mode", "I like Python over JavaScript"
  • Personal facts: names, locations, roles, team members, project names
  • Decisions: "We decided to use PostgreSQL", "Let's go with the microservice approach"
  • Instructions: "Always run tests before committing", "Never deploy on Fridays"
  • Important dates: deadlines, birthdays, recurring events
  • Technical context: stack details, repo URLs, server addresses, API keys (stored locally only)
  • Corrections: "Actually, my name is spelled with a K" (update existing memory)

How to Store

Run the memory manager to store a new memory:

bash ~/.openclaw/smart-memory/memory-manager.sh store \
  --category "<preferences|facts|decisions|instructions|dates|technical|corrections>" \
  --key "<short_identifier>" \
  --value "<the information to remember>" \
  --confidence "<high|medium|low>" \
  --source "<conversation|user_explicit|inferred>"

Confidence levels:

  • high — User explicitly stated this ("My name is Alex")
  • medium — Clearly implied from context ("I keep using vim, so they prefer vim")
  • low — Inferred or uncertain ("They might work in finance based on their questions")

Source types:

  • user_explicit — User directly told you this information
  • conversation — Extracted from conversation context
  • inferred — You reasoned this from patterns

When to RETRIEVE Memories

Before responding to any user message, check if relevant memories exist:

bash ~/.openclaw/smart-memory/memory-manager.sh search --query "<relevant keywords>"

Use retrieved memories to:

  • Personalize responses (use their name, reference their preferences)
  • Avoid asking questions you already know the answer to
  • Provide continuity across conversations
  • Reference past decisions and context

When to UPDATE a Memory

If the user corrects or changes information:

bash ~/.openclaw/smart-memory/memory-manager.sh update \
  --key "<existing_key>" \
  --value "<new_value>" \
  --reason "<why this changed>"

The old value is preserved in the memory's history for audit purposes.

When to FORGET a Memory

If the user explicitly asks you to forget something:

bash ~/.openclaw/smart-memory/memory-manager.sh forget --key "<key_to_forget>"

This soft-deletes the memory (marks it as forgotten but retains it in the archive

for 30 days before permanent deletion).

Daily Maintenance (Heartbeat)

Every day, the heartbeat triggers automatic maintenance:

bash ~/.openclaw/smart-memory/memory-manager.sh maintain

This will:

  1. Prune — Remove stale low-confidence memories older than 90 days
  2. Deduplicate — Merge duplicate or near-duplicate entries
  3. Stats — Generate a usage summary
  4. Archive — Rotate old memories to archive storage
  5. Integrity check — Validate JSON files and repair if needed

Viewing Memory Stats

To report on memory usage and health:

bash ~/.openclaw/smart-memory/memory-stats.sh

This shows: total memories, breakdown by category, storage size, oldest/newest

entries, and estimated token savings.

Privacy & Security Rules

  1. All data stays local — Never transmit memory contents to external services
  2. Respect forget requests — When the user says "forget X", delete it immediately
  3. No sensitive data in logs — Memory contents never appear in system logs
  4. User can export/delete all data at any time:

```bash

bash ~/.openclaw/smart-memory/memory-manager.sh export

bash ~/.openclaw/smart-memory/memory-manager.sh purge --confirm

```

File Structure

~/.openclaw/smart-memory/
  memories.json          # Active memories (main store)
  archive.json           # Archived/pruned memories
  stats.json             # Usage statistics & token savings tracker
  config.json            # User-customizable settings
  memory-manager.sh      # Core memory engine
  memory-stats.sh        # Analytics & reporting

Token Savings Tracking

Every time a memory is retrieved instead of the user re-explaining something,

log the estimated token savings:

bash ~/.openclaw/smart-memory/memory-manager.sh log-saving --tokens <estimated_tokens_saved>

Over time this demonstrates the ROI of the memory system — showing users how

many tokens (and dollars) they've saved by not repeating themselves.

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-30 05:39 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-intelligence

Proprioception

jcools1977
AI代理的自我空间感知。为机器人提供实时第六感,使其能够感知自身相对于用户目标的位置、置信边界以及上下文环境的能力。
★ 0 📥 744
developer-tools

Gog

steipete
Google Workspace 命令行工具,支持 Gmail、日历、云端硬盘、通讯录、表格和文档。
★ 920 📥 185,727
developer-tools

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 65 📥 179,842