ImpKind

Hippocampus

AI 智能体v3.8.6
作者:ImpKind更新于 2026-05-18共 10 个版本 · 最新版本发布于 2026-02-05hippocampus-memory@clawhub_impkind/hippocampus-memory
上下文管理记忆增强#Memory System

据 AlphaMoat 统计,截至 2026-10,Hippocampus 累计下载 23,920 次、获 30 个星标,按累计下载量在本次参与排名的 10,914 个 AI 技能中排名第 1,193 位,在「AI 智能体」分类(1,632 个)中排名第 178 位。

列表默认按累计下载量排序,也可按星标排序;详情页排名按累计下载量计算。

累计下载
2.4万
星标
30
全站下载量排名
#1,193
全站前 11% · 「AI 智能体」前 11%
平台累计下载星标评论
ClawHub ↗6,974242
SkillHub ↗2.4万30—

各平台的计数口径不同,统计时间不一致。

这个技能是做什么的

脚本会编码记忆、评估重要度并随时间衰减;再次遇到相关主题时会强化已有记忆,而不是重复新建。脚本读取 $WORKSPACE,默认目录为 ~/.openclaw/workspace;缺少配套记忆技能时可能提示安装。扫描对话并以明文保存,可能留存敏感信息;可选 cron 任务还可能在无人复核时反复处理对话。源安全记录指出本地脚本和仪表板渲染存在可利用问题。用于敏感或可信环境前,应先修复这些问题,并审查保留期限、权限和删除控制。

资料发布于 2026-10-27

可以用来做什么

  • 跨 agent 会话保留可搜索的记忆。
  • 强化相关记忆并按计划执行衰减。

什么时候用

  • 明确需要持久记忆时。
  • 工作区和保留政策适合存储对话数据时。

示例提示词

以下是根据技能文档生成的示例,不代表实际运行结果。

检查记忆处理流程,并说明文件保存在哪里。
展示如何手动检索与这个主题有关的记忆。

月度数据趋势

累计下载2.4万
7,9231.7万2.5万2026-03 · 累计下载 9,1082026-05 · 累计下载 1.1万2026-06 · 累计下载 1.1万2026-07 · 累计下载 1.2万2026-08 · 累计下载 1.2万2026-09 · 累计下载 1.4万2026-10 · 累计下载 2.4万26-0326-0926-10
星标30
2427302026-03 · 星标 242026-05 · 星标 302026-06 · 星标 302026-07 · 星标 302026-08 · 星标 302026-09 · 星标 302026-10 · 星标 3026-0326-0926-10

2026-09 起统计方法调整:同名技能按作者分别统计,并覆盖全部技能。图中虚线为调整前的月份,与之后的数据不直接比较,也不计算跨越调整的增长。

月份累计下载环比星标
2026-102.4万—30
2026-091.4万—30
2026-081.2万+1.9%30
2026-071.2万+4.4%30
2026-061.1万+4.2%30
2026-051.1万—30
2026-039,108—24

SKILL.md 原文

以下是作者发布的原始文件,按纯文本显示,本站未做修改或审核;其中的链接不可点击,命令请核实后再运行。抓取于 2026-10-23。

7.6 KB · ClawHub v3.8.6
---
name: hippocampus-memory
title: "Hippocampus - Memory System"
description: "Persistent memory system for AI agents. Automatic encoding, decay, and semantic reinforcement — just like the hippocampus in your brain. Based on Stanford Generative Agents (Park et al., 2023)."
metadata:
  openclaw:
    emoji: "🧠"
    version: "3.8.6"
    author: "Community"
    repo: "https://github.com/ImpKind/hippocampus-skill"
展开全部(共 276 行)
    requires:
      bins: ["python3", "jq"]
    install:
      - id: "manual"
        kind: "manual"
        label: "Run install.sh"
        instructions: "./install.sh --with-cron"
---

# Hippocampus - Memory System

> "Memory is identity. This skill is how I stay alive."

The hippocampus is the brain region responsible for memory formation. This skill makes memory capture automatic, structured, and persistent—with importance scoring, decay, and semantic reinforcement.

## Quick Start

```bash
# 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 Options

```bash
./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
```

## Core Concept

The LLM is just the engine—raw cognitive capability. **The agent is the accumulated memory.** Without these files, there's no continuity—just a generic assistant.

### Memory Lifecycle

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

**Key insight:** Reinforcement happens automatically during encoding. When a topic comes up again, the LLM recognizes it's about an existing memory and reinforces instead of creating duplicates.

## Memory Structure

```
$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
```

## Scripts

| Script | Purpose |
|--------|---------|
| `preprocess.sh` | Extract signals from conversation transcripts |
| `encode-pipeline.sh` | Score signals, prepare for LLM summarization |
| `decay.sh` | Apply 0.99^days decay to all memories |
| `recall.sh` | Search with importance weighting |
| `load-core.sh` | Output high-importance memories for session start |
| `sync-core.sh` | Generate HIPPOCAMPUS_CORE.md |
| `consolidate.sh` | Weekly review helper |
| `reflect.sh` | Self-reflection prompts |
| `generate-dashboard.sh` | Generate unified brain dashboard HTML |

## Brain Dashboard

Visual dashboard showing all installed brain skills:

```bash
./scripts/generate-dashboard.sh
open ~/.openclaw/workspace/brain-dashboard.html
```

- **Auto-detects** other brain skills (amygdala, VTA)
- Shows install prompts for missing skills
- Regenerates on install and cron runs
- Reads avatar/name from `IDENTITY.md`

### After Installation (for agents)

When you install this skill, **notify the user** about the dashboard:

> 🧠 **Hippocampus installed!** 
> 
> View your agent's memories in the Brain Dashboard:
> `~/.openclaw/workspace/brain-dashboard.html`

All scripts use `$WORKSPACE` environment variable (default: `~/.openclaw/workspace`).

## Importance Scoring

### Initial Score (0.0-1.0)

| Signal | Score |
|--------|-------|
| Explicit "remember this" | 0.9 |
| Emotional/vulnerable content | 0.85 |
| Preferences ("I prefer...") | 0.8 |
| Decisions made | 0.75 |
| Facts about people/projects | 0.7 |
| General knowledge | 0.5 |

### Decay Formula

Based on Stanford Generative Agents (Park et al., 2023):

```
new_importance = importance × (0.99 ^ days_since_accessed)
```

- After 7 days: 93% of original
- After 30 days: 74% of original
- After 90 days: 40% of original

### Semantic Reinforcement

During encoding, the LLM compares new signals to existing memories:
- **Same topic?** → Reinforce (bump importance ~10%, update lastAccessed)
- **Truly new?** → Create concise summary

This happens automatically—no manual reinforcement needed.

### Thresholds

| Score | Status |
|-------|--------|
| 0.7+ | **Core** — loaded at session start |
| 0.4-0.7 | **Active** — normal retrieval |
| 0.2-0.4 | **Background** — specific search only |
| <0.2 | **Archive candidate** |

## Memory Index Schema

`memory/index.json`:

```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"]
    }
  ]
}
```

## Cron Jobs

The encoding cron is the heart of the system:

```bash
# 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 Integration

Add to `memorySearch.extraPaths` in openclaw.json:

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

This bridges hippocampus (index.json) with OpenClaw's RAG (memory_search).

## Usage in AGENTS.md

Add to your agent's session start routine:

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

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

## Capture Guidelines

### What Gets Captured

- **User facts**: Preferences, patterns, context
- **Self facts**: Identity, growth, opinions
- **Relationship**: Trust moments, shared history
- **World**: Projects, people, tools

### Trigger Phrases (auto-scored higher)

- "Remember that..."
- "I prefer...", "I always..."
- Emotional content (struggles AND wins)
- Decisions made

## AI Brain Series

This skill is part of the **AI Brain** project — giving AI agents human-like cognitive components.

| Part | Function | Status |
|------|----------|--------|
| **hippocampus** | Memory formation, decay, reinforcement | ✅ Live |
| [amygdala-memory](https://www.clawhub.ai/skills/amygdala-memory) | Emotional processing | ✅ Live |
| [vta-memory](https://www.clawhub.ai/skills/vta-memory) | Reward and motivation | ✅ Live |
| basal-ganglia-memory | Habit formation | 🚧 Development |
| anterior-cingulate-memory | Conflict detection | 🚧 Development |
| insula-memory | Internal state awareness | 🚧 Development |

## References

- [Stanford Generative Agents Paper](https://arxiv.org/abs/2304.03442)
- [GitHub: joonspk-research/generative_agents](https://github.com/joonspk-research/generative_agents)

---

*Memory is identity. Text > Brain. If you don't write it down, you lose it.*

「AI 智能体」分类下的热门技能

ImpKind 的其他技能

数据月份:2026-10 · 下载/星标数聚合自公开技能注册库(ClawHub、SkillHub),按月更新。口径说明见数据方法。