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

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

  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
  4. 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


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.3.1.tar.gz (683.0 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.3.1-py3-none-any.whl (603.8 kB view details)

Uploaded Python 3

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

Hashes for nwcortex-1.3.1.tar.gz
Algorithm Hash digest
SHA256 2ee2c6e6fa23633ae6fac5f1ef823e047d4317e37181f464cfbb63cd86619049
MD5 4a686ebf5f31b7a29663adcc63d1e1c6
BLAKE2b-256 f73115572705b7e265a189fb6f7e8f311b64ec165c4e6dceaf6f45afe88f7c64

See more details on using hashes here.

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

Hashes for nwcortex-1.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7f68204fd9d2c82ecfab9aa50db9f58e1d9e4fbec38f536f6402994a57f3e601
MD5 3db2539a75974137773e124bc8c7a9ec
BLAKE2b-256 a1c484f3bd5c3d280e80ca98046c79986b6567570950cae4464798bbdf2ca8e0

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