memu-py 0.1.4__tar.gz

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.
Files changed (52) hide show
  1. memu_py-0.1.4/LICENSE +194 -0
  2. memu_py-0.1.4/MANIFEST.in +24 -0
  3. memu_py-0.1.4/PKG-INFO +436 -0
  4. memu_py-0.1.4/README.md +172 -0
  5. memu_py-0.1.4/example/memorize_example.py +117 -0
  6. memu_py-0.1.4/example/openai_chat_example.py +139 -0
  7. memu_py-0.1.4/example/recall_example.py +237 -0
  8. memu_py-0.1.4/example/sdk_example.py +389 -0
  9. memu_py-0.1.4/memu/__init__.py +145 -0
  10. memu_py-0.1.4/memu/config/__init__.py +52 -0
  11. memu_py-0.1.4/memu/config/activity/config.py +48 -0
  12. memu_py-0.1.4/memu/config/event/config.py +48 -0
  13. memu_py-0.1.4/memu/config/markdown_config.py +228 -0
  14. memu_py-0.1.4/memu/config/profile/config.py +50 -0
  15. memu_py-0.1.4/memu/config.py +358 -0
  16. memu_py-0.1.4/memu/llm/__init__.py +24 -0
  17. memu_py-0.1.4/memu/llm/anthropic_client.py +133 -0
  18. memu_py-0.1.4/memu/llm/azure_openai_client.py +198 -0
  19. memu_py-0.1.4/memu/llm/base.py +100 -0
  20. memu_py-0.1.4/memu/llm/custom_client.py +151 -0
  21. memu_py-0.1.4/memu/llm/deepseek_client.py +211 -0
  22. memu_py-0.1.4/memu/llm/openai_client.py +164 -0
  23. memu_py-0.1.4/memu/memory/__init__.py +31 -0
  24. memu_py-0.1.4/memu/memory/actions/__init__.py +40 -0
  25. memu_py-0.1.4/memu/memory/actions/add_activity_memory.py +441 -0
  26. memu_py-0.1.4/memu/memory/actions/base_action.py +370 -0
  27. memu_py-0.1.4/memu/memory/actions/cluster_memories.py +338 -0
  28. memu_py-0.1.4/memu/memory/actions/generate_suggestions.py +215 -0
  29. memu_py-0.1.4/memu/memory/actions/get_available_categories.py +68 -0
  30. memu_py-0.1.4/memu/memory/actions/link_related_memories.py +637 -0
  31. memu_py-0.1.4/memu/memory/actions/run_theory_of_mind.py +278 -0
  32. memu_py-0.1.4/memu/memory/actions/test/quick_memory_test.py +901 -0
  33. memu_py-0.1.4/memu/memory/actions/update_memory_with_suggestions.py +671 -0
  34. memu_py-0.1.4/memu/memory/embeddings.py +286 -0
  35. memu_py-0.1.4/memu/memory/file_manager.py +252 -0
  36. memu_py-0.1.4/memu/memory/memory_agent.py +593 -0
  37. memu_py-0.1.4/memu/memory/recall_agent.py +453 -0
  38. memu_py-0.1.4/memu/sdk/__init__.py +37 -0
  39. memu_py-0.1.4/memu/sdk/client.py +434 -0
  40. memu_py-0.1.4/memu/sdk/exceptions.py +40 -0
  41. memu_py-0.1.4/memu/sdk/models.py +156 -0
  42. memu_py-0.1.4/memu/utils/__init__.py +15 -0
  43. memu_py-0.1.4/memu/utils/logging.py +116 -0
  44. memu_py-0.1.4/memu_py.egg-info/PKG-INFO +436 -0
  45. memu_py-0.1.4/memu_py.egg-info/SOURCES.txt +51 -0
  46. memu_py-0.1.4/memu_py.egg-info/dependency_links.txt +1 -0
  47. memu_py-0.1.4/memu_py.egg-info/requires.txt +53 -0
  48. memu_py-0.1.4/memu_py.egg-info/top_level.txt +1 -0
  49. memu_py-0.1.4/pyproject.toml +123 -0
  50. memu_py-0.1.4/requirements-dev.txt +10 -0
  51. memu_py-0.1.4/requirements.txt +20 -0
  52. memu_py-0.1.4/setup.cfg +23 -0
memu_py-0.1.4/LICENSE ADDED
@@ -0,0 +1,194 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity granting the License.
13
+
14
+ "Legal Entity" shall mean the union of the acting entity and all
15
+ other entities that control, are controlled by, or are under common
16
+ control with that entity. For the purposes of this definition,
17
+ "control" means (i) the power, direct or indirect, to cause the
18
+ direction or management of such entity, whether by contract or
19
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
20
+ outstanding shares, or (iii) beneficial ownership of such entity.
21
+
22
+ "You" (or "Your") shall mean an individual or Legal Entity
23
+ exercising permissions granted by this License.
24
+
25
+ "Source" form shall mean the preferred form for making modifications,
26
+ including but not limited to software source code, documentation
27
+ source, and configuration files.
28
+
29
+ "Object" form shall mean any form resulting from mechanical
30
+ transformation or translation of a Source form, including but
31
+ not limited to compiled object code, generated documentation,
32
+ and conversions to other media types.
33
+
34
+ "Work" shall mean the work of authorship, whether in Source or
35
+ Object form, made available under the License, as indicated by a
36
+ copyright notice that is included in or attached to the work
37
+ (which shall not include communication that is conspicuously
38
+ marked or otherwise designated in writing by the copyright owner
39
+ as "Not a Contribution").
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based upon (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and derivative works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control
58
+ systems, and issue tracking systems that are managed by, or on behalf
59
+ of, the Licensor for the purpose of discussing and improving the Work,
60
+ but excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution".
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to use, reproduce, modify, merge, publish,
71
+ distribute, sublicense, and/or sell copies of the Work, and to
72
+ permit persons to whom the Work is furnished to do so, subject to
73
+ the following conditions:
74
+
75
+ The above copyright notice and this permission notice shall be
76
+ included in all copies or substantial portions of the Work.
77
+
78
+ 3. Grant of Patent License. Subject to the terms and conditions of
79
+ this License, each Contributor hereby grants to You a perpetual,
80
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
81
+ (except as stated in this section) patent license to make, have made,
82
+ use, offer to sell, sell, import, and otherwise transfer the Work,
83
+ where such license applies only to those patent claims licensable
84
+ by such Contributor that are necessarily infringed by their
85
+ Contribution(s) alone or by combination of their Contribution(s)
86
+ with the Work to which such Contribution(s) was submitted. If You
87
+ institute patent litigation against any entity (including a
88
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
89
+ or a Contribution incorporated within the Work constitutes direct
90
+ or contributory patent infringement, then any patent licenses
91
+ granted to You under this License for that Work shall terminate
92
+ as of the date such litigation is filed.
93
+
94
+ 4. Redistribution. You may reproduce and distribute copies of the
95
+ Work or Derivative Works thereof in any medium, with or without
96
+ modifications, and in Source or Object form, provided that You
97
+ meet the following conditions:
98
+
99
+ (a) You must give any other recipients of the Work or
100
+ Derivative Works a copy of this License; and
101
+
102
+ (b) You must cause any modified files to carry prominent notices
103
+ stating that You changed the files; and
104
+
105
+ (c) You must retain, in the Source form of any Derivative Works
106
+ that You distribute, all copyright, trademark, patent,
107
+ attribution and other notices from the Source form of the Work,
108
+ excluding those notices that do not pertain to any part of
109
+ the Derivative Works; and
110
+
111
+ (d) If the Work includes a "NOTICE" text file as part of its
112
+ distribution, then any Derivative Works that You distribute must
113
+ include a readable copy of the attribution notices contained
114
+ within such NOTICE file, excluding those notices that do not
115
+ pertain to any part of the Derivative Works, in at least one
116
+ of the following places: within a NOTICE text file distributed
117
+ as part of the Derivative Works; within the Source form or
118
+ documentation, if provided along with the Derivative Works; or,
119
+ within a display generated by the Derivative Works, if and
120
+ wherever such third-party notices normally appear. The contents
121
+ of the NOTICE file are for informational purposes only and
122
+ do not modify the License. You may add Your own attribution
123
+ notices within Derivative Works that You distribute, alongside
124
+ or as an addendum to the NOTICE text from the Work, provided
125
+ that such additional attribution notices cannot be construed
126
+ as modifying the License.
127
+
128
+ You may add Your own copyright notice to Your modifications and
129
+ may provide additional or different license terms and conditions
130
+ for use, reproduction, or distribution of Your modifications, or
131
+ for any such Derivative Works as a whole, provided Your use,
132
+ reproduction, and distribution of the Work otherwise complies with
133
+ the conditions stated in this License.
134
+
135
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
136
+ any Contribution intentionally submitted for inclusion in the Work
137
+ by You to the Licensor shall be under the terms and conditions of
138
+ this License, without any additional terms or conditions.
139
+ Notwithstanding the above, nothing herein shall supersede or modify
140
+ the terms of any separate license agreement you may have executed
141
+ with Licensor regarding such Contributions.
142
+
143
+ 6. Trademarks. This License does not grant permission to use the trade
144
+ names, trademarks, service marks, or product names of the Licensor,
145
+ except as required for reasonable and customary use in describing the
146
+ origin of the Work and reproducing the content of the NOTICE file.
147
+
148
+ 7. Disclaimer of Warranty. Unless required by applicable law or
149
+ agreed to in writing, Licensor provides the Work (and each
150
+ Contributor provides its Contributions) on an "AS IS" BASIS,
151
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
152
+ implied, including, without limitation, any warranties or conditions
153
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
154
+ PARTICULAR PURPOSE. You are solely responsible for determining the
155
+ appropriateness of using or redistributing the Work and assume any
156
+ risks associated with Your exercise of permissions under this License.
157
+
158
+ 8. Limitation of Liability. In no event and under no legal theory,
159
+ whether in tort (including negligence), contract, or otherwise,
160
+ unless required by applicable law (such as deliberate and grossly
161
+ negligent acts) or agreed to in writing, shall any Contributor be
162
+ liable to You for damages, including any direct, indirect, special,
163
+ incidental, or consequential damages of any character arising as a
164
+ result of this License or out of the use or inability to use the
165
+ Work (including but not limited to damages for loss of goodwill,
166
+ work stoppage, computer failure or malfunction, or any and all
167
+ other commercial damages or losses), even if such Contributor
168
+ has been advised of the possibility of such damages.
169
+
170
+ 9. Accepting Warranty or Support. You may choose to offer, and to
171
+ charge a fee for, warranty, support, indemnity or other liability
172
+ obligations and/or rights consistent with this License. However, in
173
+ accepting such obligations, You may act only on Your own behalf and
174
+ on Your sole responsibility, not on behalf of any other Contributor,
175
+ and only if You agree to indemnify, defend, and hold each Contributor
176
+ harmless for any liability incurred by, or claims asserted against,
177
+ such Contributor by reason of your accepting any such warranty or
178
+ support.
179
+
180
+ END OF TERMS AND CONDITIONS
181
+
182
+ Copyright 2024 PersonaLab Team
183
+
184
+ Licensed under the Apache License, Version 2.0 (the "License");
185
+ you may not use this file except in compliance with the License.
186
+ You may obtain a copy of the License at
187
+
188
+ http://www.apache.org/licenses/LICENSE-2.0
189
+
190
+ Unless required by applicable law or agreed to in writing, software
191
+ distributed under the License is distributed on an "AS IS" BASIS,
192
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
193
+ See the License for the specific language governing permissions and
194
+ limitations under the License.
@@ -0,0 +1,24 @@
1
+ include README.md
2
+ include CHANGELOG.md
3
+ include requirements.txt
4
+ include requirements-dev.txt
5
+ recursive-include memu *.py
6
+ recursive-include example *.py
7
+ include setup_postgres_env.sh
8
+ exclude .env
9
+ exclude .env.example
10
+ exclude setup.py.backup
11
+ exclude */__pycache__/*
12
+ exclude *.pyc
13
+ exclude *.pyo
14
+ exclude .git/*
15
+ exclude .github/*
16
+ exclude server/*
17
+ exclude docs/*
18
+ exclude scripts/*
19
+ exclude docker-compose.yml
20
+ exclude Dockerfile
21
+ exclude .dockerignore
22
+ exclude PROJECT_RELEASE_SUMMARY.md
23
+ exclude Makefile
24
+ exclude .pre-commit-config.yaml
memu_py-0.1.4/PKG-INFO ADDED
@@ -0,0 +1,436 @@
1
+ Metadata-Version: 2.1
2
+ Name: memu-py
3
+ Version: 0.1.4
4
+ Summary: AI Memory and Conversation Management Framework - Simple as mem0, Powerful as MemU
5
+ Author-email: MemU Team <support@memu.ai>
6
+ License: Apache License
7
+ Version 2.0, January 2004
8
+ http://www.apache.org/licenses/
9
+
10
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
11
+
12
+ 1. Definitions.
13
+
14
+ "License" shall mean the terms and conditions for use, reproduction,
15
+ and distribution as defined by Sections 1 through 9 of this document.
16
+
17
+ "Licensor" shall mean the copyright owner or entity granting the License.
18
+
19
+ "Legal Entity" shall mean the union of the acting entity and all
20
+ other entities that control, are controlled by, or are under common
21
+ control with that entity. For the purposes of this definition,
22
+ "control" means (i) the power, direct or indirect, to cause the
23
+ direction or management of such entity, whether by contract or
24
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
25
+ outstanding shares, or (iii) beneficial ownership of such entity.
26
+
27
+ "You" (or "Your") shall mean an individual or Legal Entity
28
+ exercising permissions granted by this License.
29
+
30
+ "Source" form shall mean the preferred form for making modifications,
31
+ including but not limited to software source code, documentation
32
+ source, and configuration files.
33
+
34
+ "Object" form shall mean any form resulting from mechanical
35
+ transformation or translation of a Source form, including but
36
+ not limited to compiled object code, generated documentation,
37
+ and conversions to other media types.
38
+
39
+ "Work" shall mean the work of authorship, whether in Source or
40
+ Object form, made available under the License, as indicated by a
41
+ copyright notice that is included in or attached to the work
42
+ (which shall not include communication that is conspicuously
43
+ marked or otherwise designated in writing by the copyright owner
44
+ as "Not a Contribution").
45
+
46
+ "Derivative Works" shall mean any work, whether in Source or Object
47
+ form, that is based upon (or derived from) the Work and for which the
48
+ editorial revisions, annotations, elaborations, or other modifications
49
+ represent, as a whole, an original work of authorship. For the purposes
50
+ of this License, Derivative Works shall not include works that remain
51
+ separable from, or merely link (or bind by name) to the interfaces of,
52
+ the Work and derivative works thereof.
53
+
54
+ "Contribution" shall mean any work of authorship, including
55
+ the original version of the Work and any modifications or additions
56
+ to that Work or Derivative Works thereof, that is intentionally
57
+ submitted to Licensor for inclusion in the Work by the copyright owner
58
+ or by an individual or Legal Entity authorized to submit on behalf of
59
+ the copyright owner. For the purposes of this definition, "submitted"
60
+ means any form of electronic, verbal, or written communication sent
61
+ to the Licensor or its representatives, including but not limited to
62
+ communication on electronic mailing lists, source code control
63
+ systems, and issue tracking systems that are managed by, or on behalf
64
+ of, the Licensor for the purpose of discussing and improving the Work,
65
+ but excluding communication that is conspicuously marked or otherwise
66
+ designated in writing by the copyright owner as "Not a Contribution".
67
+
68
+ "Contributor" shall mean Licensor and any individual or Legal Entity
69
+ on behalf of whom a Contribution has been received by Licensor and
70
+ subsequently incorporated within the Work.
71
+
72
+ 2. Grant of Copyright License. Subject to the terms and conditions of
73
+ this License, each Contributor hereby grants to You a perpetual,
74
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
75
+ copyright license to use, reproduce, modify, merge, publish,
76
+ distribute, sublicense, and/or sell copies of the Work, and to
77
+ permit persons to whom the Work is furnished to do so, subject to
78
+ the following conditions:
79
+
80
+ The above copyright notice and this permission notice shall be
81
+ included in all copies or substantial portions of the Work.
82
+
83
+ 3. Grant of Patent License. Subject to the terms and conditions of
84
+ this License, each Contributor hereby grants to You a perpetual,
85
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
86
+ (except as stated in this section) patent license to make, have made,
87
+ use, offer to sell, sell, import, and otherwise transfer the Work,
88
+ where such license applies only to those patent claims licensable
89
+ by such Contributor that are necessarily infringed by their
90
+ Contribution(s) alone or by combination of their Contribution(s)
91
+ with the Work to which such Contribution(s) was submitted. If You
92
+ institute patent litigation against any entity (including a
93
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
94
+ or a Contribution incorporated within the Work constitutes direct
95
+ or contributory patent infringement, then any patent licenses
96
+ granted to You under this License for that Work shall terminate
97
+ as of the date such litigation is filed.
98
+
99
+ 4. Redistribution. You may reproduce and distribute copies of the
100
+ Work or Derivative Works thereof in any medium, with or without
101
+ modifications, and in Source or Object form, provided that You
102
+ meet the following conditions:
103
+
104
+ (a) You must give any other recipients of the Work or
105
+ Derivative Works a copy of this License; and
106
+
107
+ (b) You must cause any modified files to carry prominent notices
108
+ stating that You changed the files; and
109
+
110
+ (c) You must retain, in the Source form of any Derivative Works
111
+ that You distribute, all copyright, trademark, patent,
112
+ attribution and other notices from the Source form of the Work,
113
+ excluding those notices that do not pertain to any part of
114
+ the Derivative Works; and
115
+
116
+ (d) If the Work includes a "NOTICE" text file as part of its
117
+ distribution, then any Derivative Works that You distribute must
118
+ include a readable copy of the attribution notices contained
119
+ within such NOTICE file, excluding those notices that do not
120
+ pertain to any part of the Derivative Works, in at least one
121
+ of the following places: within a NOTICE text file distributed
122
+ as part of the Derivative Works; within the Source form or
123
+ documentation, if provided along with the Derivative Works; or,
124
+ within a display generated by the Derivative Works, if and
125
+ wherever such third-party notices normally appear. The contents
126
+ of the NOTICE file are for informational purposes only and
127
+ do not modify the License. You may add Your own attribution
128
+ notices within Derivative Works that You distribute, alongside
129
+ or as an addendum to the NOTICE text from the Work, provided
130
+ that such additional attribution notices cannot be construed
131
+ as modifying the License.
132
+
133
+ You may add Your own copyright notice to Your modifications and
134
+ may provide additional or different license terms and conditions
135
+ for use, reproduction, or distribution of Your modifications, or
136
+ for any such Derivative Works as a whole, provided Your use,
137
+ reproduction, and distribution of the Work otherwise complies with
138
+ the conditions stated in this License.
139
+
140
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
141
+ any Contribution intentionally submitted for inclusion in the Work
142
+ by You to the Licensor shall be under the terms and conditions of
143
+ this License, without any additional terms or conditions.
144
+ Notwithstanding the above, nothing herein shall supersede or modify
145
+ the terms of any separate license agreement you may have executed
146
+ with Licensor regarding such Contributions.
147
+
148
+ 6. Trademarks. This License does not grant permission to use the trade
149
+ names, trademarks, service marks, or product names of the Licensor,
150
+ except as required for reasonable and customary use in describing the
151
+ origin of the Work and reproducing the content of the NOTICE file.
152
+
153
+ 7. Disclaimer of Warranty. Unless required by applicable law or
154
+ agreed to in writing, Licensor provides the Work (and each
155
+ Contributor provides its Contributions) on an "AS IS" BASIS,
156
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
157
+ implied, including, without limitation, any warranties or conditions
158
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
159
+ PARTICULAR PURPOSE. You are solely responsible for determining the
160
+ appropriateness of using or redistributing the Work and assume any
161
+ risks associated with Your exercise of permissions under this License.
162
+
163
+ 8. Limitation of Liability. In no event and under no legal theory,
164
+ whether in tort (including negligence), contract, or otherwise,
165
+ unless required by applicable law (such as deliberate and grossly
166
+ negligent acts) or agreed to in writing, shall any Contributor be
167
+ liable to You for damages, including any direct, indirect, special,
168
+ incidental, or consequential damages of any character arising as a
169
+ result of this License or out of the use or inability to use the
170
+ Work (including but not limited to damages for loss of goodwill,
171
+ work stoppage, computer failure or malfunction, or any and all
172
+ other commercial damages or losses), even if such Contributor
173
+ has been advised of the possibility of such damages.
174
+
175
+ 9. Accepting Warranty or Support. You may choose to offer, and to
176
+ charge a fee for, warranty, support, indemnity or other liability
177
+ obligations and/or rights consistent with this License. However, in
178
+ accepting such obligations, You may act only on Your own behalf and
179
+ on Your sole responsibility, not on behalf of any other Contributor,
180
+ and only if You agree to indemnify, defend, and hold each Contributor
181
+ harmless for any liability incurred by, or claims asserted against,
182
+ such Contributor by reason of your accepting any such warranty or
183
+ support.
184
+
185
+ END OF TERMS AND CONDITIONS
186
+
187
+ Copyright 2024 PersonaLab Team
188
+
189
+ Licensed under the Apache License, Version 2.0 (the "License");
190
+ you may not use this file except in compliance with the License.
191
+ You may obtain a copy of the License at
192
+
193
+ http://www.apache.org/licenses/LICENSE-2.0
194
+
195
+ Unless required by applicable law or agreed to in writing, software
196
+ distributed under the License is distributed on an "AS IS" BASIS,
197
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
198
+ See the License for the specific language governing permissions and
199
+ limitations under the License.
200
+ Project-URL: Homepage, https://github.com/NevaMind-AI/MemU
201
+ Project-URL: Bug Tracker, https://github.com/NevaMind-AI/MemU/issues
202
+ Project-URL: Documentation, https://github.com/NevaMind-AI/MemU#readme
203
+ Keywords: ai,memory,conversation,llm,chatbot,persona,agent
204
+ Classifier: Development Status :: 4 - Beta
205
+ Classifier: Intended Audience :: Developers
206
+ Classifier: License :: OSI Approved :: Apache Software License
207
+ Classifier: Operating System :: OS Independent
208
+ Classifier: Programming Language :: Python :: 3
209
+ Classifier: Programming Language :: Python :: 3.8
210
+ Classifier: Programming Language :: Python :: 3.9
211
+ Classifier: Programming Language :: Python :: 3.10
212
+ Classifier: Programming Language :: Python :: 3.11
213
+ Classifier: Programming Language :: Python :: 3.12
214
+ Requires-Python: >=3.8
215
+ Description-Content-Type: text/markdown
216
+ License-File: LICENSE
217
+ Requires-Dist: requests>=2.31.0
218
+ Requires-Dist: python-dotenv>=0.19.0
219
+ Requires-Dist: json5>=0.9.0
220
+ Requires-Dist: openai>=1.60.0
221
+ Requires-Dist: httpx<0.28,>=0.23
222
+ Requires-Dist: pydantic>=2.7.5
223
+ Requires-Dist: starlette>=0.40.0
224
+ Requires-Dist: fastapi>=0.115.2
225
+ Requires-Dist: cachetools>=5.0.0
226
+ Provides-Extra: dev
227
+ Requires-Dist: pytest>=7.0; extra == "dev"
228
+ Requires-Dist: pytest-cov>=4.0; extra == "dev"
229
+ Requires-Dist: black>=22.0; extra == "dev"
230
+ Requires-Dist: flake8>=5.0; extra == "dev"
231
+ Requires-Dist: mypy>=1.0; extra == "dev"
232
+ Requires-Dist: pre-commit>=3.0; extra == "dev"
233
+ Requires-Dist: twine>=4.0; extra == "dev"
234
+ Requires-Dist: build>=0.10; extra == "dev"
235
+ Provides-Extra: ai
236
+ Requires-Dist: openai>=1.60.0; extra == "ai"
237
+ Requires-Dist: sentence-transformers>=2.2.0; extra == "ai"
238
+ Provides-Extra: llm
239
+ Requires-Dist: openai>=1.60.0; extra == "llm"
240
+ Requires-Dist: anthropic>=0.54.0; extra == "llm"
241
+ Requires-Dist: google-generativeai>=0.3.0; extra == "llm"
242
+ Requires-Dist: cohere>=4.0.0; extra == "llm"
243
+ Requires-Dist: boto3>=1.26.0; extra == "llm"
244
+ Requires-Dist: together>=0.2.0; extra == "llm"
245
+ Requires-Dist: replicate>=0.15.0; extra == "llm"
246
+ Provides-Extra: local
247
+ Requires-Dist: transformers>=4.21.0; extra == "local"
248
+ Requires-Dist: torch>=1.12.0; extra == "local"
249
+ Requires-Dist: sentence-transformers>=2.2.0; extra == "local"
250
+ Provides-Extra: database
251
+ Requires-Dist: psycopg2-binary>=2.9.9; extra == "database"
252
+ Provides-Extra: all
253
+ Requires-Dist: openai>=1.0.0; extra == "all"
254
+ Requires-Dist: sentence-transformers>=2.2.0; extra == "all"
255
+ Requires-Dist: anthropic>=0.7.0; extra == "all"
256
+ Requires-Dist: google-generativeai>=0.3.0; extra == "all"
257
+ Requires-Dist: cohere>=4.0.0; extra == "all"
258
+ Requires-Dist: boto3>=1.26.0; extra == "all"
259
+ Requires-Dist: together>=0.2.0; extra == "all"
260
+ Requires-Dist: replicate>=0.15.0; extra == "all"
261
+ Requires-Dist: transformers>=4.21.0; extra == "all"
262
+ Requires-Dist: torch>=1.12.0; extra == "all"
263
+ Requires-Dist: psycopg2-binary>=2.9.9; extra == "all"
264
+
265
+ <div align="center">
266
+
267
+ ![MemU Banner](assets/banner.png)
268
+
269
+ <h3>memU: The Next-Gen Memory Framework for AI Companions</h3>
270
+
271
+ [![PyPI version](https://badge.fury.io/py/memu.svg)](https://badge.fury.io/py/memu)
272
+ [![License: Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
273
+ [![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)
274
+ [![Discord](https://img.shields.io/badge/Discord-Join%20Chat-5865F2?logo=discord&logoColor=white)](https://discord.gg/hQZntfGsbJ)
275
+ [![Twitter](https://img.shields.io/badge/Twitter-Follow-1DA1F2?logo=x&logoColor=white)](https://x.com/Nevamind_ai)
276
+ [![Reddit](https://img.shields.io/badge/Reddit-Join%20Community-FF4500?logo=reddit&logoColor=white)](https://reddit.com/r/MemU)
277
+ [![WeChat](https://img.shields.io/badge/WeChat-微信群-07C160?logo=wechat&logoColor=white)](#)
278
+ </div>
279
+
280
+ **MemU** is an open-source memory framework for AI companions—high accuracy, fast retrieval, low cost. It acts as an intelligent "memory folder" that adapts to different scenarios, from different companions senarios.
281
+
282
+ With **memU**, you can build AI companions that truly remember you. They learn who you are, what you care about, and grow alongside you through every interaction.
283
+
284
+ ### 🥇 92.9% Accuracy - 💰 90% Cost Reduction - 🤖 AI Companion Specialized
285
+ - ✅ **AI Companion Specialization** - Adapt to AI companions application
286
+ - ✅ **92.9% Accuracy** - State-of-the-art score in Locomo benchmark
287
+ - ✅ **Up to 70% Cost Reduction** - Through optimized infrastructure
288
+ - ✅ **Advanced Retrieval Strategies** - Multiple methods including semantic search, hybrid search, contextual retrieval
289
+ - ✅ **24/7 Support** - For enterprise customers
290
+
291
+ ---
292
+
293
+ ## ⭐ Star Us on GitHub
294
+
295
+ ![star-us](./assets/star.gif)
296
+
297
+ **🚀 Join 1,000+ developers building the future of AI memory**
298
+
299
+ Star MemU to get notified about new releases and join our growing community of AI developers building intelligent agents with persistent memory capabilities.
300
+
301
+ **💬 Join our Discord community:** [https://discord.gg/hQZntfGsbJ](https://discord.gg/hQZntfGsbJ)
302
+
303
+ ---
304
+
305
+ ## 🚀Get Started
306
+
307
+ There are three ways to get started with MemU:
308
+
309
+ ### ☁️ Cloud Version ([Online Platform](https://memu.so))
310
+
311
+ The fastest way to integrate your application with memU. Perfect for teams and individuals who want immediate access without setup complexity. We host the models, APIs, and cloud storage, ensuring your application gets the best quality AI memory.
312
+
313
+ - **Instant Access** - Start integrating AI memories in minutes
314
+ - **Managed Infrastructure** - We handle scaling, updates, and maintenance for optimal memory quality
315
+ - **Premium Support** - Subscribe and get priority assistance from our engineering team
316
+
317
+ #### Step-by-step
318
+
319
+ **Step 1:** Create account & get your API key
320
+
321
+ **Step 2:** Add three lines to your code
322
+ ```python
323
+ pip install memu-py
324
+
325
+ # Example usage
326
+ from memu.memory import MemoryAgent
327
+ from memu.llm import OpenAIClient
328
+
329
+ memory_agent = MemoryAgent()
330
+ ```
331
+
332
+
333
+ ### 🏢 Enterprise Edition
334
+
335
+ For organizations requiring maximum security, customization, control and best quality:
336
+
337
+ - **Commercial License** - Full proprietary features, commercial usage rights, white-labeling options
338
+ - **Custom Development** - SSO/RBAC integration, dedicated algorithm team for scenario-specific framework optimization
339
+ - **Intelligence & Analytics** - User behavior analysis, real-time production monitoring, automated agent optimization
340
+ - **Premium Support** - 24/7 dedicated support, custom SLAs, professional implementation services
341
+
342
+ 📧 **Enterprise Inquiries:** [contact@nevamind.ai](mailto:contact@nevamind.ai)
343
+
344
+
345
+ ### 🏠 Self-Hosting (Community Edition)
346
+ For users and developers who prefer local control, data privacy, or customization:
347
+
348
+ * **Data Privacy** - Keep sensitive data within your infrastructure
349
+ * **Customization** - Modify and extend the platform to fit your needs
350
+ * **Cost Control** - Avoid recurring cloud fees for large-scale deployments
351
+
352
+ 🚀 **Coming Soon!**
353
+
354
+
355
+
356
+ ---
357
+
358
+
359
+ ## ✨ Key Features
360
+
361
+ ### Autonomous Memory Management System
362
+
363
+ ![features](./assets/workflow.png)
364
+
365
+ ### **Organize** - Autonomous Memory Management
366
+ Your memories are structured as intelligent folders managed by a dedicated memory agent. We do not do explicit modeling for memories. The memory agent automatically decides what to record, modify, or archive based on relevance and usage patterns. Think of it as having a personal librarian who knows exactly how to organize your thoughts.
367
+
368
+ ### **Link** - Interconnected Knowledge Graph
369
+ Memories don't exist in isolation. Our system automatically creates meaningful connections between related memories, building a rich network of hyperlinked documents. As your knowledge base grows, so does the web of relationships, making information discovery intuitive and contextual.
370
+
371
+ ### **Evolve** - Continuous Self-Improvement
372
+ Even when offline, your memory system keeps working. It generates new insights by analyzing existing memories, identifies patterns, and creates summary documents through self-reflection. Your knowledge base becomes smarter over time, not just larger.
373
+
374
+ ### **Never Forget** - Intelligent Retention System
375
+ We've revolutionized memory persistence with a dynamic importance algorithm. Recently referenced memories gain higher priority, ensuring that what matters most to you now stays readily accessible. The system adapts to your changing needs, keeping relevant information at your fingertips while gracefully archiving what's no longer critical.
376
+
377
+ ---
378
+
379
+ ## 🤫 Advantages
380
+
381
+ ### Higher Memory Accuracy
382
+ MemU achieves 92.09% average accuracy across all reasoning tasks, significantly outperforming competitors. Techical Report will be published soon!
383
+
384
+ ![Memory Accuracy Comparison](assets/benchmark.png)
385
+
386
+ ### Flexible Retrieval Strategies
387
+
388
+ MemU provides a comprehensive suite of retrieval strategies, allowing you to choose the optimal approach for your specific scenario. From semantic similarity to category search, our flexible system adapts to your needs.
389
+
390
+ ### Human-Readable & Analyzable Memory Architecture
391
+
392
+ Unlike other memory frameworks that store information as fragmented sentences, MemU organizes memories as coherent, readable documents while simultaneously transforming raw data into structured, analyzable datasets. While competitors break down information into scattered fragments, MemU maintains complete context and relationships, enabling easy debugging, manual editing, seamless analytics, and effortless integration with existing workflows.
393
+
394
+
395
+
396
+ ---
397
+ ## 📚 Usage Guide & Research Highlights
398
+
399
+ ![Use Cases Demo](assets/use-cases-demo.gif)
400
+
401
+ ### 🎓 **Use Cases**
402
+ | Use Case | Description |
403
+ |:--------:|:------------|
404
+ | ![AI Companion](assets/ai_companion.gif) | **AI Companion** |
405
+ | ![AI Role Play](assets/ai_role_play.gif) | **AI Role Play**|
406
+ | ![AI Education](assets/ai_edu.gif) | **AI Education** |
407
+ | ![AI Therapy](assets/ai_therapy.gif) | **AI Therapy**|
408
+ | ![AI Robot](assets/ai_robot.gif) | **AI Robot** |
409
+ | ![AI Creation](assets/ai_creation.gif) | **AI Creation**|
410
+
411
+ ---
412
+
413
+ ## 🤝 Contributing
414
+
415
+ We build trust through open-source collaboration. Your creative contributions drive memU's innovation forward. Explore our GitHub issues and projects to get started and make your mark on the future of memU.
416
+
417
+ 📋 **[Read our detailed Contributing Guide →](CONTRIBUTING.md)**
418
+
419
+
420
+ ### **📄 License**
421
+
422
+ By contributing to MemU, you agree that your contributions will be licensed under the **Apache License 2.0**.
423
+
424
+ ---
425
+
426
+ ## 🌍 Community
427
+ For more information please contact info@nevamind.ai
428
+
429
+ - **GitHub Issues:** Report bugs, request features, and track development. [Submit an issue]()
430
+
431
+ - **Discord:** Get real-time support, chat with the community, and stay updated. [Join us](https://discord.camel-ai.org/)
432
+
433
+ - **X (Twitter):** Follow for updates, AI insights, and key announcements. [Follow us]()
434
+
435
+
436
+