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.2% +18.9 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

⚖️ License

MIT


Report a bug · Discussion · Roadmap

Metadata

Release files for NWcortex 1.4.2

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.2
File Size Uploaded Provenance
nwcortex-1.4.2.tar.gz 702.2 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 1.3 MB

Release files / nwcortex-1.4.2.tar.gz

Download URL nwcortex-1.4.2.tar.gz
Size 702.2 kB
Tags Source
SHA-256 checksum
How to use checksums
10dd8daa3d5a41c21ae3cd26a4c11fbfe039304808529d04033dc4eb6c93921f
BLAKE2b-256 checksum
How to use checksums
73b6833bcb4a2894546ab2be9c0b5bb1d1921320b10f28a8a9a4c443694decfd
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.2-py3-none-any.whl

Download URL nwcortex-1.4.2-py3-none-any.whl
Size 609.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2108a9deef82486c3f330508a82c327191202a6ea946aad9f0dd90e3ec13f0d4
BLAKE2b-256 checksum
How to use checksums
0a8d1394c33a47c1dd9cd82adc82134112c05fff11ada4ca4aa4d7e4b06e1c69
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.2

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.

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