Install
openclaw skills install @shing19/engramaiNeuroscience-grounded memory for AI agents. Add, recall, and manage memories with ACT-R activation, Hebbian learning, and cognitive consolidation.
openclaw skills install @shing19/engramaiCognitive memory system implementing ACT-R activation, Memory Chain consolidation, Ebbinghaus forgetting, and Hebbian learning.
pip install engramai
from engram import Memory
mem = Memory("./agent.db")
mem.add("User prefers concise answers", type="relational", importance=0.8)
results = mem.recall("user preferences", limit=5)
mem.consolidate() # Daily maintenance
# Add a memory
neuromem add "User prefers dark mode" --type preference --importance 0.8
# Recall memories
neuromem recall "user preferences"
# View statistics
neuromem stats
# Run consolidation (like sleep)
neuromem consolidate
# Prune weak memories
neuromem forget --threshold 0.01
# List memories
neuromem list --limit 20
# Show Hebbian links
neuromem hebbian "dark mode"
For AI agents to use engram correctly, follow these patterns:
| Trigger | Action | Example |
|---|---|---|
| Learn user preference | store(type="relational") | "User prefers concise answers" |
| Learn important fact | store(type="factual") | "Project uses Python 3.12" |
| Learn how to do something | store(type="procedural") | "Deploy requires running tests first" |
| Question about history | recall() first, then answer | "What did I say about X?" |
| User satisfied | reward("positive feedback") | Strengthens recent memories |
| User unsatisfied | reward("negative feedback") | Suppresses recent memories |
| Daily maintenance | consolidate() + forget() | Run via cron or heartbeat |
✅ Store:
❌ Don't store:
| Level | Use For |
|---|---|
| 0.9-1.0 | Critical info (API keys location, absolute preferences) |
| 0.7-0.8 | Important (code style, project structure) |
| 0.5-0.6 | Normal (general facts, experiences) |
| 0.3-0.4 | Low priority (casual chat, temp notes) |
Use engram alongside file-based memory:
Add to your heartbeat or cron:
## Memory Maintenance (Daily)
- [ ] engram.consolidate
- [ ] engram.forget --threshold 0.01
factual — Facts and knowledgeepisodic — Events and experiencesrelational — Relationships and preferencesemotional — Emotional momentsprocedural — How-to knowledgeopinion — Beliefs and opinionsFor Claude/Cursor/Clawdbot integration:
python -m engram.mcp_server --db ./agent.db
MCP Config (Clawdbot):
mcp:
servers:
engram:
command: python3
args: ["-m", "engram.mcp_server"]
env:
ENGRAM_DB_PATH: ~/.clawdbot/agents/main/memory.db
Tools: engram.store, engram.recall, engram.consolidate, engram.forget, engram.reward, engram.stats, engram.export
| Feature | Description |
|---|---|
| ACT-R Activation | Retrieval ranked by recency × frequency × context |
| Memory Chain | Dual-system consolidation (working → core) |
| Ebbinghaus Forgetting | Natural decay with spaced repetition |
| Hebbian Learning | "Neurons that fire together wire together" |
| Confidence Scoring | Metacognitive monitoring |
| Reward Learning | User feedback shapes memory |
| Zero Dependencies | Pure Python stdlib + SQLite |