hippocampus
Background memory organ for AI agents. Runs separately from the main agent—encoding, decaying, and reinforcing memories automatically. Just like the real hippocampus in your brain. Based on Stanford Generative Agents (Park et al., 2023).
What this skill does
# Hippocampus Skill
> "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 reinforcement.
## Quick Start
```bash
# Install
./install.sh --with-cron
# Load core memories
./scripts/load-core.sh
# Search with importance weighting
./scripts/recall.sh "query" --reinforce
# Apply decay (runs daily via cron)
./scripts/decay.sh
```
## 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
```
CAPTURE → SCORE → STORE → DECAY/REINFORCE → RETRIEVE
↑ │
└────────────────────────────────────────────┘
```
## Memory Structure
```
$WORKSPACE/
├── memory/
│ ├── index.json # Central weighted index
│ ├── 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 |
|--------|---------|
| `decay.sh` | Apply 0.99^days decay to all memories |
| `reinforce.sh` | Boost importance when memory is used |
| `recall.sh` | Search with importance weighting |
| `load-core.sh` | Output high-importance memories |
| `sync-core.sh` | Generate HIPPOCAMPUS_CORE.md |
| `preprocess.sh` | Extract signals from transcripts |
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
### Reinforcement Formula
When a memory is accessed and useful:
```
new_importance = old + (1 - old) × 0.15
```
Each use adds ~15% of remaining headroom toward 1.0.
### Thresholds
| Score | Status |
|-------|--------|
| 0.7+ | **Core** — high priority |
| 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",
"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
Set up via OpenClaw cron:
```bash
# Daily decay at 3 AM
openclaw cron add --name hippocampus-decay \
--cron "0 3 * * *" \
--session main \
--system-event "🧠 Run: WORKSPACE=\$WORKSPACE decay.sh"
# Weekly consolidation
openclaw cron add --name hippocampus-consolidate \
--cron "0 21 * * 6" \
--session main \
--system-event "🧠 Weekly consolidation time"
```
## 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" --reinforce
\`\`\`
```
## Capture Guidelines
### What to Capture
- **User facts**: Preferences, patterns, context
- **Self facts**: Identity, growth, opinions
- **Relationship**: Trust moments, shared history
- **World**: Projects, people, tools
### Trigger Phrases
Auto-capture when you hear:
- "Remember that..."
- "I prefer...", "I always..."
- Emotional content (struggles AND wins)
- Decisions made
## 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.*
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.