Skip to main content

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

Metadata

Release files for NWcortex 1.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for NWcortex 1.4.0
File Size Uploaded Provenance Actions
nwcortex-1.4.0.tar.gz 700.6 kB Without provenance Details for nwcortex-1.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for NWcortex 1.4.0
File Interpreter ABI Platform Actions
nwcortex-1.4.0-py3-none-any.whl Python 3 none any Details for nwcortex-1.4.0-py3-none-any.whl

Total release size: 1.3 MB

Release files / nwcortex-1.4.0.tar.gz

Download URL nwcortex-1.4.0.tar.gz
Size 700.6 kB
Tags Source
SHA-256 checksum
How to use checksums
3f1864956922f51213ed980055143c44928fe575d0bd8838e39bd7516472a2a5
BLAKE2b-256 checksum
How to use checksums
c687c91564b2ca02cb8abf97427e4cb61143df618cae82b0a99493f75f2173c2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.9

Release files / nwcortex-1.4.0-py3-none-any.whl

Download URL nwcortex-1.4.0-py3-none-any.whl
Size 626.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b813e92c8abd8e41262cdfbc48d24699003c13df9cb86a472ee3eccb9c04ec14
BLAKE2b-256 checksum
How to use checksums
e6c9c3a4f44684c628461ee793d2ee6a3e742236c185be44c043d315cf569392
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.9

Security for NWcortex 1.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page