MCPcopy
hub / github.com/aiming-lab/MetaClaw / _row_to_unit

Method _row_to_unit

metaclaw/memory/store.py:1492–1517  ·  view source on GitHub ↗
(self, row: sqlite3.Row)

Source from the content-addressed store, hash-verified

1490 }
1491
1492 def _row_to_unit(self, row: sqlite3.Row) -> MemoryUnit:
1493 return MemoryUnit(
1494 memory_id=row["memory_id"],
1495 scope_id=row["scope_id"],
1496 memory_type=MemoryType(row["memory_type"]),
1497 content=row["content"],
1498 summary=row["summary"] or "",
1499 source_session_id=row["source_session_id"] or "",
1500 source_turn_start=int(row["source_turn_start"] or 0),
1501 source_turn_end=int(row["source_turn_end"] or 0),
1502 entities=_json_list(row["entities_json"]),
1503 topics=_json_list(row["topics_json"]),
1504 importance=float(row["importance"] or 0.0),
1505 confidence=float(row["confidence"] or 0.0),
1506 access_count=int(row["access_count"] or 0),
1507 reinforcement_score=float(row["reinforcement_score"] or 0.0),
1508 status=MemoryStatus(row["status"]),
1509 supersedes=_json_list(row["supersedes_json"]),
1510 superseded_by=row["superseded_by"] or "",
1511 embedding=_json_float_list(row["embedding_json"]),
1512 created_at=row["created_at"],
1513 updated_at=row["updated_at"],
1514 last_accessed_at=row["last_accessed_at"] or "",
1515 expires_at=row["expires_at"] or "" if "expires_at" in row.keys() else "",
1516 tags=_json_list(row["tags_json"]) if "tags_json" in row.keys() else [],
1517 )
1518
1519 # --- Scope access control ---
1520

Callers 6

memory_exportFunction · 0.95
list_activeMethod · 0.95
get_scope_analyticsMethod · 0.95
_get_by_idMethod · 0.95
get_by_idsMethod · 0.95
get_linked_memoriesMethod · 0.95

Calls 5

MemoryUnitClass · 0.70
MemoryTypeClass · 0.70
_json_listFunction · 0.70
MemoryStatusClass · 0.70
_json_float_listFunction · 0.70

Tested by

no test coverage detected