NeuroWeave Cortex (NWC) โ Graph-first cognitive memory runtime for AI agents. Hippocampal-inspired architecture with domain routing, spreading activation, edge budget management, 4-layer compression, thermal storage, personality modeling, and 8-phase sleep consolidation.
Project description
๐ง NeuroWeave Cortex
A Hippocampal-Inspired Cognitive Memory Engine for AI Agents
Not a vector database. Not a graph database. Not RAG.
Not even an "LLM-powered memory system".
A self-organizing cognitive memory โ memory is structured by use, not by prompt.
No memory is ever deleted. Only accessibility changes.
LLM reads memory. LLM does not decide what memory says.
โจ Core Design Principle
Memory structure is decided by the memory system, not by the LLM.
The LLM can read memory. The LLM can maintain memory (summarize, merge, archive).
But the LLM does not determine retrieval paths, edge weights, or relevance scores.
Brightness = f(historical access frequency, recency, edge strength)
NOT f(LLM-generated vector at query time)
This is the difference between a memory system that learns and one that re-computes every time.
๐ฌ What Makes It Different
Vector databases retrieve. Graph databases traverse. RAG systems query.
NeuroWeave Cortex learns from use:
| Capability | Vector DB | Graph DB | RAG | NWC |
|---|---|---|---|---|
| Semantic retrieval | โ | โ | โ | โ |
| Graph traversal | โ | โ | โ | โ |
| Activation-based retrieval | โ | โ | โ | โ |
| Edge decay (no deletion) | โ | โ | โ | โ |
| Memory never deleted | โ | โ | โ | โ |
| Memory lifecycle (L1โL2โL3) | โ | โ | โ | โ |
| LLM-free retrieval routing | โ | โ | โ | โ |
| LLM for maintenance only | โ | โ | โ | โ |
| Sleep consolidation | โ | โ | โ | โ |
| Source attribution & trust | โ | โ | โ | โ |
๐ง How Retrieval Actually Works
The Wrong Way (what most systems do):
Query โ LLM generates embedding โ LLM decides what's relevant โ Return
Problem: LLM is the router. Every retrieval is a new LLM computation. Nothing stabilizes.
The NWC Way (v1.4.0):
Query โ Embedding โ Find seed nodes โ Activation spread โ Return
The LLM never touches the retrieval path. Retrieval is driven by:
- Historical activation โ how often has each memory been accessed?
- Edge strength โ how strongly are memories connected (reinforced by co-use)?
- Temporal decay โ edges weaken naturally over days of disuse (but NEVER to zero)
- Recency boost โ recently accessed memories activate more readily
๐๏ธ Core Design Principle: No Memory Is Ever Deleted
Traditional memory systems: Store โ Retrieve โ Delete (when full)
NWC memory system: Create โ Activate โ Dim โ Dormant โ Reactivate โพ๏ธ
Memories do NOT have a "delete" state. They transition between activation levels:
- 1.0 โ currently active (just recalled)
- 0.7 โ frequent access
- 0.3 โ infrequent but known
- 0.1 โ dormant (not accessed in a long time)
- 0.01 โ deep dormant (years old)
Even a memory with activation_level = 0.01 is retrievable โ if activation
propagation from a connected query reaches it. This mimics human memory:
you may not think about your elementary school classmates for decades,
but a single photo can bring everything flooding back.
๐๏ธ Memory Layers (L0โL3)
NWC organizes memory into four cognitively-grounded layers:
L0: Input โโโ Ephemeral, per-session only (minutes)
โ promote on repeated access (>3 times) or age (>30 days)
L1: Working โโโ Recent active memories (hours-days)
โ LLM maintains: add, merge, summarize
โ System routes: retrieval is LLM-free
โ consolidate
L2: Long-term โโโ Stable facts, experiences, relationships (months-years)
โ ONLY operations: strengthen, supplement, weaken
โ NEVER: full reconstruction
โ archive on 90d no-access or low importance
L3: Dormant โโโ Low-activation memories retrievable via propagation (years)
โ NEVER deleted. Only activation_level approaches 0.
โ reactivate on query similarity or activation propagation
This is not a flat table. Memories physically transition between layers based on access patterns โ just like human memory.
๐ Quick Start
pip install NWcortex
from star_graph import MemoryManager, AgentContext
mgr = MemoryManager()
# Remember
mgr.remember("User prefers type hints and concise code", tags=["preference"])
mgr.remember("Debugged Redis timeout โ pool 10 โ 20", tags=["redis","debug"])
# Recall (LLM-free activation spreading)
ctx = AgentContext(task_type="debugging")
memories = mgr.recall("Redis connection pool config", context=ctx)
# Sleep: consolidate, migrate layers, decay weak edges
report = mgr.sleep()
# Persist
mgr.save("agent_memory.db")
โก LoCoMo-10 Benchmark
10 conversations ยท 5,882 turns ยท 1,986 QA pairs ยท Zero LLM calls
| Method | has_answer | ฮ vs Vector |
|---|---|---|
| Pure Vector Search | 25.3% | โ |
| Cosine + BM25 | 31.5% | +6.2 pp |
| NWC (BM40+txt60) | 44.1% | +18.8 pp |
๐ฆ Installation
| Command | Includes |
|---|---|
pip install NWcortex |
Core engine (138 modules) |
pip install "NWcortex[embeddings]" |
+ sentence-transformers |
pip install "NWcortex[mcp]" |
+ MCP Server |
pip install "NWcortex[all]" |
Everything |
๐งช Running Tests
pip install pytest pytest-cov
pytest tests/ -v
๐ Citation
@software{neuroweave_cortex,
title = {NeuroWeave Cortex: A Hippocampal-Inspired Cognitive Memory System},
author = {Thatgfsj},
year = {2026},
url = {https://github.com/Thatgfsj/neuroweave-cortex}
}
โ๏ธ License
MIT
Report a bug ยท Discussion ยท Roadmap
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nwcortex-1.4.0.tar.gz.
File metadata
- Download URL: nwcortex-1.4.0.tar.gz
- Upload date:
- Size: 700.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3f1864956922f51213ed980055143c44928fe575d0bd8838e39bd7516472a2a5
|
|
| MD5 |
4fecf022bbc60c778b059309bfd1653a
|
|
| BLAKE2b-256 |
c687c91564b2ca02cb8abf97427e4cb61143df618cae82b0a99493f75f2173c2
|
File details
Details for the file nwcortex-1.4.0-py3-none-any.whl.
File metadata
- Download URL: nwcortex-1.4.0-py3-none-any.whl
- Upload date:
- Size: 626.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b813e92c8abd8e41262cdfbc48d24699003c13df9cb86a472ee3eccb9c04ec14
|
|
| MD5 |
cf5ede926b8085c9a083215d9dff0d3c
|
|
| BLAKE2b-256 |
e6c9c3a4f44684c628461ee793d2ee6a3e742236c185be44c043d315cf569392
|