Neural Memory Enhanced
Associative memory with spreading activation for persistent, intelligent recall. Use PROACTIVELY when: (1) You need to remember facts, decisions, errors, or...
zhuyu28
@zhuyu28
What This Skill Does
A biologically-inspired associative memory system for AI agents that stores and retrieves facts, decisions, errors, and context across sessions using a neural graph with spreading activation, Hebbian learning, memory decay, and contradiction detection. It provides tools to remember, recall, auto-extract memories, and manage brain health.
Replaces vector search and keyword-based memory by finding conceptually related memories through graph traversal, even without embedding overlap.
When to Use It
- Store a decision or error encountered during a task for future reference
- Recall past context when a user asks 'do you remember...' or references a prior conversation
- Inject relevant memories at the start of a new session to maintain continuity
- Auto-extract decisions, errors, and TODOs from an important conversation
- Trace causal chains through memory when a user asks 'why did X happen?'
- Transfer memories between projects to share cross-domain knowledge
Install
$ openclaw skills install @zhuyu28/neural-memory-enhancedNeuralMemory — Associative Memory for AI Agents
A biologically-inspired memory system that uses spreading activation instead of keyword/vector search. Memories form a neural graph where neurons connect via 20 typed synapses. Frequently co-accessed memories strengthen their connections (Hebbian learning). Stale memories decay naturally. Contradictions are auto-detected.
Why not just vector search? Vector search finds documents similar to your query. NeuralMemory finds conceptually related memories through graph traversal — even when there's no keyword or embedding overlap. "What decision did we make about auth?" activates time + entity + concept neurons simultaneously and finds the intersection.
Setup
1. Install NeuralMemory
pip install neural-memory
nmem init
This creates ~/.neuralmemory/ with a default brain and configures MCP automatically.
2. Configure MCP for OpenClaw
Add to your OpenClaw MCP configuration (~/.openclaw/mcp.json or project openclaw.json):
{
"mcpServers": {
"neural-memory": {
"command": "python3",
"args": ["-m", "neural_memory.mcp"],
"env": {
"NEURALMEMORY_BRAIN": "default"
}
}
}
}
3. Verify
nmem stats
You should see brain statistics (neurons, synapses, fibers).
Tools Reference
Core Memory Tools
| Tool | Purpose | When to Use |
|---|---|---|
nmem_remember | Store a memory | After decisions, errors, facts, insights, user preferences |
nmem_recall | Query memories | Before tasks, when user references past context, "do you remember..." |
nmem_context | Get recent memories | At session start, inject fresh context |
nmem_todo | Quick TODO with 30-day expiry | Task tracking |
Intelligence Tools
| Tool | Purpose | When to Use |
|---|---|---|
nmem_auto | Auto-extract memories from text | After important conversations — captures decisions, errors, TODOs automatically |
nmem_recall (depth=3) | Deep associative recall | Complex questions requiring cross-domain connections |
nmem_habits | Workflow pattern suggestions | When user repeats similar action sequences |
Management Tools
| Tool | Purpose | When to Use |
|---|---|---|
nmem_health | Brain health diagnostics | Periodic checkup, before sharing brain |
nmem_stats | Brain statistics | Quick overview of memory counts |
nmem_version | Brain snapshots and rollback | Before risky operations, version checkpoints |
nmem_transplant | Transfer memories between brains | Cross-project knowledge sharing |
Workflow
At Session Start
- Call
nmem_contextto inject recent memories into your awareness - If user mentions a specific topic, call
nmem_recallwith that topic
During Conversation
- When a decision is made:
nmem_rememberwith type="decision" - When an error occurs:
nmem_rememberwith type="error" - When user states a preference:
nmem_rememberwith type="preference" - When asked about past events:
nmem_recallwith appropriate depth
At Session End
- Call
nmem_autowith action="process" on important conversation segments - This auto-extracts facts, decisions, errors, and TODOs
Examples
Remember a decision
nmem_remember(
content="Use PostgreSQL for production, SQLite for development",
type="decision",
tags=["database", "infrastructure"],
priority=8
)
Recall with spreading activation
nmem_recall(
query="database configuration for production",
depth=1,
max_tokens=500
)
Returns memories found via graph traversal, not keyword matching. Related memories (e.g., "deploy uses Docker with pg_dump backups") surface even without shared keywords.
Trace causal chains
nmem_recall(
query="why did the deployment fail last week?",
depth=2
)
Follows CAUSED_BY and LEADS_TO synapses to trace cause-and-effect chains.
Auto-capture from conversation
nmem_auto(
action="process",
text="We decided to switch from REST to GraphQL because the frontend needs flexible queries. The migration will take 2 sprints. TODO: update API docs."
)
Automatically extracts: 1 decision, 1 fact, 1 TODO.
Key Features
- Zero LLM dependency — Pure algorithmic: regex, graph traversal, Hebbian learning
- Spreading activation — Associative recall through neural graph, not keyword/vector search
- 20 synapse types — Temporal (BEFORE/AFTER), causal (CAUSED_BY/LEADS_TO), semantic (IS_A/HAS_PROPERTY), emotional (FELT/EVOKES), conflict (CONTRADICTS)
- Memory lifecycle — Short-term → Working → Episodic → Semantic with Ebbinghaus decay
- Contradiction detection — Auto-detects conflicting memories, deprioritizes outdated ones
- Hebbian learning — "Neurons that fire together wire together" — memory improves with use
- Temporal reasoning — Causal chain traversal, event sequences, temporal range queries
- Brain versioning — Snapshot, rollback, diff brain state
- Brain transplant — Transfer filtered knowledge between brains
- Vietnamese + English — Full bilingual support for extraction and sentiment
Depth Levels
| Depth | Name | Speed | Use Case |
|---|---|---|---|
| 0 | Instant | <10ms | Quick facts, recent context |
| 1 | Context | ~50ms | Standard recall (default) |
| 2 | Habit | ~200ms | Pattern matching, workflow suggestions |
| 3 | Deep | ~500ms | Cross-domain associations, causal chains |
Notes
- Memories are stored locally in SQLite at
~/.neuralmemory/brains/<brain>.db - No data is sent to external services (unless optional embedding provider is configured)
- Brain isolation: each brain is independent, no cross-contamination
nmem_rememberreturns fiber_id for reference tracking- Priority scale: 0 (trivial) to 10 (critical), default 5
- Memory types: fact, decision, preference, todo, insight, context, instruction, error, workflow, reference
Related skills
Neural Memory
@nhadaututthekyAssociative memory with spreading activation for persistent, intelligent recall. Use PROACTIVELY when: (1) You need to remember facts, decisions, errors, or...
Memory System V2
@kellyclaudeaiFast semantic memory system with JSON indexing, auto-consolidation, and <20ms search. Capture learnings, decisions, insights, events. Use when you need persistent memory across sessions or want to recall prior work/decisions.
Triple Memory
@ktpriyathamComplete memory system combining LanceDB auto-recall, Git-Notes structured memory, and file-based workspace search. Use when setting up comprehensive agent memory, when you need persistent context across sessions, or when managing decisions/preferences/tasks with multiple memory backends working together.
Triple Memory
@ktpriyathamComplete memory system combining LanceDB auto-recall, Git-Notes structured memory, and file-based workspace search. Use when setting up comprehensive agent memory, when you need persistent context across sessions, or when managing decisions/preferences/tasks with multiple memory backends working together.
Self-Improving + Proactive Agent
@ivangdavilaSelf-reflection + Self-criticism + Self-learning + Self-organizing memory. Agent evaluates its own work, catches mistakes, and improves permanently. Use when...
memory
@ivangdavilaRemembers, recalls, and organizes durable facts in a categorized markdown store at ~/Clawic/data/memory/, parallel to built-in agent memory. Use when the user says remember this, save this, note that for later, or don't forget; when they ask what did I tell you about X, when did we decide Y, or who is Z; when a stored fact is wrong, outdated, or contradicts what they just said; when they want something forgotten or deleted; when recall misses, returns stale facts, or slows down as the store grows; when duplicate or conflicting entries appear; when consolidating scattered notes, importing an existing vault, or sharing memory across devices and agents. Not for session-scoped context the runtime already holds, note-taking apps (notes), journaling practice (journal), or study techniques like spaced repetition (learn, active-recall).