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 ↗6974242
SkillHub ↗2.4萬30—

各平台的計數口徑不同,統計時間不一致。

這個技能是做什麼的

指令碼會編碼記憶、評估重要性並隨時間衰減;再次遇到相關主題時會強化既有記憶,而非重複建立。指令碼讀取 $WORKSPACE,預設目錄為 ~/.openclaw/workspace;缺少配套記憶技能時可能提示安裝。掃描對話並以純文字儲存,可能留存敏感資訊;選用的 cron 工作也可能在無人審查時反覆處理對話。來源安全紀錄指出本機指令碼和儀表板渲染存在可利用問題。用於敏感或受信任環境前,應先修復這些問題,並審查保留期限、權限和刪除控制。

資料釋出於 2026-10-27

可以用來做什麼

  • 跨 agent 工作階段保留可搜尋的記憶。
  • 強化相關記憶並依排程執行衰減。

什麼時候用

  • 明確需要持久記憶時。
  • 工作區和保留政策適合儲存對話資料時。

示例提示詞

以下是根據技能文件生成的示例,不代表實際執行結果。

檢查記憶處理流程,並說明檔案儲存位置。
展示如何手動搜尋與這個主題相關的記憶。

月度資料趨勢

累計下載2.4萬
79231.7萬2.5萬2026-03 · 累計下載 91082026-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-039108—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),按月更新。口徑說明見資料方法。