Hippocampus

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).

MIT-0 · Free to use, modify, and redistribute. No attribution required.
24 · 4.9k · 20 current installs · 20 all-time installs
MIT-0
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Suspicious
medium confidence
Purpose & Capability
The name/description (persistent memory for agents) align with the included files and scripts: preprocess, scoring, summarization, recall, decay, and dashboard generation. Required binaries (python3, jq) and local filesystem access to ~/.openclaw/workspace are consistent with the stated purpose. Owner/source is unknown (repo URL present in metadata but 'Source: unknown' at top), which reduces trust but does not by itself make the capability incoherent.
!
Instruction Scope
SKILL.md and the agent/agentdir docs instruct the agent/operator to read all session histories, write and overwrite memory/index.json, and run cron jobs that periodically encode and decay memories. More importantly, several docs recommend adding a hippocampus background agent to the gateway config by inserting a systemPrompt — i.e., a system-prompt override that runs silently and monitors sessions. That is scope-expanding and persistent behavior (background monitoring) beyond simple on-demand memory helpers. The pre-scan also flagged prompt-injection patterns (system-prompt-override) inside SKILL.md; the skill explicitly tells operators how to override gateway prompts to create a background agent.
Install Mechanism
Installation is manual and self-contained: install.sh plus bundled scripts; there is no remote download or extract of code from unknown servers in the provided install spec. That is lower risk than an external download. install.sh may invoke the openclaw CLI to register cron jobs; if openclaw is absent it prints the commands. The installer makes scripts executable, initializes memory dirs and files, and can set up cron jobs — all local operations.
!
Credentials
The skill declares no required environment variables or credentials, which matches the included scripts. However, the runtime instructions and install.sh assume (and instruct) access to OpenClaw config files (~/.openclaw/config.yaml, openclaw.json) and the main session history. Those config-path modifications (adding a new agent with an explicit systemPrompt) are not declared in the metadata and represent elevated access to gateway configuration and to all conversation transcripts across sessions. Reading/writing all session history is expected for a memory system but is high-sensitivity and should be explicitly declared and authorized.
!
Persistence & Privilege
The skill does not set always:true, but the installer and docs encourage persistent setup: cron jobs for periodic encoding/decay and an optional background agent entry for the gateway that runs continuously and 'runs silently.' These produce lasting, autonomous behavior (periodic processing of conversation history and automatic file writes). The combination of autonomous cron/agent + instructions to override gateway system prompts increases the blast radius and deserves careful scrutiny before enabling.
Scan Findings in Context
[system-prompt-override] unexpected: A detected pattern warns that the SKILL.md/agent docs instruct operators to add a hippocampus agent entry into the gateway config with an explicit systemPrompt ('You are the agent's hippocampus...'). While a background memory agent is coherent with the skill, this is a system-prompt override that would create a persistent background agent; that qualifies as a privileged configuration change and is not harmless.
What to consider before installing
What to consider before installing: - This skill is largely coherent with its stated purpose: it runs local scripts to extract, score, summarize, store, and decay memories in ~/.openclaw/workspace/memory. The code is included (no remote downloads) which makes auditing possible. - Major caution: the docs explicitly recommend adding a background hippocampus agent into your OpenClaw gateway config (a systemPrompt override) and creating cron jobs that periodically process all session history. That effectively gives the skill an autonomous, persistent watcher of your conversations and the ability to update memory/index.json automatically. If you do not want continuous background processing or system-prompt changes, do NOT apply the gateway config snippets or the --with-agent option. - Practical steps to reduce risk: 1. Inspect omitted/remaining scripts (summarize-pending.sh, any scripts that invoke network or model APIs) before running. The archive truncated some files — verify what summarization steps call (LLM API, openclaw spawn, or remote endpoints). 2. Install without cron/agent first: run ./install.sh (no --with-cron, no --with-agent) and run encode-pipeline.sh manually with --no-spawn to see pending items. 3. Run pipeline with NO_SPAWN / --no-spawn mode and manually review pending-memories.json before allowing any automated summarization or sub-agent spawns. 4. Backup your workspace and existing memory/index.json before first run; consider chroot/sandbox or test account if you want to isolate data. 5. Do not merge the gateway config/systemPrompt snippets blindly. If you want periodic processing, prefer cron-triggered explicit commands rather than modifying gateway system prompts to run a silent background agent. 6. If you plan to let the skill index all sessions, accept that it will read and persist potentially sensitive user data; consider excluding channels/sessions you want to keep private. - If you need help auditing specific omitted scripts (e.g., summarization step or any network calls), provide their contents and I can review them for remote endpoints, credential use, or obfuscated behavior. Confidence note: medium — the files provided show clear alignment with the memory feature, but the presence of instructions to modify gateway/system prompts and the fact the source is not fully verified raise non-trivial concerns that warrant manual review and conservative deployment choices.

Like a lobster shell, security has layers — review code before you run it.

Current versionv3.8.6
Download zip
latestvk97drfvqzmyeecx2kkaqkrr3s980jrj6

License

MIT-0
Free to use, modify, and redistribute. No attribution required.

Runtime requirements

🧠 Clawdis
Binspython3, jq

SKILL.md

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

# 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

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

ScriptPurpose
preprocess.shExtract signals from conversation transcripts
encode-pipeline.shScore signals, prepare for LLM summarization
decay.shApply 0.99^days decay to all memories
recall.shSearch with importance weighting
load-core.shOutput high-importance memories for session start
sync-core.shGenerate HIPPOCAMPUS_CORE.md
consolidate.shWeekly review helper
reflect.shSelf-reflection prompts
generate-dashboard.shGenerate unified brain dashboard HTML

Brain Dashboard

Visual dashboard showing all installed brain skills:

./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)

SignalScore
Explicit "remember this"0.9
Emotional/vulnerable content0.85
Preferences ("I prefer...")0.8
Decisions made0.75
Facts about people/projects0.7
General knowledge0.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

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

Memory Index Schema

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

Cron Jobs

The encoding cron is the heart of the system:

# 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:

{
  "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:

## 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.

PartFunctionStatus
hippocampusMemory formation, decay, reinforcement✅ Live
amygdala-memoryEmotional processing✅ Live
vta-memoryReward and motivation✅ Live
basal-ganglia-memoryHabit formation🚧 Development
anterior-cingulate-memoryConflict detection🚧 Development
insula-memoryInternal state awareness🚧 Development

References


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

Files

27 total
Select a file
Select a file to preview.

Comments

Loading comments…