graph store memory

This commit is contained in:
tegwick 2026-05-15 11:02:11 +02:00
parent 6b3e391acf
commit c5110f61b0
3 changed files with 101 additions and 0 deletions

View file

@ -448,6 +448,59 @@ class MemoryPackageExportResult:
}
@dataclass(frozen=True)
class MemoryRuntimeExportRequest:
graph_id: str
include_nodes: bool = True
include_edges: bool = True
include_events: bool = True
include_audit_events: bool = True
include_retired: bool = True
event_kinds: tuple[str, ...] = ()
operations: tuple[str, ...] = ()
correlation_id: str | None = None
def __post_init__(self) -> None:
object.__setattr__(self, "event_kinds", tuple(self.event_kinds))
object.__setattr__(self, "operations", tuple(self.operations))
def to_dict(self) -> dict[str, Any]:
return {
"graph_id": self.graph_id,
"include_nodes": self.include_nodes,
"include_edges": self.include_edges,
"include_events": self.include_events,
"include_audit_events": self.include_audit_events,
"include_retired": self.include_retired,
"event_kinds": list(self.event_kinds),
"operations": list(self.operations),
"correlation_id": self.correlation_id,
}
@dataclass(frozen=True)
class MemoryRuntimeExportResult:
request: MemoryRuntimeExportRequest
correlation_id: str
envelope: dict[str, Any] = field(default_factory=dict)
audit_event: AuditEvent | None = None
diagnostics: tuple[Diagnostic, ...] = ()
success: bool = True
def __post_init__(self) -> None:
object.__setattr__(self, "diagnostics", tuple(self.diagnostics))
def to_dict(self) -> dict[str, Any]:
return {
"request": self.request.to_dict(),
"correlation_id": self.correlation_id,
"success": self.success,
"envelope": dict(self.envelope),
"audit_event": self.audit_event.to_dict() if self.audit_event else None,
"diagnostics": [diagnostic.to_dict() for diagnostic in self.diagnostics],
}
class MemoryRuntimeService:
def __init__(
self,