powermem 0.1.0__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.
- powermem/__init__.py +103 -0
- powermem/agent/__init__.py +35 -0
- powermem/agent/abstract/__init__.py +22 -0
- powermem/agent/abstract/collaboration.py +259 -0
- powermem/agent/abstract/context.py +187 -0
- powermem/agent/abstract/manager.py +232 -0
- powermem/agent/abstract/permission.py +217 -0
- powermem/agent/abstract/privacy.py +267 -0
- powermem/agent/abstract/scope.py +199 -0
- powermem/agent/agent.py +791 -0
- powermem/agent/components/__init__.py +18 -0
- powermem/agent/components/collaboration_coordinator.py +645 -0
- powermem/agent/components/permission_controller.py +586 -0
- powermem/agent/components/privacy_protector.py +767 -0
- powermem/agent/components/scope_controller.py +685 -0
- powermem/agent/factories/__init__.py +16 -0
- powermem/agent/factories/agent_factory.py +266 -0
- powermem/agent/factories/config_factory.py +308 -0
- powermem/agent/factories/memory_factory.py +229 -0
- powermem/agent/implementations/__init__.py +16 -0
- powermem/agent/implementations/hybrid.py +728 -0
- powermem/agent/implementations/multi_agent.py +1040 -0
- powermem/agent/implementations/multi_user.py +1020 -0
- powermem/agent/types.py +53 -0
- powermem/agent/wrappers/__init__.py +14 -0
- powermem/agent/wrappers/agent_memory_wrapper.py +427 -0
- powermem/agent/wrappers/compatibility_wrapper.py +520 -0
- powermem/config_loader.py +318 -0
- powermem/configs.py +249 -0
- powermem/core/__init__.py +19 -0
- powermem/core/async_memory.py +1493 -0
- powermem/core/audit.py +258 -0
- powermem/core/base.py +165 -0
- powermem/core/memory.py +1567 -0
- powermem/core/setup.py +162 -0
- powermem/core/telemetry.py +215 -0
- powermem/integrations/__init__.py +17 -0
- powermem/integrations/embeddings/__init__.py +13 -0
- powermem/integrations/embeddings/aws_bedrock.py +100 -0
- powermem/integrations/embeddings/azure_openai.py +55 -0
- powermem/integrations/embeddings/base.py +31 -0
- powermem/integrations/embeddings/config/base.py +132 -0
- powermem/integrations/embeddings/configs.py +31 -0
- powermem/integrations/embeddings/factory.py +48 -0
- powermem/integrations/embeddings/gemini.py +39 -0
- powermem/integrations/embeddings/huggingface.py +41 -0
- powermem/integrations/embeddings/langchain.py +35 -0
- powermem/integrations/embeddings/lmstudio.py +29 -0
- powermem/integrations/embeddings/mock.py +11 -0
- powermem/integrations/embeddings/ollama.py +53 -0
- powermem/integrations/embeddings/openai.py +49 -0
- powermem/integrations/embeddings/qwen.py +102 -0
- powermem/integrations/embeddings/together.py +31 -0
- powermem/integrations/embeddings/vertexai.py +54 -0
- powermem/integrations/llm/__init__.py +18 -0
- powermem/integrations/llm/anthropic.py +87 -0
- powermem/integrations/llm/base.py +132 -0
- powermem/integrations/llm/config/anthropic.py +56 -0
- powermem/integrations/llm/config/azure.py +56 -0
- powermem/integrations/llm/config/base.py +62 -0
- powermem/integrations/llm/config/deepseek.py +56 -0
- powermem/integrations/llm/config/ollama.py +56 -0
- powermem/integrations/llm/config/openai.py +79 -0
- powermem/integrations/llm/config/qwen.py +68 -0
- powermem/integrations/llm/config/qwen_asr.py +46 -0
- powermem/integrations/llm/config/vllm.py +56 -0
- powermem/integrations/llm/configs.py +26 -0
- powermem/integrations/llm/deepseek.py +106 -0
- powermem/integrations/llm/factory.py +118 -0
- powermem/integrations/llm/gemini.py +201 -0
- powermem/integrations/llm/langchain.py +65 -0
- powermem/integrations/llm/ollama.py +106 -0
- powermem/integrations/llm/openai.py +166 -0
- powermem/integrations/llm/openai_structured.py +80 -0
- powermem/integrations/llm/qwen.py +207 -0
- powermem/integrations/llm/qwen_asr.py +171 -0
- powermem/integrations/llm/vllm.py +106 -0
- powermem/integrations/rerank/__init__.py +20 -0
- powermem/integrations/rerank/base.py +43 -0
- powermem/integrations/rerank/config/__init__.py +7 -0
- powermem/integrations/rerank/config/base.py +27 -0
- powermem/integrations/rerank/configs.py +23 -0
- powermem/integrations/rerank/factory.py +68 -0
- powermem/integrations/rerank/qwen.py +159 -0
- powermem/intelligence/__init__.py +17 -0
- powermem/intelligence/ebbinghaus_algorithm.py +354 -0
- powermem/intelligence/importance_evaluator.py +361 -0
- powermem/intelligence/intelligent_memory_manager.py +284 -0
- powermem/intelligence/manager.py +148 -0
- powermem/intelligence/plugin.py +229 -0
- powermem/prompts/__init__.py +29 -0
- powermem/prompts/graph/graph_prompts.py +217 -0
- powermem/prompts/graph/graph_tools_prompts.py +469 -0
- powermem/prompts/importance_evaluation.py +246 -0
- powermem/prompts/intelligent_memory_prompts.py +163 -0
- powermem/prompts/templates.py +193 -0
- powermem/storage/__init__.py +14 -0
- powermem/storage/adapter.py +896 -0
- powermem/storage/base.py +109 -0
- powermem/storage/config/base.py +13 -0
- powermem/storage/config/oceanbase.py +58 -0
- powermem/storage/config/pgvector.py +52 -0
- powermem/storage/config/sqlite.py +27 -0
- powermem/storage/configs.py +159 -0
- powermem/storage/factory.py +59 -0
- powermem/storage/migration_manager.py +438 -0
- powermem/storage/oceanbase/__init__.py +8 -0
- powermem/storage/oceanbase/constants.py +162 -0
- powermem/storage/oceanbase/oceanbase.py +1384 -0
- powermem/storage/oceanbase/oceanbase_graph.py +1441 -0
- powermem/storage/pgvector/__init__.py +7 -0
- powermem/storage/pgvector/pgvector.py +420 -0
- powermem/storage/sqlite/__init__.py +0 -0
- powermem/storage/sqlite/sqlite.py +218 -0
- powermem/storage/sqlite/sqlite_vector_store.py +311 -0
- powermem/utils/__init__.py +35 -0
- powermem/utils/utils.py +605 -0
- powermem/version.py +23 -0
- powermem-0.1.0.dist-info/METADATA +187 -0
- powermem-0.1.0.dist-info/RECORD +123 -0
- powermem-0.1.0.dist-info/WHEEL +5 -0
- powermem-0.1.0.dist-info/licenses/LICENSE +206 -0
- powermem-0.1.0.dist-info/top_level.txt +1 -0
powermem/core/audit.py
ADDED
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Audit logging for memory operations
|
|
3
|
+
|
|
4
|
+
This module handles audit logging for compliance and security.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
import logging
|
|
8
|
+
import json
|
|
9
|
+
from typing import Any, Dict, Optional
|
|
10
|
+
from datetime import datetime
|
|
11
|
+
import os
|
|
12
|
+
|
|
13
|
+
logger = logging.getLogger(__name__)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class AuditLogger:
|
|
17
|
+
"""
|
|
18
|
+
Manages audit logging for memory operations.
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
def __init__(self, config: Optional[Dict[str, Any]] = None):
|
|
22
|
+
"""
|
|
23
|
+
Initialize audit logger.
|
|
24
|
+
|
|
25
|
+
Args:
|
|
26
|
+
config: Configuration dictionary
|
|
27
|
+
"""
|
|
28
|
+
self.config = config or {}
|
|
29
|
+
self.enabled = self.config.get("enable_audit", True)
|
|
30
|
+
self.log_file = self.config.get("audit_log_file", "audit.log")
|
|
31
|
+
self.log_level = self.config.get("audit_log_level", "INFO")
|
|
32
|
+
self.retention_days = self.config.get("audit_retention_days", 90)
|
|
33
|
+
|
|
34
|
+
# Setup audit logger
|
|
35
|
+
self.audit_logger = logging.getLogger("audit")
|
|
36
|
+
self.audit_logger.setLevel(getattr(logging, self.log_level.upper()))
|
|
37
|
+
|
|
38
|
+
# Create file handler if not exists
|
|
39
|
+
if not self.audit_logger.handlers:
|
|
40
|
+
handler = logging.FileHandler(self.log_file)
|
|
41
|
+
formatter = logging.Formatter(
|
|
42
|
+
'%(asctime)s - %(name)s - %(levelname)s - %(message)s'
|
|
43
|
+
)
|
|
44
|
+
handler.setFormatter(formatter)
|
|
45
|
+
self.audit_logger.addHandler(handler)
|
|
46
|
+
|
|
47
|
+
logger.info(f"AuditLogger initialized - enabled: {self.enabled}, log_file: {self.log_file}")
|
|
48
|
+
|
|
49
|
+
def log_event(
|
|
50
|
+
self,
|
|
51
|
+
event_type: str,
|
|
52
|
+
details: Dict[str, Any],
|
|
53
|
+
user_id: Optional[str] = None,
|
|
54
|
+
agent_id: Optional[str] = None,
|
|
55
|
+
) -> None:
|
|
56
|
+
"""
|
|
57
|
+
Log an audit event.
|
|
58
|
+
|
|
59
|
+
Args:
|
|
60
|
+
event_type: Type of event (e.g., 'memory.add', 'memory.delete')
|
|
61
|
+
details: Event details
|
|
62
|
+
user_id: User ID associated with the event
|
|
63
|
+
agent_id: Agent ID associated with the event
|
|
64
|
+
"""
|
|
65
|
+
if not self.enabled:
|
|
66
|
+
return
|
|
67
|
+
|
|
68
|
+
try:
|
|
69
|
+
audit_entry = {
|
|
70
|
+
"timestamp": datetime.utcnow().isoformat(),
|
|
71
|
+
"event_type": event_type,
|
|
72
|
+
"user_id": user_id,
|
|
73
|
+
"agent_id": agent_id,
|
|
74
|
+
"details": details,
|
|
75
|
+
"version": "0.1.0",
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
# Log to file
|
|
79
|
+
self.audit_logger.info(json.dumps(audit_entry))
|
|
80
|
+
|
|
81
|
+
# Also log to console in debug mode
|
|
82
|
+
if self.config.get("debug", False):
|
|
83
|
+
logger.debug(f"Audit event: {event_type} - {details}")
|
|
84
|
+
|
|
85
|
+
except Exception as e:
|
|
86
|
+
logger.error(f"Failed to log audit event: {e}")
|
|
87
|
+
|
|
88
|
+
async def log_event_async(
|
|
89
|
+
self,
|
|
90
|
+
event_type: str,
|
|
91
|
+
details: Dict[str, Any],
|
|
92
|
+
user_id: Optional[str] = None,
|
|
93
|
+
agent_id: Optional[str] = None,
|
|
94
|
+
) -> None:
|
|
95
|
+
"""
|
|
96
|
+
Log an audit event asynchronously.
|
|
97
|
+
|
|
98
|
+
Args:
|
|
99
|
+
event_type: Type of event
|
|
100
|
+
details: Event details
|
|
101
|
+
user_id: User ID associated with the event
|
|
102
|
+
agent_id: Agent ID associated with the event
|
|
103
|
+
"""
|
|
104
|
+
# For now, just call the sync version
|
|
105
|
+
# In a real implementation, this would use async file I/O
|
|
106
|
+
self.log_event(event_type, details, user_id, agent_id)
|
|
107
|
+
|
|
108
|
+
def log_access(
|
|
109
|
+
self,
|
|
110
|
+
resource_type: str,
|
|
111
|
+
resource_id: str,
|
|
112
|
+
action: str,
|
|
113
|
+
user_id: Optional[str] = None,
|
|
114
|
+
agent_id: Optional[str] = None,
|
|
115
|
+
success: bool = True,
|
|
116
|
+
) -> None:
|
|
117
|
+
"""
|
|
118
|
+
Log access to resources.
|
|
119
|
+
|
|
120
|
+
Args:
|
|
121
|
+
resource_type: Type of resource (e.g., 'memory', 'user')
|
|
122
|
+
resource_id: ID of the resource
|
|
123
|
+
action: Action performed (e.g., 'read', 'write', 'delete')
|
|
124
|
+
user_id: User ID
|
|
125
|
+
agent_id: Agent ID
|
|
126
|
+
success: Whether the action was successful
|
|
127
|
+
"""
|
|
128
|
+
self.log_event(
|
|
129
|
+
"access",
|
|
130
|
+
{
|
|
131
|
+
"resource_type": resource_type,
|
|
132
|
+
"resource_id": resource_id,
|
|
133
|
+
"action": action,
|
|
134
|
+
"success": success,
|
|
135
|
+
},
|
|
136
|
+
user_id=user_id,
|
|
137
|
+
agent_id=agent_id,
|
|
138
|
+
)
|
|
139
|
+
|
|
140
|
+
def log_security_event(
|
|
141
|
+
self,
|
|
142
|
+
event_type: str,
|
|
143
|
+
severity: str,
|
|
144
|
+
details: Dict[str, Any],
|
|
145
|
+
user_id: Optional[str] = None,
|
|
146
|
+
agent_id: Optional[str] = None,
|
|
147
|
+
) -> None:
|
|
148
|
+
"""
|
|
149
|
+
Log security-related events.
|
|
150
|
+
|
|
151
|
+
Args:
|
|
152
|
+
event_type: Type of security event
|
|
153
|
+
severity: Severity level (low, medium, high, critical)
|
|
154
|
+
details: Event details
|
|
155
|
+
user_id: User ID
|
|
156
|
+
agent_id: Agent ID
|
|
157
|
+
"""
|
|
158
|
+
self.log_event(
|
|
159
|
+
"security",
|
|
160
|
+
{
|
|
161
|
+
"event_type": event_type,
|
|
162
|
+
"severity": severity,
|
|
163
|
+
"details": details,
|
|
164
|
+
},
|
|
165
|
+
user_id=user_id,
|
|
166
|
+
agent_id=agent_id,
|
|
167
|
+
)
|
|
168
|
+
|
|
169
|
+
def log_data_change(
|
|
170
|
+
self,
|
|
171
|
+
change_type: str,
|
|
172
|
+
resource_id: str,
|
|
173
|
+
old_data: Optional[Dict[str, Any]] = None,
|
|
174
|
+
new_data: Optional[Dict[str, Any]] = None,
|
|
175
|
+
user_id: Optional[str] = None,
|
|
176
|
+
agent_id: Optional[str] = None,
|
|
177
|
+
) -> None:
|
|
178
|
+
"""
|
|
179
|
+
Log data changes for compliance.
|
|
180
|
+
|
|
181
|
+
Args:
|
|
182
|
+
change_type: Type of change (create, update, delete)
|
|
183
|
+
resource_id: ID of the resource
|
|
184
|
+
old_data: Previous data (for updates/deletes)
|
|
185
|
+
new_data: New data (for creates/updates)
|
|
186
|
+
user_id: User ID
|
|
187
|
+
agent_id: Agent ID
|
|
188
|
+
"""
|
|
189
|
+
self.log_event(
|
|
190
|
+
"data_change",
|
|
191
|
+
{
|
|
192
|
+
"change_type": change_type,
|
|
193
|
+
"resource_id": resource_id,
|
|
194
|
+
"old_data": old_data,
|
|
195
|
+
"new_data": new_data,
|
|
196
|
+
},
|
|
197
|
+
user_id=user_id,
|
|
198
|
+
agent_id=agent_id,
|
|
199
|
+
)
|
|
200
|
+
|
|
201
|
+
def get_audit_logs(
|
|
202
|
+
self,
|
|
203
|
+
start_date: Optional[datetime] = None,
|
|
204
|
+
end_date: Optional[datetime] = None,
|
|
205
|
+
user_id: Optional[str] = None,
|
|
206
|
+
agent_id: Optional[str] = None,
|
|
207
|
+
event_type: Optional[str] = None,
|
|
208
|
+
limit: int = 1000,
|
|
209
|
+
) -> list:
|
|
210
|
+
"""
|
|
211
|
+
Retrieve audit logs with filtering.
|
|
212
|
+
|
|
213
|
+
Args:
|
|
214
|
+
start_date: Start date for filtering
|
|
215
|
+
end_date: End date for filtering
|
|
216
|
+
user_id: Filter by user ID
|
|
217
|
+
agent_id: Filter by agent ID
|
|
218
|
+
event_type: Filter by event type
|
|
219
|
+
limit: Maximum number of logs to return
|
|
220
|
+
|
|
221
|
+
Returns:
|
|
222
|
+
List of audit log entries
|
|
223
|
+
"""
|
|
224
|
+
# This is a simplified implementation
|
|
225
|
+
# In a real system, you would query a proper audit database
|
|
226
|
+
logs = []
|
|
227
|
+
|
|
228
|
+
try:
|
|
229
|
+
if os.path.exists(self.log_file):
|
|
230
|
+
with open(self.log_file, 'r') as f:
|
|
231
|
+
for line in f:
|
|
232
|
+
try:
|
|
233
|
+
log_entry = json.loads(line.strip())
|
|
234
|
+
|
|
235
|
+
# Apply filters
|
|
236
|
+
if start_date and log_entry['timestamp'] < start_date.isoformat():
|
|
237
|
+
continue
|
|
238
|
+
if end_date and log_entry['timestamp'] > end_date.isoformat():
|
|
239
|
+
continue
|
|
240
|
+
if user_id and log_entry.get('user_id') != user_id:
|
|
241
|
+
continue
|
|
242
|
+
if agent_id and log_entry.get('agent_id') != agent_id:
|
|
243
|
+
continue
|
|
244
|
+
if event_type and log_entry.get('event_type') != event_type:
|
|
245
|
+
continue
|
|
246
|
+
|
|
247
|
+
logs.append(log_entry)
|
|
248
|
+
|
|
249
|
+
if len(logs) >= limit:
|
|
250
|
+
break
|
|
251
|
+
|
|
252
|
+
except json.JSONDecodeError:
|
|
253
|
+
continue
|
|
254
|
+
|
|
255
|
+
except Exception as e:
|
|
256
|
+
logger.error(f"Failed to retrieve audit logs: {e}")
|
|
257
|
+
|
|
258
|
+
return logs
|
powermem/core/base.py
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Abstract base class for memory management
|
|
3
|
+
|
|
4
|
+
This module defines the core interface that all memory implementations must follow.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from abc import ABC, abstractmethod
|
|
8
|
+
from typing import Any, Dict, List, Optional, Union
|
|
9
|
+
from datetime import datetime
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class MemoryBase(ABC):
|
|
13
|
+
"""
|
|
14
|
+
Abstract base class for memory management.
|
|
15
|
+
|
|
16
|
+
This class defines the core interface that all memory implementations must implement.
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
@abstractmethod
|
|
20
|
+
def add(
|
|
21
|
+
self,
|
|
22
|
+
content: str,
|
|
23
|
+
user_id: Optional[str] = None,
|
|
24
|
+
agent_id: Optional[str] = None,
|
|
25
|
+
run_id: Optional[str] = None,
|
|
26
|
+
metadata: Optional[Dict[str, Any]] = None,
|
|
27
|
+
filters: Optional[Dict[str, Any]] = None,
|
|
28
|
+
) -> Dict[str, Any]:
|
|
29
|
+
"""
|
|
30
|
+
Add a new memory.
|
|
31
|
+
|
|
32
|
+
Args:
|
|
33
|
+
content: The memory content to store
|
|
34
|
+
user_id: ID of the user creating the memory
|
|
35
|
+
agent_id: ID of the agent creating the memory
|
|
36
|
+
run_id: ID of the run/session
|
|
37
|
+
metadata: Additional metadata for the memory
|
|
38
|
+
filters: Additional filters for the memory
|
|
39
|
+
|
|
40
|
+
Returns:
|
|
41
|
+
Dictionary containing the added memory information
|
|
42
|
+
"""
|
|
43
|
+
pass
|
|
44
|
+
|
|
45
|
+
@abstractmethod
|
|
46
|
+
def search(
|
|
47
|
+
self,
|
|
48
|
+
query: str,
|
|
49
|
+
user_id: Optional[str] = None,
|
|
50
|
+
agent_id: Optional[str] = None,
|
|
51
|
+
run_id: Optional[str] = None,
|
|
52
|
+
filters: Optional[Dict[str, Any]] = None,
|
|
53
|
+
limit: int = 30,
|
|
54
|
+
) -> Dict[str, Any]:
|
|
55
|
+
"""
|
|
56
|
+
Search for memories.
|
|
57
|
+
|
|
58
|
+
Args:
|
|
59
|
+
query: Search query
|
|
60
|
+
user_id: Filter by user ID
|
|
61
|
+
agent_id: Filter by agent ID
|
|
62
|
+
run_id: Filter by run ID
|
|
63
|
+
filters: Additional filters
|
|
64
|
+
limit: Maximum number of results
|
|
65
|
+
|
|
66
|
+
Returns:
|
|
67
|
+
Dictionary containing search results in format: {"results": [...]}
|
|
68
|
+
"""
|
|
69
|
+
pass
|
|
70
|
+
|
|
71
|
+
@abstractmethod
|
|
72
|
+
def get(
|
|
73
|
+
self,
|
|
74
|
+
memory_id: int,
|
|
75
|
+
user_id: Optional[str] = None,
|
|
76
|
+
agent_id: Optional[str] = None,
|
|
77
|
+
) -> Optional[Dict[str, Any]]:
|
|
78
|
+
"""
|
|
79
|
+
Get a specific memory by ID.
|
|
80
|
+
|
|
81
|
+
Args:
|
|
82
|
+
memory_id: ID of the memory to retrieve
|
|
83
|
+
user_id: User ID for access control
|
|
84
|
+
agent_id: Agent ID for access control
|
|
85
|
+
|
|
86
|
+
Returns:
|
|
87
|
+
Memory data if found, None otherwise
|
|
88
|
+
"""
|
|
89
|
+
pass
|
|
90
|
+
|
|
91
|
+
@abstractmethod
|
|
92
|
+
def update(
|
|
93
|
+
self,
|
|
94
|
+
memory_id: int,
|
|
95
|
+
content: str,
|
|
96
|
+
user_id: Optional[str] = None,
|
|
97
|
+
agent_id: Optional[str] = None,
|
|
98
|
+
metadata: Optional[Dict[str, Any]] = None,
|
|
99
|
+
) -> Dict[str, Any]:
|
|
100
|
+
"""
|
|
101
|
+
Update an existing memory.
|
|
102
|
+
|
|
103
|
+
Args:
|
|
104
|
+
memory_id: ID of the memory to update
|
|
105
|
+
content: New content for the memory
|
|
106
|
+
user_id: User ID for access control
|
|
107
|
+
agent_id: Agent ID for access control
|
|
108
|
+
metadata: Updated metadata
|
|
109
|
+
|
|
110
|
+
Returns:
|
|
111
|
+
Dictionary containing the updated memory information
|
|
112
|
+
"""
|
|
113
|
+
pass
|
|
114
|
+
|
|
115
|
+
@abstractmethod
|
|
116
|
+
def delete(
|
|
117
|
+
self,
|
|
118
|
+
memory_id: int,
|
|
119
|
+
user_id: Optional[str] = None,
|
|
120
|
+
agent_id: Optional[str] = None,
|
|
121
|
+
) -> bool:
|
|
122
|
+
"""
|
|
123
|
+
Delete a memory.
|
|
124
|
+
|
|
125
|
+
Args:
|
|
126
|
+
memory_id: ID of the memory to delete
|
|
127
|
+
user_id: User ID for access control
|
|
128
|
+
agent_id: Agent ID for access control
|
|
129
|
+
|
|
130
|
+
Returns:
|
|
131
|
+
True if deleted successfully, False otherwise
|
|
132
|
+
"""
|
|
133
|
+
pass
|
|
134
|
+
|
|
135
|
+
@abstractmethod
|
|
136
|
+
def get_all(
|
|
137
|
+
self,
|
|
138
|
+
user_id: Optional[str] = None,
|
|
139
|
+
agent_id: Optional[str] = None,
|
|
140
|
+
limit: int = 100,
|
|
141
|
+
offset: int = 0,
|
|
142
|
+
) -> List[Dict[str, Any]]:
|
|
143
|
+
"""
|
|
144
|
+
Get all memories with optional filtering.
|
|
145
|
+
|
|
146
|
+
Args:
|
|
147
|
+
user_id: Filter by user ID
|
|
148
|
+
agent_id: Filter by agent ID
|
|
149
|
+
limit: Maximum number of results
|
|
150
|
+
offset: Number of results to skip
|
|
151
|
+
|
|
152
|
+
Returns:
|
|
153
|
+
List of memories
|
|
154
|
+
"""
|
|
155
|
+
pass
|
|
156
|
+
|
|
157
|
+
@abstractmethod
|
|
158
|
+
def reset(self) -> None:
|
|
159
|
+
"""
|
|
160
|
+
Reset the memory store by:
|
|
161
|
+
Deletes the vector store collection
|
|
162
|
+
Resets the database
|
|
163
|
+
Recreates the vector store with a new client
|
|
164
|
+
"""
|
|
165
|
+
pass
|