← all repositories
SuanmoSuanyangTechnology/MemoryBear

MemoryBear: an AI that forgets on purpose

A memory layer for LLMs that extracts knowledge into graphs, then prunes it like synaptic decay.

4.3k stars Python Other AI
MemoryBear
Velocity · 7d
+17
★ / day
Trend
steady
star history

What it does MemoryBear sits between your users and your LLMs, turning conversations and documents into structured knowledge graphs stored in Neo4j. It extracts entity triples, anchors them in time, and surfaces them later through a hybrid search pipeline (Elasticsearch for exact matches, BERT embeddings for semantic similarity). A FastAPI service layer exposes management and service APIs, backed by Celery workers split across memory, document, and periodic task queues.

The interesting bit The project leans heavily into cognitive metaphors — hippocampal encoding, neocortical consolidation, synaptic pruning — but the implementation is concrete. A “forgetting engine” assigns dynamic strength scores to each knowledge item; when usage drops and time passes, facts drift through dormancy into decay and finally clearance. There’s also a daily “self-reflection” job that checks for logical conflicts and reweights association paths. Whether the biology maps cleanly to the code is left as an exercise for the reader, but the mechanism is at least fully specified.

Key highlights

  • Graph-first storage in Neo4j with 12 built-in relationship types (hierarchical, causal, temporal, logical, etc.)
  • Hybrid search claims 92% accuracy, cited as a 35% improvement over single-mode retrieval
  • Benchmarks provided against Mem0, Zep, and LangMem across F1, BLEU-1, and LLM-as-Judge scores
  • Vector-only version hits ~72.9% accuracy; graph version pushes to ~75.0%
  • FastAPI layer claims <50ms average latency and 1000 QPS per instance
  • Apache 2.0 licensed; papers listed but not peer-reviewed venues (arXiv and a self-hosted PDF)

Caveats

  • The “Docker Compose (Recommended)” path still requires you to manually start PostgreSQL, Neo4j, Redis, and Elasticsearch separately — the compose file only covers the API and Celery workers
  • Default admin credentials are hardcoded (admin@example.com / admin_password) and surfaced in the README
  • Several benchmark claims (“35% improvement,” “60% waste reduction”) lack methodological detail in the README; the numbers are presented without confidence intervals or dataset descriptions

Verdict Worth evaluating if you’re building multi-agent systems or long-running conversational AI where context windows collapse and you need persistent, queryable memory. Skip it if you want a drop-in, zero-dependency memory layer — this is a full infrastructure stack with five external services and a nontrivial operational footprint.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.