Open-source project
SuanmoSuanyangTechnology/MemoryBear avatar
SuanmoSuanyangTechnology/MemoryBear

MemoryBear forgets on purpose, and that is the part that shapes the architecture

MemoryBear Equip AI with human-like memory capability

10,227 stars738 forksPythonApache-2.0

At a glance

What is it?
MemoryBear is a Python memory layer for AI agents built by RedBear AI, running on Neo4j, Elasticsearch and BERT embeddings behind a FastAPI service. Its distinguishing feature is a forgetting engine that pushes low value knowledge out through a dormancy, decay and clearance lifecycle. Judgement: the infrastructure bill is the real cost, and the published accuracy figures are the project's own.
Who is it for?
Adopt MemoryBear when you are running multi-agent services and need shared memory that decays over time rather than accumulating forever, and when you can operate Neo4j, Elasticsearch, PostgreSQL and Redis yourself. Do not adopt it for a single-process assistant: four stateful dependencies and seven Celery queues are a heavier floor than that use case needs.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository received new commits within the last day.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 25, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • SuanmoSuanyangTechnology/MemoryBear10,227 ★ · +3,300
Star history
Repository2026-09-282026-11-25
SuanmoSuanyangTechnology/MemoryBear6.9k10.2k

3,300 Stars in the last 58 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

The forgetting engine is the centre of the design, not a cleanup job

Most memory layers for language models only add. MemoryBear, whose repository description is to equip AI with human-like memory capability, is built the other way round: its memory forgetting engine is described as inspired by synaptic pruning, and it uses a dual-dimension model of memory strength and time decay.

The mechanism is concrete. Every knowledge item gets an initial memory strength, and that strength is updated dynamically by usage frequency and association activity. Once strength drops below a threshold, the item enters a three-stage lifecycle of dormancy, decay and clearance. The project states that redundant knowledge is kept below 8 percent, cutting wasted storage by more than 60 percent against systems that never forget.

A second engine, self-reflection, runs a scheduled daily process and is where the strengths get revised. It performs consistency checks that detect logical conflicts across related knowledge and flag suspicious records for human review, it does value assessment on invocation frequency and association contribution so high value knowledge is reinforced while low value knowledge decays faster, and it does association optimization by adjusting relationship weights on recent usage.

The practical consequence is that a MemoryBear deployment has a moving target: what a query returns last week may not be retrievable this week, because nothing reinforced it. Any design that depends on a fact surviving indefinitely needs that fact touched, or the item pinned some other way.

Extraction writes triples into Neo4j, which fixes your data model early

The memory extraction engine performs semantic-level parsing of unstructured conversations and documents. Four outputs are described: core declarative information with redundant modifiers stripped while subject-action-object logic is preserved, structured triples extracted as atomic units for graph storage, temporal anchoring that tags timestamps to enable time-based knowledge tracing, and intelligent summarization with a customizable length of 50 to 500 words and a customizable focus.

Those triples are what the rest of the system is built on, because graph storage is described as graph-first with Neo4j integration. Extracted triples sync directly into Neo4j and build the initial knowledge graph automatically. The stated scale is millions of entities and tens of millions of relational edges, across 12 core relationship types covering hierarchical, causal, temporal and logical relations among others. Visualization is interactive, with machine-generated plus human-optimized collaborative management, which is the escape hatch for when the extraction gets a relationship wrong.

The trade to weigh before committing: a graph schema with twelve relationship types is not something you can defer. If your domain vocabulary does not map onto those types cleanly, the useful information lands in triples that are syntactically fine and semantically awkward to query later, and the fix is a re-extraction rather than a query tweak.

Hybrid search fuses Elasticsearch keywords with BERT vectors, and both must be live

Retrieval is described as a dual-engine fusion of keyword retrieval and semantic vector retrieval. Keyword search is powered by Elasticsearch for millisecond-level exact matching of structured information. Semantic vector search uses BERT embeddings to recognize synonyms, near-synonyms and implicit intent. The stated ordering is that semantic retrieval expands the candidate space first, and keyword retrieval then filters precisely.

The project reports retrieval accuracy reaching 92 percent, an improvement of 35 percent over single-mode retrieval. Treat both numbers as claims made by the project about its own evaluation.

Operationally this is the part that decides whether the project fits your budget. You are running Neo4j for the graph, Elasticsearch for lexical matching, BERT for embeddings, and both of them from the service layer.

One configuration detail worth reading before you deploy: the shared env file carries ES_ALLOW_DOWNGRADE, commented as permitting startup when this process's index definitions are older than the server's, defaulting to false and intended for rollback scenarios only.

Two API surfaces with different auth, and seven Celery queues behind them

The service layer exposes two API surfaces. The management API sits under /api with JWT auth and covers system config, permissions and log queries. The service API sits under /v1 with API key auth and covers knowledge extraction, graph operations, search and forgetting control. Swagger documentation is auto-generated. The performance claims are an average response latency below 50 milliseconds and a single instance sustaining 1000 QPS.

Behind that, the architecture is a Celery multi-queue setup with seven worker types in docker-compose. The documented queues show the shape of the load. memory_tasks runs threads with concurrency 100 and handles memory read and write, described as asyncio-friendly. memory_fast_tasks runs threads with concurrency 32 and exists specifically so high-frequency fast writes do not mutually block the main queue. document_tasks runs prefork with concurrency 4 because document parsing is CPU-bound, and periodic_tasks runs prefork with concurrency 2 for scheduled work such as the daily reflection.

The prefork versus threads split is the part that tells you the most. Parsing documents is treated as CPU-bound and gets process workers, while memory traffic stays in threads, which means the deployment needs to be sized for both dimensions rather than one worker count.

The shared env file is the real installation guide, and it names five services

The top-level layout is a set of services rather than a single package: api/, application-service/, gateway-service/, identity-service/, mem-knowledge/, memory-profile/, model-service/, packages/, sandbox/, web/ and e2b-infra/, plus CONTRIBUTING.md and a Chinese README alongside the English one. The deployment mode is set by a single variable, and the default is the community edition:

bash
DEPLOYMENT_MODE=community

The shared env file is described as configuration for MemoryBear services, with the note that service-specific values belong in each service's own .env file. What it lists is the dependency set a deployment has to supply. PostgreSQL for the main database, Redis with separate logical databases for the app, the Celery broker and the Celery backend, and Elasticsearch with a request timeout of 100, up to 10 retries on timeout and certificate verification off by default. File storage picks one of four backends, local, oss, s3 or minio, with credentials per backend. Model traffic is pointed at a shared model runtime base URL with an auth key, plus a LiteSkill internal admin base URL whose token must match the one on the LiteSkill side, an LLM timeout of 120 seconds with 2 retries, and an embedding batch size of 10.

The repository root carries no requirements file, so the Python dependencies are not pinned in one place you can read before cloning. Plan to resolve them from the service directories themselves.

Four gaps in the published material, and where the design stops paying

There are four places where the project documentation is thin, and they matter more than the feature list suggests.

First, the 92 percent accuracy and the 35 percent gain are the project's own figures, so the honest test is your own query set after your own extraction.

Second, the memory write path is only as good as the extractor, and extraction is the part most sensitive to domain language. The reasons for memory failure listed in the README are a good warning list: domain jargon and context-dependent references that are not accurately encoded, and cross-language associations that fail in multilingual or dialect-rich scenarios.

Third, forgetting has an operational cost the feature list does not mention. A daily reflection pass, a strength score updated by usage, and pruning that removes redundant knowledge all combine into a system where a correct answer can become unretrievable because nothing reinforced it in time. That is a design decision, not a defect, but it needs a policy on your side.

Fourth, the whole premise is aimed at multi-agent systems. The stated problems are data silos between agents, inconsistent dialogue state when switching agents, and decision conflicts from partial memory. For a single assistant with one conversation, four stateful dependencies and seven worker queues are a floor you pay without getting the benefit back.

Three releases in September 2026 under Apache-2.0

The licence is Apache-2.0, which matters here more than it does for a small library: this is a service stack meant to sit inside someone else's product, and Apache-2.0 carries an explicit patent grant along with the usual notice and licence obligations.

The repository is not archived and the last push was on 2026-11-02. Three releases landed in October 2026 alone: v0.5.1 on 2026-10-16, v0.5.2 on 2026-10-23, and v0.5.3 on 2026-10-30, each with community release notes in its title. The default branch is main and the project site is memorybear.ai.

A cadence that tight is worth reading two ways. It means the architecture is still moving, which suits anyone starting now rather than anyone with a pinned internal fork. It also means the dependency contract you build against, especially around Neo4j and Elasticsearch configuration, is likely to move with it. Pin a tag, read the release notes for the version you take, and keep the service directories versioned together rather than tracking main.

Editorial conclusion

Adopt MemoryBear when you are running multi-agent services and need shared memory that decays over time rather than accumulating forever, and when you can operate Neo4j, Elasticsearch, PostgreSQL and Redis yourself. Do not adopt it for a single-process assistant: four stateful dependencies and seven Celery queues are a heavier floor than that use case needs. Before starting, read the published 92 percent retrieval accuracy as a claim from the project rather than a verified number, and confirm what your extraction step costs on your own document mix, since the summarization figures are quoted for one workload.

Frequently asked questions

What is MemoryBear and who builds it?

MemoryBear is a Python memory management system for AI agents, developed by RedBear AI, with the repository description stating it equips AI with human-like memory capability. It is Apache-2.0 licensed and its default branch is main.

How does the MemoryBear forgetting engine decide what to drop?

Each knowledge item is given an initial memory strength that is updated by usage frequency and association activity. When strength falls below a threshold the item moves through a dormancy, decay and clearance lifecycle, and the daily self-reflection pass reinforces high value knowledge while accelerating decay of low value knowledge.

Which services does a MemoryBear deployment need?

The shared env file names PostgreSQL, Redis for the app and the Celery broker and backend, Elasticsearch, a file storage backend that can be local, oss, s3 or minio, plus a shared model runtime base URL and a LiteSkill internal admin endpoint whose token must match on both sides.

What databases does MemoryBear use for storage and search?

Graph storage is Neo4j, described as graph-first, with extracted triples syncing directly to build the knowledge graph across 12 core relationship types. Search is hybrid: Elasticsearch for keyword matching and BERT embeddings for semantic retrieval, fused so semantic search expands candidates and keyword search filters them.

How do I access the MemoryBear APIs and what are the two surfaces?

The management API is under /api with JWT auth for system config, permissions and log queries, and the service API is under /v1 with API key auth for knowledge extraction, graph operations, search and forgetting control. Swagger documentation is auto-generated.

How accurate is MemoryBear retrieval?

The project states that retrieval accuracy reaches 92 percent and improves 35 percent over single-mode retrieval. Treat them as the project's own claim rather than a verified number.

Official sources

  1. License: Apache-2.0
  2. Project website
  3. README
  4. Releases
  5. SuanmoSuanyangTechnology/MemoryBear on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/suanmosuanyangtechnology-memorybear.svg)](https://hysenlabs.com/projects/suanmosuanyangtechnology-memorybear)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/suanmosuanyangtechnology-memorybear.svg)](https://hysenlabs.com/projects/suanmosuanyangtechnology-memorybear)

Was this useful?