



























Memory Operator is a specialized language model developed for MemOS, designed to handle memory-related operations. Its core capabilities include memory extraction, integration, and update. The primary objectives for developing the Memory Operator sub-model are:
We are releasing the MemOperator model series in three sizes: 4B, 1.7B, and 0.6B parameters. These models are fine-tuned from the Qwen3 series, trained using supervised fine-tuning (SFT) on a combination of human-annotated and model-generated data. They demonstrate excellent performance in tasks such as memory extraction and reorganization.
Currently, the memory operation model supports memory extraction and clustering-based memory reorganization within the MemOS system. Conflict resolution and relational reasoning are under active development (WIP).
Memory Operator is optimized for fast and accurate memory handling, enabling real-time processing in local environments.
| Model | Overall | Temporal Reasoning | Multi-Hop | Single-Hop | Open-Domain |
|---|---|---|---|---|---|
| Qwen3-32B | 0.7675 | 0.7103 | 0.6702 | 0.8442 | 0.5729 |
| Qwen3-14B | 0.7370 | 0.6822 | 0.6631 | 0.8002 | 0.5833 |
| MemOperator-4B | 0.7714 | 0.8037 | 0.6737 | 0.8180 | 0.5416 |
| MemOperator-1.7B | 0.7571 | 0.8068 | 0.6560 | 0.7955 | 0.5521 |
| MemOperator-0.6B | 0.6753 | 0.6635 | 0.5780 | 0.7325 | 0.5000 |
| GPT-4o-mini | 0.7405 | 0.7217 | 0.6844 | 0.7864 | 0.5659 |
✅ Key Advantage:
By replacing large open-source models (e.g., Qwen3-32B) with MemOperator-4B, you can achieve comparable or better memory processing performance while reducing resource consumption by over 80% (4B vs 32B). This enables efficient, scalable, and cost-effective deployment.
You can easily configure MemOS to use the trained MemReader model for memory extraction.
pip install MemoryOS
from memos.configs.mem_reader import SimpleStructMemReaderConfig
from memos.mem_reader.simple_struct import SimpleStructMemReader
config = SimpleStructMemReaderConfig(
**{
"llm": {
"backend": "huggingface",
"config": {
"model_name_or_path": "MemTensor/MemOperator-0.6B",
"temperature": 0.6,
"max_tokens": 6000,
"top_p": 0.95,
"top_k": 20,
"extra_body": {"chat_template_kwargs": {"enable_thinking": false}}
},
},
"embedder": {
"backend": "ollama",
"config": {"model_name_or_path": "nomic-embed-text:latest"},
},
"chunker": {
"backend": "sentence",
"config": {
"tokenizer_or_token_counter": "gpt2",
"chunk_size": 512,
"chunk_overlap": 128,
"min_sentences_per_chunk": 1,
},
},
"remove_prompt_example": True,
}
)
reader = SimpleStructMemReader(config)
# Example chat data
chat_data = [
[
{
"role": "user",
"chat_time": "June 26, 2025 at 3:00 PM",
"content": "Hi Jerry! Yesterday at 3 PM I had a meeting with my team about the new project.",
},
{
"role": "assistant",
"chat_time": "June 26, 2025 at 3:00 PM",
"content": "Oh Tom! Do you think the team can finish by December 15?",
},
{
"role": "user",
"chat_time": "June 26, 2025 at 3:00 PM",
"content": "I’m worried. The backend won’t be done until December 10, so testing will be tight.",
},
{
"role": "assistant",
"chat_time": "June 26, 2025 at 3:00 PM",
"content": "Maybe propose an extension?",
},
{
"role": "user",
"chat_time": "June 26, 2025 at 4:21 PM",
"content": "Good idea. I’ll raise it in tomorrow’s 9:30 AM meeting—maybe shift the deadline to January 5.",
},
]
]
# Save document for testing
with open("tmp.txt", "w") as f:
f.write(
"Lou Henry Hoover (March 29, 1874 – January 7, 1944) was an American philanthropist, geologist, and the first lady of the United States from 1929 to 1933 as the wife of President Herbert Hoover. She was active in community organizations and volunteer groups throughout her life, including the Girl Scouts of the USA, which she led from 1922 to 1925 and from 1935 to 1937. Throughout her life, Hoover supported women's rights and women's independence. She was a polyglot, fluent in Mandarin and well-versed in Latin, and was the primary translator from Latin to English of the complex 16th-century metallurgy text De re metallica."
)
# Extract chat and document memories
chat_memory = reader.get_memory(
chat_data, type="chat", info={"user_id": "Tom", "session_id": "session1"}
)
doc_memory = reader.get_memory(
["tmp.txt"],
"doc",
info={
"user_id": "Tom",
"session_id": "session2",
},
)
print(chat_memory)
print(doc_memory)
Configure your mem_cube_config.json:
{
...,
"reorganize": true,
"text_mem": {
"backend": "tree_text",
"config": {
"extractor_llm": {
"backend": "huggingface",
"config": {
"model_name_or_path": "MemTensor/MemOperator-0.6B",
"temperature": 0.8,
"max_tokens": 1024,
"top_p": 0.9,
"top_k": 50
}
},
"dispatcher_llm": {
...
}
},
"graph_db": {
...
}
},
"embedder": {
...
}
}
}
},
"act_mem": {},
"para_mem": {}
}
import json
from memos import GeneralMemCubeConfig, GeneralMemCube, MOSConfig
from memos.mem_os.main import MOS
# Initialize MOS
user_id = 'test'
mos_config_path = "configs/mos_memos_config.json"
mos_config_data = json.load(open(mos_config_path))
mos_config = MOSConfig(**mos_config_data)
mos = MOS(mos_config)
mos.create_user(user_id=user_id)
# Configure and initialize memory cube
mem_cube_config_path = "configs/mem_cube_config.json"
mem_cube_config_data = json.load(open(mem_cube_config_path))
mem_cube_config = GeneralMemCubeConfig.model_validate(mem_cube_config_data)
mem_cube = GeneralMemCube(mem_cube_config)
# Register memory cube to MOS
storage_path = f"./{user_id}_cube"
try:
mem_cube.dump(storage_path)
except Exception as e:
print(f"Memory cube already exists at {storage_path}, will reuse it.")
mos.register_mem_cube(
mem_cube_name_or_path=storage_path,
mem_cube_id=user_id,
user_id=user_id,
)
You can also directly load the model via Huggingface, vLLM, or SGLang and perform memory extraction using the preset templates we have configured.
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。