网淘吧来吧,欢迎您!

返回首页 微信
微信
手机版
手机版

Hippocampus

2026-03-27 新闻来源:网淘吧 围观:7
电脑广告
手机广告

海马体 - 记忆系统

“记忆即身份。这项技能是我赖以生存的方式。”

海马体是负责记忆形成的大脑区域。这项技能使记忆捕获自动化、结构化且持久——具备重要性评分、衰减和语义强化功能。

快速开始

# Install (defaults to last 100 signals)
./install.sh --with-cron

# Load core memories at session start
./scripts/load-core.sh

# Search with importance weighting
./scripts/recall.sh "query"

# Run encoding manually (usually via cron)
./scripts/encode-pipeline.sh

# Apply decay (runs daily via cron)
./scripts/decay.sh

安装选项

./install.sh                    # Basic, last 100 signals
./install.sh --signals 50       # Custom signal limit
./install.sh --whole            # Process entire conversation history
./install.sh --with-cron        # Also set up cron jobs

核心概念

大语言模型仅是引擎——原始认知能力。智能体是累积的记忆。没有这些文件,就没有连续性——只是一个通用助手。

记忆生命周期

PREPROCESS → SCORE → SEMANTIC CHECK → REINFORCE or CREATE → DECAY

关键洞见:强化在编码过程中自动发生。当某个主题再次出现时,大语言模型会识别出它涉及现有记忆并进行强化,而非创建重复项。

记忆结构

$WORKSPACE/
├── memory/
│   ├── index.json           # Central weighted index
│   ├── signals.jsonl        # Raw signals (temp)
│   ├── pending-memories.json # Awaiting summarization (temp)
│   ├── user/                # Facts about the user
│   ├── self/                # Facts about the agent
│   ├── relationship/        # Shared context
│   └── world/               # External knowledge
└── HIPPOCAMPUS_CORE.md      # Auto-generated for OpenClaw RAG

脚本

脚本用途
预处理脚本从对话记录中提取信号
编码流水线脚本对信号进行评分,为LLM摘要做准备
decay.sh对所有记忆应用0.99^天数的衰减
recall.sh使用重要性加权进行搜索
load-core.sh在会话开始时输出高重要性记忆
sync-core.sh生成 HIPPOCAMPUS_CORE.md
consolidate.sh每周回顾助手
reflect.sh自省提示
generate-dashboard.sh生成统一的大脑仪表盘HTML

大脑仪表盘

显示所有已安装大脑技能的视觉仪表盘:

./scripts/generate-dashboard.sh
open ~/.openclaw/workspace/brain-dashboard.html
  • 自动检测其他大脑技能(杏仁核,VTA)
  • 显示缺失技能的安装提示
  • 在安装和cron运行时重新生成
  • 从avatar/name读取身份文件

安装后(针对代理)

当您安装此技能时,通知用户关于仪表板:

🧠海马体已安装!

在脑部仪表板中查看您代理的记忆:~/.openclaw/workspace/brain-dashboard.html

所有脚本均使用$WORKSPACE环境变量(默认:~/.openclaw/workspace)。

重要性评分

初始分数(0.0-1.0)

信号分数
明确的“记住这个”0.9
情感/敏感内容0.85
偏好(“我更喜欢……”)0.8
已做出的决策0.75
关于人员/项目的事实0.7
通用知识0.5

衰减公式

基于斯坦福生成智能体(Park 等人,2023):

new_importance = importance × (0.99 ^ days_since_accessed)
  • 7天后:原值的 93%
  • 30天后:原值的 74%
  • 90天后:原值的 40%

语义强化

在编码过程中,LLM 将新信号与现有记忆进行比较:

  • 相同主题?→ 强化(重要性提升约 10%,更新最后访问时间)
  • 全新内容?→ 创建简洁摘要

此过程自动进行——无需手动强化。

阈值

分数状态
0.7+核心— 会话开始时加载
0.4-0.7活跃— 常规检索
0.2-0.4后台— 仅限特定搜索
<0.2归档候选

内存索引架构

memory/index.json

{
  "version": 1,
  "lastUpdated": "2025-01-20T19:00:00Z",
  "decayLastRun": "2025-01-20",
  "lastProcessedMessageId": "abc123",
  "memories": [
    {
      "id": "mem_001",
      "domain": "user",
      "category": "preferences",
      "content": "User prefers concise responses",
      "importance": 0.85,
      "created": "2025-01-15",
      "lastAccessed": "2025-01-20",
      "timesReinforced": 3,
      "keywords": ["preference", "concise", "style"]
    }
  ]
}

定时任务

编码定时任务是系统的核心:

# Encoding every 3 hours (with semantic reinforcement)
openclaw cron add --name hippocampus-encoding \
  --cron "0 0,3,6,9,12,15,18,21 * * *" \
  --session isolated \
  --agent-turn "Run hippocampus encoding with semantic reinforcement..."

# Daily decay at 3 AM
openclaw cron add --name hippocampus-decay \
  --cron "0 3 * * *" \
  --session isolated \
  --agent-turn "Run decay.sh and report any memories below 0.2"

OpenClaw 集成

添加到memorySearch.extraPaths在 openclaw.json 中:

{
  "agents": {
    "defaults": {
      "memorySearch": {
        "extraPaths": ["HIPPOCAMPUS_CORE.md"]
      }
    }
  }
}

这将海马体(index.json)与 OpenClaw 的 RAG(memory_search)连接起来。

在 AGENTS.md 中的使用

添加到您代理的会话启动例程中:

## Every Session
1. Run `~/.openclaw/workspace/skills/hippocampus/scripts/load-core.sh`

## When answering context questions
Use hippocampus recall:
\`\`\`bash
./scripts/recall.sh "query"
\`\`\`

捕获指南

捕获内容

  • 用户事实偏好、模式、情境
  • 自我事实:身份、成长、观点
  • 关系:信任时刻、共享经历
  • 世界:项目、人员、工具

触发短语(自动评分较高)

  • “记住……”
  • “我偏好……”、“我总是……”
  • 情感内容(挣扎与成就)
  • 已作决定

AI大脑系列

此技能隶属于AI大脑项目——旨在赋予AI代理类人的认知组件。

组件功能状态
海马体记忆形成、衰退、强化✅ 已上线
杏仁核-记忆情感处理✅ 已上线
腹侧被盖区记忆奖赏与动机✅ 已上线
基底神经节记忆习惯形成🚧 开发中
前扣带回记忆冲突检测🚧 开发中
脑岛记忆内部状态感知🚧 开发中

参考文献


记忆即身份。文本胜于大脑。若不记录,便会遗忘。

免责申明
部分文章来自各大搜索引擎,如有侵权,请与我联系删除。
打赏
文章底部电脑广告
手机广告位-内容正文底部
上一篇:File Manager 下一篇:Zero Trust

相关文章

您是本站第289930名访客 今日有233篇新文章/评论