Skip to content

client.memory

client.memory — the memory operations.

On AsyncKindgi every method is the same, awaited.

list_facts(
*,
limit: int | None = None,
cursor: str | None = None,
type: str | None = None,
scope: str | None = None,
scope_kind: Literal['tenant', 'org', 'project'] | None = None,
scope_id: str | None = None,
inherit: bool | None = None,
timeout: float | None = None,
) -> FactCollectionPage

List facts. GET /v1/memory/facts

Cursor-paginated. Filters: ?type= (exact match on Fact.type), ?scope= (URL-encoded JSON partial memory Scope), ?scopeKind + ?scopeId + ?inherit (discriminated PlatformScope triplet — threaded into the binding as platformScope; both fields coexist). Sort order is binding-defined.

write_fact(
*,
idempotency_key: str | None = None,
timeout: float | None = None,
**fields: Any,
) -> Fact

Write a fact. POST /v1/memory/facts

Persists a new fact. type selects the retrieval policy (which indexes populate). Semantic-indexed types require an embedding provider bound on the deployment; if unavailable, the route returns 400 bad-input.

get_fact(*, timeout: float | None = None) -> Fact

Fetch a fact. GET /v1/memory/facts/{factId}

supersede_fact(
*,
idempotency_key: str | None = None,
timeout: float | None = None,
) -> SupersedeFactResult

Mark a fact as superseded. POST /v1/memory/facts/{factId}/supersede

Soft-delete via supersession — the historical row is retained until retention sweeps remove it. Idempotent: superseding an already-superseded fact returns 200 { superseded: true }.

retrieve(
*,
idempotency_key: str | None = None,
timeout: float | None = None,
**fields: Any,
) -> RetrieveMemoryResult

Retrieve facts by intent. POST /v1/memory/retrieve

Cross-history retrieval. Body is a RetrieveIntent shape mirroring the agent-side declarative retrieval. Semantic modes require an embedding provider bound on the deployment.