Skip to main content

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

Metadata

Release files for NWcortex 1.3.1

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.3.1
File Size Uploaded Provenance Actions
nwcortex-1.3.1.tar.gz 683.0 kB Without provenance Details for nwcortex-1.3.1.tar.gz

Built distribution (wheel)

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

Total release size: 1.3 MB

Release files / nwcortex-1.3.1.tar.gz

Download URL nwcortex-1.3.1.tar.gz
Size 683.0 kB
Tags Source
SHA-256 checksum
How to use checksums
2ee2c6e6fa23633ae6fac5f1ef823e047d4317e37181f464cfbb63cd86619049
BLAKE2b-256 checksum
How to use checksums
f73115572705b7e265a189fb6f7e8f311b64ec165c4e6dceaf6f45afe88f7c64
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.3.1-py3-none-any.whl

Download URL nwcortex-1.3.1-py3-none-any.whl
Size 603.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7f68204fd9d2c82ecfab9aa50db9f58e1d9e4fbec38f536f6402994a57f3e601
BLAKE2b-256 checksum
How to use checksums
a1c484f3bd5c3d280e80ca98046c79986b6567570950cae4464798bbdf2ca8e0
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.3.1

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