Bio-Inspired Memory System for Local LLMs: LTP and Selective Oblivion Implementation

Bio-Inspired Memory Architecture for Local LLMs
A developer has created a local MCP server that simulates human memory mechanics to maintain clean context for local LLMs. The system implements three bio-inspired layers in Python/TypeScript instead of a static RAG pipeline.
Core Memory Mechanics
- Reinforcement (Long-Term Potentiation): Each time a topic is queried, its
access_countincreases, strengthening frequently accessed memories. - Selective Oblivion: Unused connections decay over time, with the system automatically archiving weak atoms to prevent context pollution.
- Consolidation: A weekly "sleep" cycle distills recent logs into core knowledge atoms using a lightweight SLM.
Technical Implementation Details
- Hybrid Search: Combines
sqlite-vecfor semantic search with text fallbacks to prevent timeouts even if embeddings fail. - Non-Blocking MCP: Wraps synchronous database and embedding operations in
asyncioexecutors to keep LM Studio responsive. - Identity Layer: Uses a persistent "Soul" file (
soul.md) to maintain state and persona across sessions. - Access-Based Reinforcement: The
access_countmechanism enables the model to evolve based on interaction patterns rather than just retrieving static facts.
Development Context and Validation
The project was developed to address context limits in standard RAG implementations for local AI. The developer validated the architecture by having a local LLM (running Gemini) analyze the codebase, which highlighted three innovations: true cognitive agents using access-based reinforcement and decay, robust hybrid search with fallbacks, and non-blocking architecture for responsiveness.
The goal is to create a system that remembers what matters and forgets noise, similar to human memory during sleep. The developer is exploring whether bio-inspired memory architectures can solve context limitations locally without cloud dependencies or black boxes.
📖 Read the full source: r/LocalLLaMA
👀 See Also

NotebookLM MCP Structured: Free Server Connects Claude to NotebookLM with Automatic Prompt Structuring
A free MCP server called NotebookLM MCP Structured connects Claude Desktop to NotebookLM notebooks with automatic prompt structuring. The server restructures queries based on type (comparison, list, analysis, explanation, or extraction) and adds completeness checks and fidelity constraints.

Unsloth Studio enables 2x training speed with 70% VRAM reduction for local AI fine-tuning
Unsloth Studio provides tools to train and fine-tune language models on local hardware with 2x faster training and 70% VRAM reduction. It supports exporting models to GGUF format for use with Ollama and enables full local AI coding workflows on 24GB hardware like RTX 4090.

Pilot Shell: A Structured Workflow Layer for Claude Code
Pilot Shell adds spec-driven TDD workflows, quality hooks, context engineering, and token optimization on top of Claude Code — without the complexity of multi-agent frameworks.

Cortex: A Local Memory Layer for OpenClaw Agents with Ebbinghaus Decay
Cortex is an open-source memory tool built to solve context compaction issues in OpenClaw agents. It implements Ebbinghaus forgetting curves for fact decay, imports from files first, and runs as a single 19MB Go binary with SQLite.