What is ReMe (MemoryScope)?
ReMe (MemoryScope) is Long-term and context memory for AI agents — remember across sessions, compact long chats. It gives an agent long-term memory so that old conversations are compacted instead of lost, important facts are stored, and relevant context is recalled in later sessions. It sits in the Agent Memory category of the Agents & Automation tools and is open-source, written in Python and licensed Apache-2.0.
Overview
ReMe (formerly MemoryScope) is a Python memory framework for AI agents. It gives an agent long-term memory so that old conversations are compacted instead of lost, important facts are stored, and relevant context is recalled in later sessions. It targets two common problems: a limited context window and stateless sessions that always start from scratch.
It ships two memory systems. ReMeLight is file-based: memory is stored as readable Markdown and JSONL files (a MEMORY.md for long-term facts, a daily journal, and raw dialog logs) that you can open, edit, and copy. The vector-based ReMe system stores memories for semantic retrieval with hybrid vector plus BM25 search.
It fits the agent-memory category as a library you call from your own agent code rather than a hosted service. It suits developers who want personalized, persistent memory for assistants, coding helpers, or support bots, and it reports state-of-the-art results on the LoCoMo and HaluMem memory benchmarks.
What it does
- File-based memory (ReMeLight): memory stored as editable Markdown and JSONL files you can read, edit, and copy to migrate
- Vector-based memory (ReMe) with hybrid retrieval combining vector search and BM25
- Context management: check_context, compact_memory, and compact_tool_result keep long conversations within the context window
- pre_reasoning_hook bundles tool-result compaction, context checks, and memory summarization into one async call
- Long-term memory persistence with semantic memory_search across past sessions
- Reported state-of-the-art results on the LoCoMo and HaluMem benchmarks
Getting started
ReMe is a Python 3.10+ library installed from PyPI or source. Install it, then wire one of its memory systems into your agent's reasoning loop.
Install from PyPI
Install the package with the file-based memory extra, which is recommended for a quick start.
pip install reme-ai[light]Or install from source
Clone the repo and install in editable mode if you want to track the latest changes.
git clone https://github.com/agentscope-ai/ReMe.git
cd ReMe
pip install -e ".[light]"Use file-based memory (ReMeLight)
Create a ReMeLight instance and call pre_reasoning_hook to compact history and recall memory before the model reasons.
import asyncio
from reme.reme_light import ReMeLight
async def main():
reme = ReMeLight(
default_as_llm_config={"model_name": "qwen3.5-35b-a3b"},
default_file_store_config={"fts_enabled": True, "vector_enabled": False},
enable_load_env=True,
)
await reme.start()
messages = [...]
processed_messages, summary = await reme.pre_reasoning_hook(
messages=messages,
system_prompt="You are a helpful AI assistant.",
compressed_summary="",
max_input_length=128000,
)
await reme.close()
if __name__ == "__main__":
asyncio.run(main())Or use vector-based memory (ReMe)
Configure an LLM and embedding model, then retrieve stored memories by query for a given user.
import asyncio
from reme import ReMe
async def main():
reme = ReMe(
working_dir=".reme",
default_llm_config={"backend": "openai", "model_name": "qwen3.5-plus"},
default_embedding_model_config={"backend": "openai", "model_name": "text-embedding-v4"},
)
await reme.start()
memories = await reme.retrieve_memory(query="Python programming", user_name="alice")
await reme.close()
if __name__ == "__main__":
asyncio.run(main())Commands and code are distilled from the project's own documentation — always check the official repo for the latest.
When to use it
- Give a personal assistant agent long-term memory of user preferences and past conversations across sessions
- Keep a coding assistant aware of project context and code-style preferences from earlier sessions
- Track a support bot's history of a user's issues and settings for more personalized replies
- Compact long multi-turn dialogues so key information survives a limited context window
How ReMe (MemoryScope) compares
ReMe (MemoryScope) alongside other open-source agent memory tools AI/TLDR tracks, ranked by GitHub stars.
| Tool | Stars | What it does |
|---|---|---|
| Claude-Mem | ★ 121k | Persistent memory layer for coding agents: it captures what an agent does during a session, compresses it into semantic summaries, and injects the relevant parts back into later sessions. |
| Mem0 | ★ 69.7k | A memory layer that you add to existing LLM agents to extract, store, and recall user facts and preferences across sessions using vector, graph, and key-value backends. |
| Hindsight | ★ 64.3k | An agent memory server that stores facts and experiences, consolidates them into observations and mental models, and serves them back through retain, recall, and reflect operations. |
| MemPalace | ★ 60.8k | Local-first agent memory that stores conversations verbatim instead of summarising them, with a structured palace index, pluggable vector backends and an MCP server. |
| OpenViking | ★ 43.1k | A context database that stores an agent's memories, resources, and skills as one browsable viking:// filesystem with three-tier (abstract/overview/details) on-demand loading. |
| Cognee | ★ 33.7k | A graph-native memory engine that turns raw documents and conversations into a queryable knowledge graph for agents that need to build lasting knowledge. |
| Graphiti | ★ 33.2k | A library that builds a temporal knowledge graph from an agent's conversations and data so facts can be tracked and queried as they change over time. |
| ReMe (MemoryScope) | ★ 3.9k | Long-term and context memory for AI agents — remember across sessions, compact long chats |

