# Repository Briefing: BAI-LAB/MemoryOS
> Source: https://repoforai.com/repo/BAI-LAB/MemoryOS (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/BAI-LAB/MemoryOS
- **Official Docs / Website**: https://baijia.online/memoryos/
- **Category**: RAG, Data & Memory (知识库 / 爬虫 / 记忆层)
- **Primary Language**: Python
- **License**: Apache-2.0
- **Engineering Health**: B (60/100 · Maintenance 12/35 · Adoption 17/25 · Releases 11/20 · License 20/20)
- **Latest Release**: V1.2 (2025-07-18) — https://github.com/BAI-LAB/MemoryOS/releases
- **Review Snapshot**: 2026-12-02
- **Deployment / Stack Signals**: Docker, Self-Hosted, MCP, API
- **Momentum**: 1,632 ★ total (+2 24h / +7 7d) · 176 forks
- **Topics**: `agent`, `language-model`, `llm`, `long-term-memory`, `operating-system`, `personalization`, `rag`, `retrieval-augmented-generation`
- **When to Use**: Best for: Python agents and MCP-compatible clients that need persistent conversational context and preference recall without building their own consolidation and retrieval policies. Skip if: You only need document search, or you need verified multi-tenant controls, auditable deletion, and a ready-to-run production service without additional engineering.

## Overview
```text
### Architecture & Core Mechanics
MemoryOS is an application-level memory layer for conversational agents, not a general-purpose database or an operating-system service. The Python `Memoryos` class in `memoryos.py` orchestrates three tiers: recent user–assistant turns in `short_term.py`, consolidated dialogue in `mid_term.py`, and longer-lived profile and knowledge records in `long_term.py`. `updater.py` manages updates and promotion between tiers; `retriever.py` looks across them, and `prompts.py` holds prompts for LLM tasks such as summarization and analysis.

The Python workflow writes exchanges with `add_memory` and demonstrates retrieval-assisted generation through `get_response`. MCP exposes write, retrieval, and profile access as separate tools, so a compatible client can retain control of generation. The project separates storage, update policy, and retrieval, and ships a ChromaDB variant; this demonstrates a backend integration, not a stable plugin contract for arbitrary databases.

### Key Capabilities & Differentiators
The retrieval path supplies relevant past dialogue, preferences, and knowledge rather than treating the entire transcript as context. The MCP profile tool also exposes traits and interests inferred from earlier exchanges. Configuration includes short-term capacity, mid-term capacity, heat and similarity thresholds, retrieval queue capacity, and long-term knowledge capacity. These are tuning controls for memory behavior, not measured throughput or scale limits.

LLM calls use the OpenAI API interface, so provider compatibility depends on the configured endpoint, not merely on the model name. Named embedding choices include `BAAI/bge-m3`, `Qwen/Qwen3-Embedding-0.6B`, and `all-MiniLM-L6-v2`. The LoCoMo evaluation reports average improvements of 49.11% in F1 and 46.18% in BLEU-1; these are task-specific score gains, not evidence of production latency or superiority across competing systems.

### Trade-offs & Limitations
Compared with a plain ChromaDB-backed retrieval pipeline, MemoryOS saves application work by supplying consolidation, cross-tier retrieval, and profiles. The cost is more policy to tune and more failure modes to test. Summarization can lose details, and an inferred preference may become stale or simply be wrong. Measure write and read latency separately: embedding work, update-time LLM calls, and response generation have different cost and latency drivers. Switching embedding models requires a different storage path rather than reuse of the existing memory directory.

Mem0 and Zep are useful comparison candidates, but the standardized cross-system benchmark is still listed as ongoing. For a production rollout, verify tenant isolation, concurrent writes, backup and restore, and whether deletion covers both original dialogue and derived summaries or profiles. User and assistant IDs are configuration inputs, not proof of authorization. Apache-2.0 allows commercial adoption subject to its terms; hosted generation and model dependencies bring separate terms and data-handling considerations.

### Hardware & Deployment Guide
The Python path requires Python 3.10 or newer and installs as `memoryos-pro`. Configure the user and assistant IDs, storage path, generation endpoint and credentials, model, and embedding choice. For MCP, install the dependencies under `memoryos-mcp/` and launch `python server_new.py --config config.json`, then configure the client to invoke it. A local OpenAI-compatible generation endpoint is an option; running the library locally does not make a hosted endpoint offline.

The root Dockerfile uses `python:3.10-slim`, copies `memoryos-pypi/`, and installs its requirements and `vim`; it declares no MemoryOS service entrypoint. The GHCR and local-build examples open a GPU-enabled shell, not a turnkey MCP deployment. For persistent use, mount the data directory and keep credentials out of the image. V1.1 expanded parallelization in the PyPI and MCP paths, added embedding-model choices, and removed `llm_extract_keywords` to avoid redundant token use. V1.2 is the latest listed release, but its changes are not specified.
```

## Key Capabilities
```text
- Memory tiers: Recent turns, consolidated dialogue, and durable profile or knowledge records have distinct roles.
- Python interface: `memoryos-pro` demonstrates turn ingestion with `add_memory` and retrieval-assisted generation with `get_response`.
- MCP tools: `addmemory`, `retrievememory`, and `getuserprofile` separate ingestion, lookup, and profile access.
- Model configuration: Generation uses an OpenAI-compatible endpoint; embedding choices include BGE-M3, Qwen3-Embedding-0.6B, and all-MiniLM-L6-v2.
- Storage variants: `memoryos-chromadb/` provides a ChromaDB integration; use a different data path when switching embedding models.
- Evaluation: `eval/` provides LoCoMo parsing and scoring entrypoints for reproducing the task-specific results.
```

## Quick Start / Clone
```bash
pip install memoryos-pro -i https://pypi.org/simple
```
