Skip to main content

HippoMem

PyPI version DOI License

Zero-LLM-write hippocampal reconsolidation memory for LLMs, AI agents, and native PyTorch Transformers.

Standard vector RAG stores are append-only: when facts change over time, stale records accumulate and rival current truths. LLM-write memory pipelines (Mem0/Zep style) run an LLM call on every turn—adding latency, token cost, privacy exposure, and extraction errors.

HippoMem translates four mechanisms of the mammalian hippocampus—Dentate Gyrus (DG) pattern separation, CA3 attractor-targeted Kalman labile reconsolidation, straight-through unit-sphere projection, and event-boundary segmentation—into:

  1. A drop-in Python library + SQLite-persisted MCP server (hippomem-mcp) that resolves conflicts and tracks paraphrased updates in < 0.1 ms with zero LLM write calls.
  2. A strictly causal native PyTorch Transformer memory layer (DGCA3HippoKalmanBlock).

Headline Benchmarks (bf16 H100)

Benchmark Flat-RAG Hybrid-RRF / Full-Ctx Mem0-Style (7B LLM/turn) HippoMem (Ours, 0 LLM writes)
Standard PI-LLM (U=40, Llama-3.1-8B) 2.0% 70.0% (Full-Ctx, 20.8K ch) — 100.0% (0.0%g, 20.7x fewer ch)
Standard PI-LLM (U=40, Qwen2.5-7B) 2.0% 86.0% (Full-Ctx) 3.3% (19.6 ms/ep) 93.3–98.0% (0.017 ms/ep, 1,155x faster)
Paraphrased PI-LLM (U=40, Llama-3.1-8B) 0.0% 33.3% (Full-Ctx, 9.1K ch) — 83.3% (91.7% mean, 10.3x fewer ch)
LongMemEval-S All-500 (Llama-3.1-8B, cross-judged) 48.6% 53.0% (Hybrid-RRF) — 54.2% (77.8% KU, +7.0pp)
LongMemEval-S KU-78 (Qwen2.5-7B) 63.9% 69.4% (Hybrid-RRF) 29.2% (12.6 ms/ep, 8.1M tok) 70.8% (0.064 ms/ep, 198x faster)

Installation

pip install hippokalman                 # core numpy + SQLite + MCP server
pip install "hippokalman[embeddings]"   # + local sentence-transformers (BAAI/bge-small-en-v1.5)
pip install "hippokalman[all]"          # + rank-bm25 + PyTorch native layer

(Both import hippokalman and import hippomem, as well as hippokalman-mcp and hippomem-mcp, are supported.)


5-Line Python Quickstart

from hippomem import HippoMem, SentenceTransformerEmbedder

mem = HippoMem(
    db_path="./agent_memory.db",
    embedder=SentenceTransformerEmbedder("BAAI/bge-small-en-v1.5"),
    theta_rec=0.78,
)

mem.add("Alice's primary production database is PostgreSQL.", session_id="s1", timestamp="2026-01-10")
mem.add("Update: Alice migrated her primary database to ClickHouse.", session_id="s2", timestamp="2026-03-14")

hits = mem.search("What is Alice's current primary database?", top_k=3)
print(hits[0]["text_for_llm"])
# [CURRENT MEMORY | 2026-03-14] Update: Alice migrated her primary database to ClickHouse.
#   [SUPERSEDED PRIOR | 2026-01-10] Alice's primary production database is PostgreSQL.

Paper & Benchmark Reproduction


MCP Memory Server Setup (Claude Desktop / Cursor / Antigravity)

Add hippomem-mcp as a local stdio MCP server (runs 100% locally, zero cloud LLM write calls):

{
  "mcpServers": {
    "hippomem": {
      "command": "hippomem-mcp",
      "args": [
        "--db", "~/.hippomem/memory.db",
        "--model", "BAAI/bge-small-en-v1.5",
        "--theta-rec", "0.78"
      ]
    }
  }
}

Exposed MCP tools: memory_add, memory_search, memory_history, memory_delete, memory_stats.


Native PyTorch Layer (DGCA3HippoKalmanBlock)

import torch
from hippomem.torch_layer import DGCA3HippoKalmanBlock

layer = DGCA3HippoKalmanBlock(d_model=512, n_heads=8, chunk_size=8, n_slots=32)
x = torch.randn(2, 256, 512)
y = layer(x)  # strictly causal (max_diff = 0.00e+00), non-expansive ST unit-sphere BPTT

Citation

@article{Park2026HippoMem,
  author = {Ju-un (Julian) Park},
  title  = {Hippocampal Reconsolidation Memory: Defeating Proactive Interference Under Paraphrase Drift in External and Native Neural Language Models},
  year   = {2026},
  doi    = {10.5281/zenodo.24705838},
  url    = {https://github.com/whitesm2000/hippomem}
}

License

Apache License 2.0 — see LICENSE.

Metadata

Release files for hippokalman 0.1.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 hippokalman 0.1.1
File Size Uploaded Provenance Actions
hippokalman-0.1.1.tar.gz 21.0 kB With provenance Details for hippokalman-0.1.1.tar.gz

Built distribution (wheel)

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

Total release size: 42.1 kB

Release files / hippokalman-0.1.1.tar.gz

Download URL hippokalman-0.1.1.tar.gz
Size 21.0 kB
Tags Source
SHA-256 checksum
How to use checksums
04968f7b3ef9df7e17ea251dd9140ae03d1124e845028b44afc9adb743f37273
BLAKE2b-256 checksum
How to use checksums
00913328f9b1e26dd9fb9323c0138e2179a17aacff468f4e9508ca86b947642f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.

Transparency log

Release files / hippokalman-0.1.1-py3-none-any.whl

Download URL hippokalman-0.1.1-py3-none-any.whl
Size 21.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a7deaa1a9c8741b47146618eb51f419960a3cb97c9fda7ee528bee34c941fbf5
BLAKE2b-256 checksum
How to use checksums
3d62e40d1b78cb08f3663b8f4355779971a7b321c83e957f4c7ae7252ec4cf45
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.

Transparency log

Security for hippokalman 0.1.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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for hippokalman-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files Full provenance

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