MCPcopy
hub / github.com/OpenBMB/ChatDev / record_memory_operation

Method record_memory_operation

utils/logger.py:291–307  ·  view source on GitHub ↗

Record a memory operation (retrieve/update).

(self, node_id: str, retrieved_memory: str, operation_type: str, stage: str,
                                duration: float = None, details: Dict[str, Any] = None)

Source from the content-addressed store, hash-verified

289 )
290
291 def record_memory_operation(self, node_id: str, retrieved_memory: str, operation_type: str, stage: str,
292 duration: float = None, details: Dict[str, Any] = None) -> None:
293 """Record a memory operation (retrieve/update)."""
294 memory_details = {
295 "retrieved_memory": retrieved_memory,
296 "operation_type": operation_type, # RETRIEVE or UPDATE
297 "stage": stage,
298 **(details or {})
299 }
300
301 self.info(
302 f"Memory {operation_type} operation for node {node_id} at {stage}",
303 node_id=node_id,
304 event_type=EventType.MEMORY_OPERATION,
305 details=memory_details,
306 duration=duration
307 )
308
309 def record_workflow_start(self, workflow_config: Dict[str, Any] = None) -> None:
310 """Record the workflow start event."""

Callers 2

_retrieve_memoryMethod · 0.45
_update_memoryMethod · 0.45

Calls 1

infoMethod · 0.95

Tested by

no test coverage detected