Building a Hippocampus for AI: Brain‑Inspired Memory Achieves SOTA

The open‑source Hebb Mind project replicates the brain’s encode‑consolidate‑activate‑forget loop in engineering, replacing simple storage‑retrieval approaches with a four‑stage memory cycle, and demonstrates state‑of‑the‑art performance on LongMemEval and LoCoMo benchmarks while running locally without external services.

Alipay Experience Technology
Alipay Experience Technology
Alipay Experience Technology
Building a Hippocampus for AI: Brain‑Inspired Memory Achieves SOTA

Problem with existing AI memory approaches

Typical implementations store information in plain text files such as MEMORY.md, AGENTS.md or CLAUDE.md and retrieve it with grep. This method is zero‑install and cost‑free but quickly becomes unstructured; phrasing changes break retrieval.

More systematic solutions use a vector store with semantic retrieval (RAG). After each turn a model extracts key points, writes them to a similarity‑based index, and later retrieves the most similar entries. Compared with the brain, these approaches miss several dimensions:

They do not reorganize fragmented experiences into structured knowledge during idle time.

They lack active forgetting; old and new memories receive equal weight.

Recall is limited to “most similar entries” rather than associative chaining from a single cue.

Hebb Mind architecture

Hebb Mind reproduces the four‑step biological memory loop: Encode → Consolidate → Activate → Forget.

Encode : New observations are written to a fast, low‑cost “hippocampus” buffer (plain text). The buffer is fully local and requires no external cloud services.

Consolidate : A nightly background task (simulating sleep) replays the day’s records to a large model. The model decides categorization, summarization, importance, and conflict resolution, then moves the processed data to long‑term storage and clears the buffer.

Activate : Retrieval simultaneously queries semantic similarity, literal matches, and tag associations, merges the results, and ranks them. A single cue can therefore expand into a whole context chain.

Forget : Memory lifespan is computed as usage frequency × importance × time since last access , implementing use‑dependent decay (“use it or lose it”).

The design aligns with cognitive theories such as the Complementary Learning System, Tulving’s multiple‑memory model, hippocampal replay, ACT‑R activation, and the Ebbinghaus forgetting curve.

Benchmark results

LongMemEval (500 long‑term memory questions)

Top‑5 retrieval hit rate: 99.0%

Top‑10 retrieval hit rate: 99.4%

End‑to‑end answer accuracy: 79.0% (near the theoretical ceiling of ~82% with perfect retrieval).

For comparison, Zep reports Top‑10 hit rate 95.5% and accuracy 71.2% on the same setup.

LoCoMo (multi‑turn long‑conversation benchmark)

Top‑10 retrieval hit rate: 95.75% (94.14% without rerank), surpassing MemPalace.

Comparison with other memory frameworks

mem0 : early‑stage, widely adopted.

Zep : strong on temporal knowledge graphs.

Letta : provides a complete runtime for stateful agents.

MemPalace : emphasizes easy integration.

Hebb Mind : local‑first, zero external services, compatible with multiple agents, implements the full four‑stage loop, and is released under the MIT license. It is the only framework that combines all four advantages.

Installation

pipx install hebb-mind
hebb setup
hebb service install

After installation the system runs as a background service on macOS, Linux, or Windows, exposing a local API and a web console for manual memory management.

Integration with coding assistants

Claude Code

Provides MCP tools ( write_memory, search_memory, consolidate) and automatic hooks that recall cross‑session memory at conversation start and trigger consolidation at end.

hebb claude-code install --scope user

Codex

Installs the same MCP tools for Codex.

hebb codex install --scope user
codex mcp list

Web console

Access the browser‑based control panel with:

hebb console

Repository and documentation

GitHub: https://github.com/afx-team/hebb-mind

Documentation (Chinese): https://afx-team.github.io/hebb-mind/zh/quick-start.html

Hebb Mind architecture diagram
Hebb Mind architecture diagram
Hippocampus and cortex analogy
Hippocampus and cortex analogy
Recall performance comparison
Recall performance comparison
LoCoMo recall comparison
LoCoMo recall comparison
Feature comparison of memory frameworks
Feature comparison of memory frameworks
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

RAGbenchmarkagent memorylocal LLMAI memoryHebb Mind
Alipay Experience Technology
Written by

Alipay Experience Technology

Exploring ultimate user experience and best engineering practices

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.