MemoryOS 0.1.12__py3-none-any.whl → 0.1.13__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of MemoryOS might be problematic. Click here for more details.
- {memoryos-0.1.12.dist-info → memoryos-0.1.13.dist-info}/METADATA +42 -11
- {memoryos-0.1.12.dist-info → memoryos-0.1.13.dist-info}/RECORD +18 -13
- memos/__init__.py +1 -1
- memos/configs/internet_retriever.py +81 -0
- memos/configs/mem_os.py +4 -0
- memos/configs/memory.py +6 -1
- memos/mem_os/main.py +491 -0
- memos/mem_user/user_manager.py +10 -0
- memos/memories/textual/tree.py +34 -2
- memos/memories/textual/tree_text_memory/retrieve/internet_retriever.py +263 -0
- memos/memories/textual/tree_text_memory/retrieve/internet_retriever_factory.py +89 -0
- memos/memories/textual/tree_text_memory/retrieve/reasoner.py +1 -4
- memos/memories/textual/tree_text_memory/retrieve/searcher.py +46 -4
- memos/memories/textual/tree_text_memory/retrieve/task_goal_parser.py +3 -3
- memos/memories/textual/tree_text_memory/retrieve/xinyusearch.py +335 -0
- memos/templates/mos_prompts.py +63 -0
- {memoryos-0.1.12.dist-info → memoryos-0.1.13.dist-info}/LICENSE +0 -0
- {memoryos-0.1.12.dist-info → memoryos-0.1.13.dist-info}/WHEEL +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: MemoryOS
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.13
|
|
4
4
|
Summary: Intelligence Begins with Memory
|
|
5
5
|
License: Apache-2.0
|
|
6
6
|
Keywords: memory,llm,language model,memoryOS,agent
|
|
@@ -53,8 +53,8 @@ Description-Content-Type: text/markdown
|
|
|
53
53
|
<a href="https://memos.openmem.net/docs/home">
|
|
54
54
|
<img src="https://img.shields.io/badge/Documentation-view-blue.svg" alt="Documentation">
|
|
55
55
|
</a>
|
|
56
|
-
<a href="https://arxiv.org/abs/
|
|
57
|
-
<img src="https://img.shields.io/badge/arXiv-
|
|
56
|
+
<a href="https://arxiv.org/abs/2507.03724">
|
|
57
|
+
<img src="https://img.shields.io/badge/arXiv-2507.03724-b31b1b.svg" alt="ArXiv Paper">
|
|
58
58
|
</a>
|
|
59
59
|
<a href="https://github.com/MemTensor/MemOS/discussions">
|
|
60
60
|
<img src="https://img.shields.io/badge/GitHub-Discussions-181717.svg?logo=github" alt="GitHub Discussions">
|
|
@@ -62,7 +62,7 @@ Description-Content-Type: text/markdown
|
|
|
62
62
|
<a href="https://discord.gg/Txbx3gebZR">
|
|
63
63
|
<img src="https://img.shields.io/badge/Discord-join%20chat-7289DA.svg?logo=discord" alt="Discord">
|
|
64
64
|
</a>
|
|
65
|
-
<a href="docs/assets/
|
|
65
|
+
<a href="docs/assets/qr_code.png">
|
|
66
66
|
<img src="https://img.shields.io/badge/WeChat-Group-07C160.svg?logo=wechat" alt="WeChat Group">
|
|
67
67
|
</a>
|
|
68
68
|
<a href="https://opensource.org/license/apache-2-0/">
|
|
@@ -74,7 +74,7 @@ Description-Content-Type: text/markdown
|
|
|
74
74
|
---
|
|
75
75
|
|
|
76
76
|
<a href="https://memos.openmem.net/">
|
|
77
|
-
<img src="docs/assets/
|
|
77
|
+
<img src="docs/assets/sota_score.jpg" alt="SOTA SCORE">
|
|
78
78
|
</a>
|
|
79
79
|
|
|
80
80
|
|
|
@@ -182,7 +182,11 @@ For more detailed examples, please check out the [`examples`](./examples) direct
|
|
|
182
182
|
## 📦 Installation
|
|
183
183
|
|
|
184
184
|
> [!WARNING]
|
|
185
|
-
>
|
|
185
|
+
> MemOS is compatible with Linux, Windows, and macOS.
|
|
186
|
+
>
|
|
187
|
+
> However, if you're using macOS, please note that there may be dependency issues that are difficult to resolve.
|
|
188
|
+
>
|
|
189
|
+
> For example, compatibility with macOS 13 Ventura is currently challenging.
|
|
186
190
|
|
|
187
191
|
### Install via pip
|
|
188
192
|
|
|
@@ -223,24 +227,50 @@ Join our community to ask questions, share your projects, and connect with other
|
|
|
223
227
|
- **Discord**: Join our <a href="https://discord.gg/Txbx3gebZR" target="_blank">Discord Server</a>.
|
|
224
228
|
- **WeChat**: Scan the QR code to join our WeChat group.
|
|
225
229
|
|
|
226
|
-
<img src="docs/assets/
|
|
230
|
+
<img src="docs/assets/qr_code.png" alt="QR Code" width="600">
|
|
227
231
|
|
|
228
232
|
## 📜 Citation
|
|
229
233
|
|
|
230
|
-
|
|
234
|
+
> [!NOTE]
|
|
235
|
+
> We publicly released the Short Version on **May 28, 2025**, making it the earliest work to propose the concept of a Memory Operating System for LLMs.
|
|
236
|
+
|
|
237
|
+
If you use MemOS in your research, we would appreciate citations to our papers.
|
|
231
238
|
|
|
232
239
|
```bibtex
|
|
233
|
-
|
|
240
|
+
|
|
241
|
+
@article{li2025memos_long,
|
|
242
|
+
title={MemOS: A Memory OS for AI System},
|
|
243
|
+
author={Li, Zhiyu and Song, Shichao and Xi, Chenyang and Wang, Hanyu and Tang, Chen and Niu, Simin and Chen, Ding and Yang, Jiawei and Li, Chunyu and Yu, Qingchen and Zhao, Jihao and Wang, Yezhaohui and Liu, Peng and Lin, Zehao and Wang, Pengyuan and Huo, Jiahao and Chen, Tianyi and Chen, Kai and Li, Kehang and Tao, Zhen and Ren, Junpeng and Lai, Huayi and Wu, Hao and Tang, Bo and Wang, Zhenren and Fan, Zhaoxin and Zhang, Ningyu and Zhang, Linfeng and Yan, Junchi and Yang, Mingchuan and Xu, Tong and Xu, Wei and Chen, Huajun and Wang, Haofeng and Yang, Hongkang and Zhang, Wentao and Xu, Zhi-Qin John and Chen, Siheng and Xiong, Feiyu},
|
|
244
|
+
journal={arXiv preprint arXiv:2507.03724},
|
|
245
|
+
year={2025},
|
|
246
|
+
url={https://arxiv.org/abs/2507.03724}
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
@article{li2025memos_short,
|
|
234
250
|
title={MemOS: An Operating System for Memory-Augmented Generation (MAG) in Large Language Models},
|
|
235
251
|
author={Li, Zhiyu and Song, Shichao and Wang, Hanyu and Niu, Simin and Chen, Ding and Yang, Jiawei and Xi, Chenyang and Lai, Huayi and Zhao, Jihao and Wang, Yezhaohui and others},
|
|
236
252
|
journal={arXiv preprint arXiv:2505.22101},
|
|
237
|
-
year={2025}
|
|
253
|
+
year={2025},
|
|
254
|
+
url={https://arxiv.org/abs/2505.22101}
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
@article{yang2024memory3,
|
|
258
|
+
author = {Yang, Hongkang and Zehao, Lin and Wenjin, Wang and Wu, Hao and Zhiyu, Li and Tang, Bo and Wenqiang, Wei and Wang, Jinbo and Zeyun, Tang and Song, Shichao and Xi, Chenyang and Yu, Yu and Kai, Chen and Xiong, Feiyu and Tang, Linpeng and Weinan, E},
|
|
259
|
+
title = {Memory$^3$: Language Modeling with Explicit Memory},
|
|
260
|
+
journal = {Journal of Machine Learning},
|
|
261
|
+
year = {2024},
|
|
262
|
+
volume = {3},
|
|
263
|
+
number = {3},
|
|
264
|
+
pages = {300--346},
|
|
265
|
+
issn = {2790-2048},
|
|
266
|
+
doi = {https://doi.org/10.4208/jml.240708},
|
|
267
|
+
url = {https://global-sci.com/article/91443/memory3-language-modeling-with-explicit-memory}
|
|
238
268
|
}
|
|
239
269
|
```
|
|
240
270
|
|
|
241
271
|
## 🙌 Contributing
|
|
242
272
|
|
|
243
|
-
We welcome contributions from the community! Please read our [contribution guidelines](
|
|
273
|
+
We welcome contributions from the community! Please read our [contribution guidelines](https://memos.openmem.net/docs/contribution/overview) to get started.
|
|
244
274
|
|
|
245
275
|
## 📄 License
|
|
246
276
|
|
|
@@ -251,6 +281,7 @@ MemOS is licensed under the [Apache 2.0 License](./LICENSE).
|
|
|
251
281
|
Stay up to date with the latest MemOS announcements, releases, and community highlights.
|
|
252
282
|
|
|
253
283
|
- **2025-07-07** – 🎉 *MemOS 1.0 (Stellar) Preview Release*: A SOTA Memory OS for LLMs is now open-sourced.
|
|
284
|
+
- **2025-07-04** – 🎉 *MemOS Paper Released*: [MemOS: A Memory OS for AI System](https://arxiv.org/abs/2507.03724) was published on arXiv.
|
|
254
285
|
- **2025-05-28** – 🎉 *Short Paper Uploaded*: [MemOS: An Operating System for Memory-Augmented Generation (MAG) in Large Language Models](https://arxiv.org/abs/2505.22101) was published on arXiv.
|
|
255
286
|
- **2024-07-04** – 🎉 *Memory3 Model Released at WAIC 2024*: The new memory-layered architecture model was unveiled at the 2024 World Artificial Intelligence Conference.
|
|
256
287
|
- **2024-07-01** – 🎉 *Memory3 Paper Released*: [Memory3: Language Modeling with Explicit Memory](https://arxiv.org/abs/2407.01178) introduces the new approach to structured memory in LLMs.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
memos/__init__.py,sha256=
|
|
1
|
+
memos/__init__.py,sha256=c6S03YvsixngtCDQY7KeMPbLwPXHedu2T0EymeXAejY,576
|
|
2
2
|
memos/api/start_api.py,sha256=vDKS3D8AEwlDAkpWxHiblzVqcQ3cvGSnnpP4Jhjm3GE,14656
|
|
3
3
|
memos/chunkers/__init__.py,sha256=7lZOTN3e9Yp5XBsDX5wnWJ3tY126cRU9GmfevzJXAtU,67
|
|
4
4
|
memos/chunkers/base.py,sha256=z0rG5vM7FGremQdSZ_3jlTGbsDtlkWAYWdtSAGqpaR4,655
|
|
@@ -9,13 +9,14 @@ memos/configs/base.py,sha256=bOOhEU6HGFTq5jne_TXn8Br72rvAfJHYvYllFUPs12A,2588
|
|
|
9
9
|
memos/configs/chunker.py,sha256=Ulci0MyhS_FkuV95l7Pr9Vei179aEFEUigwVmtmSDfI,1593
|
|
10
10
|
memos/configs/embedder.py,sha256=a7EbWB3tnqeK_pdK6-CneoKIwSqQg6sJrXuHX3J1PnI,1769
|
|
11
11
|
memos/configs/graph_db.py,sha256=h5wz2lJSdB1IVaidzWHXDfvL4_IAjrjYrmypu1QCCq4,1432
|
|
12
|
+
memos/configs/internet_retriever.py,sha256=7x1Sp--skifHQqWvcPFiEOkda6HCCocw6HSO5H127jk,3046
|
|
12
13
|
memos/configs/llm.py,sha256=rfIyuxx2xefBD5NpZaeEy3M0gEgEEhvTp1RmRG-zodw,2378
|
|
13
14
|
memos/configs/mem_chat.py,sha256=TjEQHRG1HpLwCBo3hrn5aVK23rykNtV6Be5p4YIg7F4,2571
|
|
14
15
|
memos/configs/mem_cube.py,sha256=AvffqpFC2WmzshouxLJbabuzt0PKLWSauQMnagP_EM0,3088
|
|
15
|
-
memos/configs/mem_os.py,sha256=
|
|
16
|
+
memos/configs/mem_os.py,sha256=bUuyi6boIjjvYzrlFoCSqchbWF37IcA5BQi03feq7bg,2476
|
|
16
17
|
memos/configs/mem_reader.py,sha256=y1z4aABKgg-QzROApy3gAPyYX9M5CLi3vT_xKye8Ohs,1864
|
|
17
18
|
memos/configs/mem_scheduler.py,sha256=bTsBfl9GoXbjkiPDCenH8K2QY4RfAJNk-XN1UBl2W4Q,2959
|
|
18
|
-
memos/configs/memory.py,sha256
|
|
19
|
+
memos/configs/memory.py,sha256=-f9NpWNbZ11AMHrKngmqygXpb90mXKXIv8WxcQap6Nk,6842
|
|
19
20
|
memos/configs/parser.py,sha256=dy-QoevJbCnkJePKgpzR4oziOzYnS4jB6XH-YrpeMns,1145
|
|
20
21
|
memos/configs/utils.py,sha256=X9NQ6-xURsZROAdS3WT96phVfHcOHgDPOo2Yq68QoKM,242
|
|
21
22
|
memos/configs/vec_db.py,sha256=Gjhhda94pyTDjyJGe2Z6rVEqH4FtViiwq1-7QWhjarM,2335
|
|
@@ -49,7 +50,7 @@ memos/mem_cube/general.py,sha256=ad7Qzshf-psBuu24BX_K0NDN0KDuwliAi06TG4wyH1M,553
|
|
|
49
50
|
memos/mem_cube/utils.py,sha256=-6KiCCzy1PehbGAZY20BVcelvdiKFSu4CXMXi8qNrGU,777
|
|
50
51
|
memos/mem_os/client.py,sha256=0M-WRTlQr7fDAYtq4B8dsMR0PfmyvD-ySMhKcW3Umd0,43
|
|
51
52
|
memos/mem_os/core.py,sha256=csZQqZfbdACapcA85Ahh8vBfi0VPFGM_6yilfmln008,34836
|
|
52
|
-
memos/mem_os/main.py,sha256=
|
|
53
|
+
memos/mem_os/main.py,sha256=sGMleiO1_CG8-v3ctIMFe1hx8Jy_OohFtqqpWgRMhbw,21099
|
|
53
54
|
memos/mem_os/product.py,sha256=SFLFEleZISCeBU19b-uohFsaUNXB9tN-GGypuhDFx1I,3043
|
|
54
55
|
memos/mem_reader/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
55
56
|
memos/mem_reader/base.py,sha256=SSuaD3J88XbHsME1Qa-EAgZ57xApPHPHppMSeeS3JZ4,957
|
|
@@ -68,7 +69,7 @@ memos/mem_scheduler/modules/retriever.py,sha256=NJEFpX2ap4mSQZ9GYBvBr9QMD4QpgLEY
|
|
|
68
69
|
memos/mem_scheduler/modules/schemas.py,sha256=J7Rv4M932Wdm-NoOWQne9txOK7j0V9ScdsRH7klPGTI,5301
|
|
69
70
|
memos/mem_scheduler/scheduler_factory.py,sha256=pw6FKO0EuxFRipMnD22DvcjbM6pdmVfJmRjUvdTaU5E,800
|
|
70
71
|
memos/mem_scheduler/utils.py,sha256=xa2BotLf7iAQ4bVJEujPvRjuzWItOA2gP2H3BkBM5XY,582
|
|
71
|
-
memos/mem_user/user_manager.py,sha256=
|
|
72
|
+
memos/mem_user/user_manager.py,sha256=9XIt4Q2HA1fhh9dbjKRAXh-GTdT43WGYSx-IsST7jZM,15654
|
|
72
73
|
memos/memories/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
73
74
|
memos/memories/activation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
74
75
|
memos/memories/activation/base.py,sha256=kiC35AOnuofgYMzLxZyVULsfOoVq03BGvi6AXtNvF-I,1151
|
|
@@ -85,18 +86,21 @@ memos/memories/textual/base.py,sha256=3XVeuXZY3ZFzZ6zHIE3l5hx7X2PiH7orxvCwrNZ1l3
|
|
|
85
86
|
memos/memories/textual/general.py,sha256=7iektZA-_iR80sOlADW2EFkPT5Utbunu9hdZgT7Ocrk,11072
|
|
86
87
|
memos/memories/textual/item.py,sha256=v6YYDPdPt5uwsJxLlaMwi5m1r7Als2EwgFQhqBvNHRQ,6296
|
|
87
88
|
memos/memories/textual/naive.py,sha256=Z_gfbxI6cQGJ_raOTQic4fnpo493Xq3yEQ8qDV4xplo,6954
|
|
88
|
-
memos/memories/textual/tree.py,sha256=
|
|
89
|
+
memos/memories/textual/tree.py,sha256=GDG2KS6P9MQaBUmOrHEBUDgxbWCDzELF9XZshyC5zXk,13390
|
|
89
90
|
memos/memories/textual/tree_text_memory/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
90
91
|
memos/memories/textual/tree_text_memory/organize/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
91
92
|
memos/memories/textual/tree_text_memory/organize/manager.py,sha256=_nCKzkDk77D_KRSLHwjT1f8Ra9waNVCKs2sBEsmBypk,12341
|
|
92
93
|
memos/memories/textual/tree_text_memory/retrieve/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
93
|
-
memos/memories/textual/tree_text_memory/retrieve/
|
|
94
|
+
memos/memories/textual/tree_text_memory/retrieve/internet_retriever.py,sha256=asSzVcSVOiigN4-4NzFc7wzthGDK6P5sODIDF5W9egA,8467
|
|
95
|
+
memos/memories/textual/tree_text_memory/retrieve/internet_retriever_factory.py,sha256=pBlufTc5-mdWcyKR_R0Syev3QPMtV83mydyIw0Saz4o,3192
|
|
96
|
+
memos/memories/textual/tree_text_memory/retrieve/reasoner.py,sha256=5csoGjviFbN9RJ8dm3B6kjvoC8xbPD8UMiGusefHaf0,2228
|
|
94
97
|
memos/memories/textual/tree_text_memory/retrieve/recall.py,sha256=a1P-L3ZER2wh6qTy6p2EhJ-6mSeSisbZgJnHjQv4XkM,5846
|
|
95
98
|
memos/memories/textual/tree_text_memory/retrieve/reranker.py,sha256=U_O0uEKpWHAURhSvkzjYoR2LC8v8vzBjRo8MTeW_6i4,3680
|
|
96
99
|
memos/memories/textual/tree_text_memory/retrieve/retrieval_mid_structs.py,sha256=jZs2S1jtd727gqDKs8clYCOwcqOBnrl_UmFU1FPE0w8,360
|
|
97
|
-
memos/memories/textual/tree_text_memory/retrieve/searcher.py,sha256=
|
|
98
|
-
memos/memories/textual/tree_text_memory/retrieve/task_goal_parser.py,sha256=
|
|
100
|
+
memos/memories/textual/tree_text_memory/retrieve/searcher.py,sha256=2TQsYxWXxZns7jQo1_5rZxbdjqReaQIzGDYJb9eZ4RM,8367
|
|
101
|
+
memos/memories/textual/tree_text_memory/retrieve/task_goal_parser.py,sha256=mAPxg5P3wmAvRVrutpeE3i2yC1R90egUUGdTWyWmq1U,2653
|
|
99
102
|
memos/memories/textual/tree_text_memory/retrieve/utils.py,sha256=JU9_3OTRp1lXHWV6SuRUIO_GjRCPclEu9MrjNZX_kck,1406
|
|
103
|
+
memos/memories/textual/tree_text_memory/retrieve/xinyusearch.py,sha256=0bewmGoHE2n-inHDMlHY2wfpGUzTPSRBm9JkGl63rag,10437
|
|
100
104
|
memos/parsers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
101
105
|
memos/parsers/base.py,sha256=AWgWIZzReDiTqiv6z08_9aG2KHVzc4Bdr0Lowz0mWVI,435
|
|
102
106
|
memos/parsers/factory.py,sha256=hPKTR0wVgMQ5Z9ZL-a9FyHWCpz9UcrG2oSEDYBAoB3g,704
|
|
@@ -105,13 +109,14 @@ memos/settings.py,sha256=HYNBFRW0CS2Kh4GmMRMA-Yrh3ZhJno4S4B6gx6P3T30,178
|
|
|
105
109
|
memos/templates/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
106
110
|
memos/templates/mem_reader_prompts.py,sha256=_I9W5AHpmyQKzbuty-NkTBXufDtHzxQmXGvMgxScTa0,5924
|
|
107
111
|
memos/templates/mem_scheduler_prompts.py,sha256=53bcOCC32790tVJ7_s7o0jwu6hg7jUs-z8dyahlLv24,2417
|
|
112
|
+
memos/templates/mos_prompts.py,sha256=QJrMb4FwMOAVb-SFSCGTuqqzvD_YhBTpdVBvpUIftK0,3595
|
|
108
113
|
memos/types.py,sha256=N7XBYxDTdc50KEsS6YxHvYgs23ykGsZ-wNnaJBVdVi4,1791
|
|
109
114
|
memos/vec_dbs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
110
115
|
memos/vec_dbs/base.py,sha256=a_-Gsh51C1_8R35mK7DykDxQTicmdgyz4fbEw8d5Mlg,3165
|
|
111
116
|
memos/vec_dbs/factory.py,sha256=Noa4caqzPT9b59i2jzdpAHFCSHiMfDmgRox1POkRRfE,710
|
|
112
117
|
memos/vec_dbs/item.py,sha256=mLrcHF0nWtMCUjScBgaeeSqabQ3vJhKr_6wrU_g25ns,1425
|
|
113
118
|
memos/vec_dbs/qdrant.py,sha256=I_XFmz_7SgFojMTFaqkPvwQEdMBl0MsCKZ43qatwuV0,9858
|
|
114
|
-
memoryos-0.1.
|
|
115
|
-
memoryos-0.1.
|
|
116
|
-
memoryos-0.1.
|
|
117
|
-
memoryos-0.1.
|
|
119
|
+
memoryos-0.1.13.dist-info/LICENSE,sha256=FU-b6N8tVc7dzUZGyNjUIG1Ihnrh2iuBziq4a1Gl8HU,11358
|
|
120
|
+
memoryos-0.1.13.dist-info/METADATA,sha256=RfJVrfNGHwDlsIlXcR6UG6egWsjYXNtWOIbT0SUhNGc,12766
|
|
121
|
+
memoryos-0.1.13.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
122
|
+
memoryos-0.1.13.dist-info/RECORD,,
|
memos/__init__.py
CHANGED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"""Configuration classes for internet retrievers."""
|
|
2
|
+
|
|
3
|
+
from typing import Any, ClassVar
|
|
4
|
+
|
|
5
|
+
from pydantic import Field, field_validator, model_validator
|
|
6
|
+
|
|
7
|
+
from memos.configs.base import BaseConfig
|
|
8
|
+
from memos.exceptions import ConfigurationError
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class BaseInternetRetrieverConfig(BaseConfig):
|
|
12
|
+
"""Base configuration class for internet retrievers."""
|
|
13
|
+
|
|
14
|
+
api_key: str = Field(..., description="API key for the search service")
|
|
15
|
+
search_engine_id: str | None = Field(
|
|
16
|
+
None, description="Search engine ID (required for Google Custom Search)"
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class GoogleCustomSearchConfig(BaseInternetRetrieverConfig):
|
|
21
|
+
"""Configuration class for Google Custom Search API."""
|
|
22
|
+
|
|
23
|
+
search_engine_id: str = Field(..., description="Google Custom Search Engine ID (cx parameter)")
|
|
24
|
+
max_results: int = Field(default=20, description="Maximum number of results to retrieve")
|
|
25
|
+
num_per_request: int = Field(
|
|
26
|
+
default=10, description="Number of results per API request (max 10 for Google)"
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class BingSearchConfig(BaseInternetRetrieverConfig):
|
|
31
|
+
"""Configuration class for Bing Search API."""
|
|
32
|
+
|
|
33
|
+
endpoint: str = Field(
|
|
34
|
+
default="https://api.bing.microsoft.com/v7.0/search", description="Bing Search API endpoint"
|
|
35
|
+
)
|
|
36
|
+
max_results: int = Field(default=20, description="Maximum number of results to retrieve")
|
|
37
|
+
num_per_request: int = Field(default=10, description="Number of results per API request")
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class XinyuSearchConfig(BaseInternetRetrieverConfig):
|
|
41
|
+
"""Configuration class for Xinyu Search API."""
|
|
42
|
+
|
|
43
|
+
search_engine_id: str | None = Field(
|
|
44
|
+
None, description="Not used for Xinyu Search (kept for compatibility)"
|
|
45
|
+
)
|
|
46
|
+
max_results: int = Field(default=20, description="Maximum number of results to retrieve")
|
|
47
|
+
num_per_request: int = Field(
|
|
48
|
+
default=10, description="Number of results per API request (not used for Xinyu)"
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
class InternetRetrieverConfigFactory(BaseConfig):
|
|
53
|
+
"""Factory class for creating internet retriever configurations."""
|
|
54
|
+
|
|
55
|
+
backend: str | None = Field(
|
|
56
|
+
None, description="Backend for internet retriever (google, bing, etc.)"
|
|
57
|
+
)
|
|
58
|
+
config: dict[str, Any] | None = Field(
|
|
59
|
+
None, description="Configuration for the internet retriever backend"
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
backend_to_class: ClassVar[dict[str, Any]] = {
|
|
63
|
+
"google": GoogleCustomSearchConfig,
|
|
64
|
+
"bing": BingSearchConfig,
|
|
65
|
+
"xinyu": XinyuSearchConfig,
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
@field_validator("backend")
|
|
69
|
+
@classmethod
|
|
70
|
+
def validate_backend(cls, backend: str | None) -> str | None:
|
|
71
|
+
"""Validate the backend field."""
|
|
72
|
+
if backend is not None and backend not in cls.backend_to_class:
|
|
73
|
+
raise ConfigurationError(f"Invalid internet retriever backend: {backend}")
|
|
74
|
+
return backend
|
|
75
|
+
|
|
76
|
+
@model_validator(mode="after")
|
|
77
|
+
def create_config(self) -> "InternetRetrieverConfigFactory":
|
|
78
|
+
if self.backend is not None:
|
|
79
|
+
config_class = self.backend_to_class[self.backend]
|
|
80
|
+
self.config = config_class(**self.config)
|
|
81
|
+
return self
|
memos/configs/mem_os.py
CHANGED
|
@@ -57,6 +57,10 @@ class MOSConfig(BaseConfig):
|
|
|
57
57
|
default=False,
|
|
58
58
|
description="Enable memory scheduler for automated memory management",
|
|
59
59
|
)
|
|
60
|
+
PRO_MODE: bool = Field(
|
|
61
|
+
default=False,
|
|
62
|
+
description="Enable PRO mode for complex query decomposition",
|
|
63
|
+
)
|
|
60
64
|
|
|
61
65
|
|
|
62
66
|
class MemOSConfigFactory(BaseConfig):
|
memos/configs/memory.py
CHANGED
|
@@ -5,6 +5,7 @@ from pydantic import Field, field_validator, model_validator
|
|
|
5
5
|
from memos.configs.base import BaseConfig
|
|
6
6
|
from memos.configs.embedder import EmbedderConfigFactory
|
|
7
7
|
from memos.configs.graph_db import GraphDBConfigFactory
|
|
8
|
+
from memos.configs.internet_retriever import InternetRetrieverConfigFactory
|
|
8
9
|
from memos.configs.llm import LLMConfigFactory
|
|
9
10
|
from memos.configs.vec_db import VectorDBConfigFactory
|
|
10
11
|
from memos.exceptions import ConfigurationError
|
|
@@ -133,7 +134,7 @@ class GeneralTextMemoryConfig(BaseTextMemoryConfig):
|
|
|
133
134
|
|
|
134
135
|
|
|
135
136
|
class TreeTextMemoryConfig(BaseTextMemoryConfig):
|
|
136
|
-
"""
|
|
137
|
+
"""Tree text memory configuration class."""
|
|
137
138
|
|
|
138
139
|
extractor_llm: LLMConfigFactory = Field(
|
|
139
140
|
...,
|
|
@@ -155,6 +156,10 @@ class TreeTextMemoryConfig(BaseTextMemoryConfig):
|
|
|
155
156
|
default_factory=GraphDBConfigFactory,
|
|
156
157
|
description="Graph database configuration for the tree-memory storage",
|
|
157
158
|
)
|
|
159
|
+
internet_retriever: InternetRetrieverConfigFactory | None = Field(
|
|
160
|
+
None,
|
|
161
|
+
description="Internet retriever configuration (optional)",
|
|
162
|
+
)
|
|
158
163
|
|
|
159
164
|
|
|
160
165
|
# ─── 3. Global Memory Config Factory ──────────────────────────────────────────
|