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.
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 (true forgetting) | โ | โ | โ | โ |
| 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 Right Way (NWC v1.3):
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
- Recency boost โ recently accessed memories activate more readily
๐๏ธ 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: Archive โโโ Compressed summaries, not in real-time retrieval
โ reactivate on query similarity
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")
๐ฆ 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.3.1.tar.gz.
File metadata
- Download URL: nwcortex-1.3.1.tar.gz
- Upload date:
- Size: 683.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ee2c6e6fa23633ae6fac5f1ef823e047d4317e37181f464cfbb63cd86619049
|
|
| MD5 |
4a686ebf5f31b7a29663adcc63d1e1c6
|
|
| BLAKE2b-256 |
f73115572705b7e265a189fb6f7e8f311b64ec165c4e6dceaf6f45afe88f7c64
|
File details
Details for the file nwcortex-1.3.1-py3-none-any.whl.
File metadata
- Download URL: nwcortex-1.3.1-py3-none-any.whl
- Upload date:
- Size: 603.8 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 |
7f68204fd9d2c82ecfab9aa50db9f58e1d9e4fbec38f536f6402994a57f3e601
|
|
| MD5 |
3db2539a75974137773e124bc8c7a9ec
|
|
| BLAKE2b-256 |
a1c484f3bd5c3d280e80ca98046c79986b6567570950cae4464798bbdf2ca8e0
|