mem-llm 1.0.6__py3-none-any.whl → 1.0.7__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 mem-llm might be problematic. Click here for more details.
- mem_llm/__init__.py +1 -1
- mem_llm/memory_manager.py +50 -0
- {mem_llm-1.0.6.dist-info → mem_llm-1.0.7.dist-info}/METADATA +1 -1
- {mem_llm-1.0.6.dist-info → mem_llm-1.0.7.dist-info}/RECORD +6 -6
- {mem_llm-1.0.6.dist-info → mem_llm-1.0.7.dist-info}/WHEEL +0 -0
- {mem_llm-1.0.6.dist-info → mem_llm-1.0.7.dist-info}/top_level.txt +0 -0
mem_llm/__init__.py
CHANGED
mem_llm/memory_manager.py
CHANGED
|
@@ -259,4 +259,54 @@ class MemoryManager:
|
|
|
259
259
|
self.load_memory(user_id)
|
|
260
260
|
|
|
261
261
|
return self.user_profiles.get(user_id)
|
|
262
|
+
|
|
263
|
+
def update_user_profile(self, user_id: str, updates: Dict) -> None:
|
|
264
|
+
"""
|
|
265
|
+
Update user profile (SQL-compatible alias)
|
|
266
|
+
|
|
267
|
+
Args:
|
|
268
|
+
user_id: User ID
|
|
269
|
+
updates: Fields to update
|
|
270
|
+
"""
|
|
271
|
+
return self.update_profile(user_id, updates)
|
|
272
|
+
|
|
273
|
+
def add_user(self, user_id: str, name: Optional[str] = None, metadata: Optional[Dict] = None) -> None:
|
|
274
|
+
"""
|
|
275
|
+
Add or update user (SQL-compatible method)
|
|
276
|
+
|
|
277
|
+
Args:
|
|
278
|
+
user_id: User ID
|
|
279
|
+
name: User name (optional)
|
|
280
|
+
metadata: Additional metadata (optional)
|
|
281
|
+
"""
|
|
282
|
+
self.load_memory(user_id)
|
|
283
|
+
if name and 'name' not in self.user_profiles[user_id]:
|
|
284
|
+
self.user_profiles[user_id]['name'] = name
|
|
285
|
+
if metadata:
|
|
286
|
+
self.user_profiles[user_id].update(metadata)
|
|
287
|
+
self.save_memory(user_id)
|
|
288
|
+
|
|
289
|
+
def get_statistics(self) -> Dict:
|
|
290
|
+
"""
|
|
291
|
+
Get general statistics (SQL-compatible method)
|
|
292
|
+
|
|
293
|
+
Returns:
|
|
294
|
+
Statistics dictionary
|
|
295
|
+
"""
|
|
296
|
+
all_users = list(self.memory_dir.glob("*.json"))
|
|
297
|
+
total_interactions = 0
|
|
298
|
+
|
|
299
|
+
for user_file in all_users:
|
|
300
|
+
try:
|
|
301
|
+
with open(user_file, 'r', encoding='utf-8') as f:
|
|
302
|
+
data = json.load(f)
|
|
303
|
+
total_interactions += len(data.get('conversations', []))
|
|
304
|
+
except:
|
|
305
|
+
pass
|
|
306
|
+
|
|
307
|
+
return {
|
|
308
|
+
'total_users': len(all_users),
|
|
309
|
+
'total_interactions': total_interactions,
|
|
310
|
+
'knowledge_base_entries': 0 # JSON doesn't have KB
|
|
311
|
+
}
|
|
262
312
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
mem_llm/__init__.py,sha256=
|
|
1
|
+
mem_llm/__init__.py,sha256=K-nIQ-BtTJzDhgseulljOKMPXuQZS563ffED4brYFm4,920
|
|
2
2
|
mem_llm/config.yaml.example,sha256=lgmfaU5pxnIm4zYxwgCcgLSohNx1Jw6oh3Qk0Xoe2DE,917
|
|
3
3
|
mem_llm/config_from_docs.py,sha256=YFhq1SWyK63C-TNMS73ncNHg8sJ-XGOf2idWVCjxFco,4974
|
|
4
4
|
mem_llm/config_manager.py,sha256=8PIHs21jZWlI-eG9DgekjOvNxU3-U4xH7SbT8Gr-Z6M,7075
|
|
@@ -6,10 +6,10 @@ mem_llm/knowledge_loader.py,sha256=oSNhfYYcx7DlZLVogxnbSwaIydq_Q3__RDJFeZR2XVw,2
|
|
|
6
6
|
mem_llm/llm_client.py,sha256=XW-LALYV4C-Nj2R8XYT2iT2YnTeH6_tUIldMKooY2uY,5461
|
|
7
7
|
mem_llm/mem_agent.py,sha256=kJwlZYRIE6OI06ZG-mtQKzz1_zkjs1ss_DYr4DiaHUw,27140
|
|
8
8
|
mem_llm/memory_db.py,sha256=UzkMOw_p7svg6d4ZgpBWdPKoILWrJ2hAQSPHvAG_f4M,13563
|
|
9
|
-
mem_llm/memory_manager.py,sha256=
|
|
9
|
+
mem_llm/memory_manager.py,sha256=CZI3A8pFboHQIgeiXB1h2gZK7mgfbVSU3IxuqE-zXtc,9978
|
|
10
10
|
mem_llm/memory_tools.py,sha256=ARANFqu_bmL56SlV1RzTjfQsJj-Qe2QvqY0pF92hDxU,8678
|
|
11
11
|
mem_llm/prompt_templates.py,sha256=tCiQJw3QQKIaH8NsxEKOIaIVxw4XT43PwdmyfCINzzM,6536
|
|
12
|
-
mem_llm-1.0.
|
|
13
|
-
mem_llm-1.0.
|
|
14
|
-
mem_llm-1.0.
|
|
15
|
-
mem_llm-1.0.
|
|
12
|
+
mem_llm-1.0.7.dist-info/METADATA,sha256=K2paX5fYmv3U7BNrBbqYI3D6gwfvszaS1HyJJuIJo88,6505
|
|
13
|
+
mem_llm-1.0.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
14
|
+
mem_llm-1.0.7.dist-info/top_level.txt,sha256=_fU1ML-0JwkaxWdhqpwtmTNaJEOvDMQeJdA8d5WqDn8,8
|
|
15
|
+
mem_llm-1.0.7.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|