A next-generation AI intelligent memory system inspired by biological cognition, integrating Neo4j graph storage, Lucene+BERT hybrid retrieval, and dynamic forgetting mechanisms with 92% retrieval accuracy, solving LLM long-term memory loss and multi-agent collaboration gaps.
Overview#
MemoryBear is an open-source intelligent memory management system developed by the RedBear AI (SuanmoSuanyangTechnology) team, designed to break through the inherent "knowledge forgetting" limitations of Large Language Models and equip AI with human-like memory capabilities.
License: Apache License 2.0
Current Version: v0.2.4 (Intelligent Resilience)
Core Capabilities#
Memory Extraction Engine#
- Multi-dimensional structured extraction, extracting structured triples as the cognitive foundation
- Temporal anchoring, automatically extracting timestamps and associating content
- Intelligent summarization with customizable length (50-500 characters)
Graph Storage Layer#
- Neo4j-based visual knowledge network
- Supports millions of entities and tens of millions of relationship edges
- Covers 12 core relationship types (hierarchical, causal, temporal, logical, etc.)
- Interactive graph visualization capabilities
Hybrid Retrieval#
- Keyword search (Lucene optimized) + Semantic vector search (BERT embeddings)
- Millisecond-level precise matching and deep semantic comparison
- Identifies synonyms, near-synonyms, and implicit intents
- Retrieval accuracy reaches 92%, a 35% improvement over single-mode approaches
Memory Forgetting Engine#
- Dynamic decay based on memory strength and time attenuation
- Three-stage lifecycle: Dormant → Decaying → Cleared
- Redundant knowledge kept below 8%, waste reduction over 60%
Self-Reflection Engine#
- Automatically runs daily at midnight
- Consistency checking, value assessment, association optimization
FastAPI Service#
- Unified service architecture, high-performance and easy integration
- Supports JSON/XML formats, average latency below 50ms
- Single instance supports 1000 QPS concurrency
- Auto-generated Swagger API documentation
Core Problems Solved#
- Single Model Knowledge Forgetting: Context window limits (8k-32k tokens), gap between static knowledge bases and dynamic data
- Multi-Agent Collaboration Memory Gaps: Data silos between agents, inconsistent dialogue states, decision conflicts
- Semantic Ambiguity in Model Reasoning: Inaccurate personalized signal encoding, broken cross-language memory links
Performance Benchmarks#
- Vector version accuracy: 72.90 ± 0.19%
- Graph version accuracy: 75.00 ± 0.20%
- Hybrid retrieval accuracy: 92%
- Achieves SOTA levels in single-hop, multi-hop reasoning, open generalization, and temporal reasoning tasks
Application Scenarios#
- Customer service systems (consultation, after-sales, recommendation agents)
- Enterprise knowledge management (CRM, OA, R&D management)
- Personalized dialogue systems
- Multi-agent collaboration systems
Requirements#
- Node.js 20.19+ or 22.12+
- Python 3.12
- PostgreSQL 13+
- Neo4j 4.4+
- Redis 6.0+
Quick Start#
# Clone project
git clone https://github.com/SuanmoSuanyangTechnology/MemoryBear.git
# Backend setup
cd api
pip install uv
uv sync
cp env.example .env # Configure environment variables
alembic upgrade head
uv run -m app.main
# Frontend setup (new terminal)
cd web
npm install
npm run dev
# Initialize database
curl -X POST http://127.0.0.1:8000/api/setup
Core Configuration#
# Neo4j
NEO4J_URI=bolt://localhost:7687
NEO4J_USERNAME=neo4j
NEO4J_PASSWORD=your-password
# PostgreSQL
DB_HOST=127.0.0.1
DB_PORT=5432
DB_USER=postgres
DB_PASSWORD=your-password
DB_NAME=redbear-mem
# Redis
REDIS_HOST=127.0.0.1
REDIS_PORT=6379
BROKER_URL=redis://127.0.0.1:6379/0
Language Composition#
Python (72.9%), TypeScript (24.5%), Jinja (1.9%), CSS (0.3%), JavaScript (0.2%), Rust (0.1%)
Information Pending Confirmation#
- Official Hugging Face model or dataset page not yet discovered
- Full paper "Memory Bear AI: A Breakthrough from Memory to Cognition" requires JavaScript access
- Detailed comparison data with Mem O, Zep, LangMem systems pending
- Production deployment case studies to be provided