hippocampus
Brain-inspired memory system with dual storage: Chronicle (temporal SQLite+MD) and Monograph (important topics with rich metadata). User-configurable via USE...
Like a lobster shell, security has layers — review code before you run it.
License
SKILL.md
Hippocampus
Brain-inspired memory system with automatic execution
Why Setup Is Needed
Automatic creation is NOT possible because:
- OpenClaw Hooks: Built-in hooks require manual user configuration
- Cron Jobs: Cannot be created automatically - requires explicit user authorization
- Security: OpenClaw requires user confirmation for any automatic tasks
This is by design - it ensures you have full control over what automatic tasks run on your system.
Quick Setup (Takes 30 seconds)
After installation, simply say "setup hippocampus" or "configure memory" and I will guide you through the setup process.
What Will Happen
- I show you all cron jobs that will be created
- You confirm ONCE by saying "yes" or "confirm"
- I execute all at once - no repeated approvals
- Done! Automatic memory saving is enabled
What Gets Created
| Job | Schedule | Purpose |
|---|---|---|
| hippocampus-autosave | 0 */6 * * * | Auto-save every 6 hours |
| hippocampus-daily-create | 0 0 * * * | Create daily memory file |
| hippocampus-analyze | 0 23 * * * | Daily memory analysis |
Hook Setup (One-Click)
Say "setup hooks" or "/hip setup-hooks" and I will:
- Show what hooks will be configured
- Ask for your confirmation once
- Auto-configure session_start/session_end hooks
Manual Setup (Alternative)
If you prefer to do it yourself, here are the commands:
# Step 1: Initialize database (do this once)
python3 scripts/memory.py init
# Step 2: Create cron job
# Copy this command and run it yourself:
cron add --name "hippocampus-autosave" \
--schedule "0 */6 * * *" \
--session-target isolated \
--payload "Run: python3 /path/to/hippocampus/scripts/memory.py autocheck"
# Step 3: Verify
cron list
User Configuration
Edit USER_CONFIG.md to customize behavior before or after setup:
# Trigger Settings
ROUND_THRESHOLD = 25 # Save after X rounds
TIME_HOURS = 6 # Save after X hours
TOKEN_THRESHOLD = 10000 # Save to Monograph when tokens > X
# Storage Settings
BASE_PATH = ./assets/hippocampus
# Auto-Save
AUTO_SAVE = true
After editing, run: /hip config reload
Special Needs - Before/After Answer Memory
Hippocampus supports special memory types that are loaded before or after each answer:
BEFORE_ANSWER
Memory that should be loaded and considered before each response.
Use cases:
- Language preferences (e.g., "always use English")
- Style guidelines (e.g., "use technical terms")
- User-specific requirements
Example:
BEFORE_ANSWER = language_preferences
Create a monograph topic called "language_preferences" with your requirements.
AFTER_ANSWER
Memory that should be updated after each response.
Use cases:
- Conversation summary updates
- Key points tracking
- Context continuity
Example:
AFTER_ANSWER = conversation_summary
How to Use
-
Create a monograph topic:
/hip new language_preferences -
Add content to it:
/hip add Always use English... -
Edit USER_CONFIG.md:
BEFORE_ANSWER = language_preferences -
Reload:
/hip config reload
How Auto-Execution Works
┌─────────────────────────────────────────────────┐
│ TRIGGERS (from USER_CONFIG.md) │
├─────────────────────────────────────────────────┤
│ • TIME_HOURS: Every 6 hours (cron) │
│ • ROUND_THRESHOLD: Every 25 rounds │
│ • TOKEN_THRESHOLD: When tokens > 10,000 │
└─────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────┐
│ autocheck command │
│ (checks all thresholds) │
└─────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────┐
│ SAVE DECISION │
├─────────────────────────────────────────────────┤
│ • Tokens > TOKEN_THRESHOLD → Monograph │
│ • Otherwise → Chronicle │
└─────────────────────────────────────────────────┘
File Structure
hippocampus/ (SKILL PACKAGE - Git tracked)
├── SKILL.md # This file (includes instructions for AI to create examples)
├── USER_CONFIG.md # User settings (edit this!)
├── skill.yaml # Metadata
├── .gitignore # Excludes db files
└── scripts/
└── memory.py # Core engine
assets/hippocampus/ (USER DATA - Created on first use)
├── chronicle/ # Temporal memory (empty initially)
│ # AI will ask to create examples on first use
├── monograph/ # Important topics (empty initially)
│ # AI will ask to create examples on first use
└── index/ # Keyword index (auto-created at runtime)
All Commands
| Command | Description |
|---|---|
/hip setup / /hip setup-all | One-click setup all cron jobs |
/hip setup-hooks | Auto-configure session hooks |
/hip sync-memory | Sync to MEMORY.md (with confirm) |
/hip init | Initialize DB and directories |
/hip autocheck | Check triggers and auto-save |
/hip new <topic> | Create new monograph |
/hip add <content> | Add to current topic |
/hip save | Save to chronicle/monograph |
/hip recall <keyword> | Recall from memory |
/hip important | List monograph topics |
/hip search <keyword> | Cross-topic search |
/hip query [keyword] | Query chronicle |
/hip analyze | Analyze all memory |
/hip status | View status |
/hip config | Show USER_CONFIG.md |
/hip config reload | Reload config |
/hip files | Analyze files |
/hip collect | Collect related files |
Important Notes
- Setup is OPTIONAL: You can use the skill manually without cron
- YOU control what runs: Cron jobs can be deleted anytime with
cron remove - Data stays local: All memory files are stored in your workspace
- USER_CONFIG.md: The ONLY file you should edit
Privacy & Security
- No external servers: All data stays on your machine
- No automatic tasks without consent: You must confirm setup
- You can disable anytime: Edit USER_CONFIG.md or remove cron job
- Transparent: All code is readable in memory.py
Author
- GitHub: Gabe-luv-Nancy
- Version: 2.1.0
- Created: 2026-03-14
Files
5 totalComments
Loading comments…
