Skip to main content

Information-geometric agent memory with mathematical guarantees

Project description

SuperLocalMemory

SuperLocalMemory V3

Information-Geometric Agent Memory with Mathematical Guarantees

The first agent memory system with mathematically grounded retrieval, lifecycle management, and consistency verification. Four-channel hybrid retrieval. Three operating modes. EU AI Act compliant.

Website arXiv Paper V3 DOI

Python 3.11+ MIT License EU AI Act 1400+ Tests Cross Platform Wiki


What is SuperLocalMemory?

SuperLocalMemory gives AI assistants persistent, structured memory that survives across sessions. Unlike simple vector stores, V3 uses information geometry to provide mathematically grounded retrieval, automatic contradiction detection, and self-organizing memory lifecycle management.

Works with: Claude, Cursor, Windsurf, VS Code Copilot, Continue, Cody, ChatGPT Desktop, Gemini CLI, JetBrains, Zed, and 17+ AI tools via MCP.

Upgrading from V2 (2.8.6)? V3 is a complete architectural reinvention — new mathematical engine, new retrieval pipeline, new storage schema. Your existing data is preserved but requires migration. After installing V3, run slm migrate to upgrade your data. Read the Migration Guide before upgrading. Backup is created automatically.

Key Results

Metric Score Context
LoCoMo (Mode A, zero-LLM) 62.3% Highest zero-LLM score. No cloud dependency.
LoCoMo (Mode C, full) ~78% Competitive with funded systems ($10M+)
Math layer improvement +12.7pp Average gain from mathematical foundations
Multi-hop improvement +12pp 50% vs 38% (math on vs off)

Three Operating Modes

Mode What LLM Required? EU AI Act Best For
A Local Guardian No Compliant Privacy-first, air-gapped, enterprise
B Smart Local Local only (Ollama) Compliant Enhanced quality, data stays local
C Full Power Cloud (optional) Partial Maximum accuracy, research

Mode A is the only agent memory that operates with zero cloud dependency while achieving competitive retrieval accuracy. All data stays on your device. No API keys required.


Architecture

Query  ──►  Strategy Classifier  ──►  4 Parallel Channels:
                                       ├── Semantic (Fisher-Rao graduated similarity)
                                       ├── BM25 (keyword matching, k1=1.2, b=0.75)
                                       ├── Entity Graph (spreading activation, 3 hops)
                                       └── Temporal (date-aware retrieval)
                                                    │
                                       RRF Fusion (k=60)
                                                    │
                                       Scene Expansion + Bridge Discovery
                                                    │
                                       Cross-Encoder Reranking
                                                    │
                                       ◄── Top-K Results with channel scores

Mathematical Foundations (Novel Contributions)

  1. Fisher-Rao Retrieval Metric — Similarity scoring derived from the Fisher information structure of diagonal Gaussian families. Graduated ramp from cosine to Fisher-information-weighted scoring over the first 10 accesses per memory.

  2. Sheaf Cohomology for Consistency — Algebraic topology detects contradictions between facts by computing coboundary norms on the knowledge graph. Non-trivial restriction maps amplify disagreements along discriminative subspaces.

  3. Riemannian Langevin Lifecycle — Memory positions evolve on the Poincare ball via a discretized Langevin SDE. Frequently accessed memories stay near the origin (ACTIVE); neglected memories diffuse toward the boundary (ARCHIVED). The potential is modulated by access frequency, age, and importance.


Prerequisites

Requirement Version Why
Node.js 14+ npm package manager
Python 3.11+ V3 engine runtime
pip Latest Python dependency installer

All Python dependencies are installed automatically during npm install. You don't need to run pip manually. If any dependency fails, the installer shows clear instructions.


Quick Start

Install via npm (recommended — one command, everything included)

npm install -g superlocalmemory

This single command:

  • Installs the V3 engine and CLI
  • Auto-installs all Python dependencies (numpy, scipy, networkx, sentence-transformers, etc.)
  • Creates the data directory at ~/.superlocalmemory/
  • Detects and guides V2 migration if applicable

Then configure:

slm setup    # Choose mode, configure provider

Install via pip

pip install superlocalmemory
# or with all features:
pip install "superlocalmemory[full]"

First Use

# Store a memory
slm remember "Alice works at Google as a Staff Engineer"

# Recall
slm recall "What does Alice do?"

# Check status
slm status

# Switch modes
slm mode a   # Zero-LLM (default)
slm mode b   # Local Ollama
slm mode c   # Full power

MCP Integration (Claude, Cursor, etc.)

Add to your IDE's MCP config:

{
  "mcpServers": {
    "superlocalmemory": {
      "command": "slm",
      "args": ["mcp"]
    }
  }
}

24 MCP tools available: remember, recall, search, fetch, list_recent, get_status, build_graph, switch_profile, health, consistency_check, recall_trace, and more.


V3 Engine Features

Retrieval (4-Channel Hybrid)

  • Semantic similarity with Fisher-Rao information geometry
  • BM25 keyword matching (persisted tokens, survives restart)
  • Entity graph with spreading activation (3-hop, decay=0.7)
  • Temporal date-aware retrieval with interval support
  • RRF fusion (k=60) + cross-encoder reranking

Intelligence

  • 11-step ingestion pipeline (entity resolution, fact extraction, emotional tagging, scene building, sheaf consistency)
  • Adaptive learning with LightGBM-based ranking (3-phase bootstrap)
  • Behavioral pattern detection (query habits, entity preferences, active hours)
  • Outcome tracking for retrieval feedback loops

Trust & Compliance

  • Bayesian Beta distribution trust scoring (per-agent, per-fact)
  • Trust gates (block low-trust agents from writing/deleting)
  • ABAC (Attribute-Based Access Control) with DB-persisted policies
  • GDPR Article 15/17 compliance (full export + complete erasure)
  • EU AI Act data sovereignty (Mode A: zero cloud, data stays local)
  • Tamper-proof hash-chain audit trail (SHA-256 linked entries)
  • Data provenance tracking (who created what, when, from where)

Infrastructure

  • 17-tab web dashboard (trust visualization, math health, recall lab)
  • 17+ IDE integrations with pre-built configs
  • Profile isolation (16+ independent memory spaces)
  • V2 to V3 migration tool (zero data loss, rollback support)
  • Auto-capture and auto-recall hooks for Claude Code

Benchmarks

Evaluated on the LoCoMo benchmark (Long Conversation Memory):

Mode A Ablation (conv-30, 81 questions, zero-LLM)

Configuration Micro Avg Multi-Hop Open Domain
Full (all layers) 62.3% 50% 78%
Math layers off 59.3% 38% 70%
Entity channel off 56.8% 38% 73%
BM25 channel off 53.2% 23% 71%
Cross-encoder off 31.8% 17%

Competitive Landscape

System Score LLM Required Open Source EU AI Act
EverMemOS 92.3% Yes No No
MemMachine 91.7% Yes No No
Hindsight 89.6% Yes No No
SLM V3 Mode C ~78% Optional Yes Partial
SLM V3 Mode A 62.3% No Yes Yes
Mem0 ($24M) 34.2% F1 Yes Partial No

SLM V3 is the only system offering a fully local mode with mathematical guarantees and EU AI Act compliance.


Research Papers

V3: Information-Geometric Foundations

SuperLocalMemory V3: Information-Geometric Foundations for Zero-LLM Enterprise Agent Memory Varun Pratap Bhardwaj (2026) Zenodo DOI: 10.5281/zenodo.19038659

V2: Architecture & Engineering

SuperLocalMemory: A Structured Local Memory Architecture for Persistent AI Agent Context Varun Pratap Bhardwaj (2026) arXiv:2603.02240 | Zenodo DOI: 10.5281/zenodo.18709670


Project Structure

superlocalmemory/
├── src/superlocalmemory/     # Python package (17 sub-packages)
│   ├── core/                 # Engine, config, modes, profiles
│   ├── retrieval/            # 4-channel retrieval + fusion + reranking
│   ├── math/                 # Fisher-Rao, Sheaf, Langevin
│   ├── encoding/             # 11-step ingestion pipeline
│   ├── storage/              # SQLite with WAL, FTS5, migrations
│   ├── trust/                # Bayesian scoring, gates, provenance
│   ├── compliance/           # GDPR, EU AI Act, ABAC, audit chain
│   ├── learning/             # Adaptive ranking, behavioral patterns
│   ├── mcp/                  # MCP server (24 tools, 6 resources)
│   ├── cli/                  # CLI with setup wizard
│   └── server/               # Dashboard API + UI server
├── tests/                    # 1400+ tests
├── ui/                       # 17-tab web dashboard
├── ide/                      # IDE configs for 17+ tools
├── docs/                     # Documentation
└── pyproject.toml            # Modern Python packaging

Contributing

See CONTRIBUTING.md for guidelines.

License

MIT License. See LICENSE.

Attribution

Part of Qualixar | Author: Varun Pratap Bhardwaj


Built with mathematical rigor. Not in the race — here to help everyone build better AI memory systems.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

superlocalmemory-3.0.7.tar.gz (258.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

superlocalmemory-3.0.7-py3-none-any.whl (303.3 kB view details)

Uploaded Python 3

File details

Details for the file superlocalmemory-3.0.7.tar.gz.

File metadata

  • Download URL: superlocalmemory-3.0.7.tar.gz
  • Upload date:
  • Size: 258.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for superlocalmemory-3.0.7.tar.gz
Algorithm Hash digest
SHA256 0fdbe6dcc3a0269f3f9e56928b3a5898f9e50a492ea21390ad2b6163c7e9a734
MD5 2b4843ce3de3da2e737a7e01d97e7118
BLAKE2b-256 a06a7dba1a9db3ef2d9ccba641a37942df8f841ba6e29e90aea1d053ac6024ac

See more details on using hashes here.

File details

Details for the file superlocalmemory-3.0.7-py3-none-any.whl.

File metadata

File hashes

Hashes for superlocalmemory-3.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 9d92df9a49f3ffaa954c3cfbc464fb07150e4677d26a8719df7e42020e60554c
MD5 6f2750e62025aafe24e182570f939fec
BLAKE2b-256 bbf876f57f3a48d1c824e3e0d171e79e902f13b125a82b35101ef8d3c54b6ffc

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