Skip to main content

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

version license python status stars llm-free activation lifecycle

๐Ÿง  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:

  1. Historical activation โ€” how often has each memory been accessed?
  2. Edge strength โ€” how strongly are memories connected (reinforced by co-use)?
  3. Temporal decay โ€” edges weaken naturally over days of disuse (but NEVER to zero)
  4. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nwcortex-1.4.0.tar.gz (700.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nwcortex-1.4.0-py3-none-any.whl (626.5 kB view details)

Uploaded Python 3

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

Hashes for nwcortex-1.4.0.tar.gz
Algorithm Hash digest
SHA256 3f1864956922f51213ed980055143c44928fe575d0bd8838e39bd7516472a2a5
MD5 4fecf022bbc60c778b059309bfd1653a
BLAKE2b-256 c687c91564b2ca02cb8abf97427e4cb61143df618cae82b0a99493f75f2173c2

See more details on using hashes here.

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

Hashes for nwcortex-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b813e92c8abd8e41262cdfbc48d24699003c13df9cb86a472ee3eccb9c04ec14
MD5 cf5ede926b8085c9a083215d9dff0d3c
BLAKE2b-256 e6c9c3a4f44684c628461ee793d2ee6a3e742236c185be44c043d315cf569392

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page