Views
No views yet
| 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.
pip install MemoryOS1from memos.configs.mem_reader import SimpleStructMemReaderConfig
2from memos.mem_reader.simple_struct import SimpleStructMemReader
3
4config = SimpleStructMemReaderConfig(
5 **{
6 "llm": {
7 "backend": "huggingface",
8 "config": {
9 "model_name_or_path": "MemTensor/MemOperator-0.6B",
10 "temperature": 0.6,
11 "max_tokens": 6000,
12 "top_p": 0.95,
13 "top_k": 20,
14 "extra_body": {"chat_template_kwargs": {"enable_thinking": false}}
15 },
16 },
17 "embedder": {
18 "backend": "ollama",
19 "config": {"model_name_or_path": "nomic-embed-text:latest"},
20 },
21 "chunker": {
22 "backend": "sentence",
23 "config": {
24 "tokenizer_or_token_counter": "gpt2",
25 "chunk_size": 512,
26 "chunk_overlap": 128,
27 "min_sentences_per_chunk": 1,
28 },
29 },
30 "remove_prompt_example": True,
31 }
32)
33
34reader = SimpleStructMemReader(config)
35
36# Example chat data
37chat_data = [
38 [
39 {
40 "role": "user",
41 "chat_time": "June 26, 2025 at 3:00 PM",
42 "content": "Hi Jerry! Yesterday at 3 PM I had a meeting with my team about the new project.",
43 },
44 {
45 "role": "assistant",
46 "chat_time": "June 26, 2025 at 3:00 PM",
47 "content": "Oh Tom! Do you think the team can finish by December 15?",
48 },
49 {
50 "role": "user",
51 "chat_time": "June 26, 2025 at 3:00 PM",
52 "content": "I’m worried. The backend won’t be done until December 10, so testing will be tight.",
53 },
54 {
55 "role": "assistant",
56 "chat_time": "June 26, 2025 at 3:00 PM",
57 "content": "Maybe propose an extension?",
58 },
59 {
60 "role": "user",
61 "chat_time": "June 26, 2025 at 4:21 PM",
62 "content": "Good idea. I’ll raise it in tomorrow’s 9:30 AM meeting—maybe shift the deadline to January 5.",
63 },
64 ]
65]
66
67# Save document for testing
68with open("tmp.txt", "w") as f:
69 f.write(
70 "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."
71 )
72
73# Extract chat and document memories
74chat_memory = reader.get_memory(
75 chat_data, type="chat", info={"user_id": "Tom", "session_id": "session1"}
76)
77doc_memory = reader.get_memory(
78 ["tmp.txt"],
79 "doc",
80 info={
81 "user_id": "Tom",
82 "session_id": "session2",
83 },
84)
85
86print(chat_memory)
87print(doc_memory)1{
2 ...,
3 "reorganize": true,
4 "text_mem": {
5 "backend": "tree_text",
6 "config": {
7 "extractor_llm": {
8 "backend": "huggingface",
9 "config": {
10 "model_name_or_path": "MemTensor/MemOperator-0.6B",
11 "temperature": 0.8,
12 "max_tokens": 1024,
13 "top_p": 0.9,
14 "top_k": 50
15 }
16 },
17 "dispatcher_llm": {
18 ...
19 }
20 },
21 "graph_db": {
22 ...
23 }
24 },
25 "embedder": {
26 ...
27 }
28 }
29 }
30 },
31 "act_mem": {},
32 "para_mem": {}
33}1import json
2from memos import GeneralMemCubeConfig, GeneralMemCube, MOSConfig
3from memos.mem_os.main import MOS
4
5# Initialize MOS
6user_id = 'test'
7mos_config_path = "configs/mos_memos_config.json"
8mos_config_data = json.load(open(mos_config_path))
9mos_config = MOSConfig(**mos_config_data)
10mos = MOS(mos_config)
11mos.create_user(user_id=user_id)
12
13# Configure and initialize memory cube
14mem_cube_config_path = "configs/mem_cube_config.json"
15mem_cube_config_data = json.load(open(mem_cube_config_path))
16mem_cube_config = GeneralMemCubeConfig.model_validate(mem_cube_config_data)
17mem_cube = GeneralMemCube(mem_cube_config)
18
19# Register memory cube to MOS
20storage_path = f"./{user_id}_cube"
21try:
22 mem_cube.dump(storage_path)
23except Exception as e:
24 print(f"Memory cube already exists at {storage_path}, will reuse it.")
25
26mos.register_mem_cube(
27 mem_cube_name_or_path=storage_path,
28 mem_cube_id=user_id,
29 user_id=user_id,
30)