Skip to main content

Long-term memory

Sellable product

This capability is granted by an API key scoped to the `` product (product face). See the product reference below.

Per-(organization, user) cross-session agent memory as a shared capability. Consumers: voice + aakhara (agent products that need the user remembered across calls/sessions) = >=2. INTERNAL (no product-face). Fail-closed: /v1/memories returns 503 when the LLM extraction edge (provider-gateway) is unconfigured.

  • Group: Voice & AI
  • Contract: contracts/long-term-memory/v1/openapi.yaml
  • Public base: https://api.vagarylabs.com (the consolidated API gateway — one host, per-brand sibling api.<zone>)
  • Auth: a product API key (vgk_…) issued from the console — Authorization: Bearer vgk_…
  • Product face (customer-keyed):
    • https://api.vagarylabs.com/product/v1/memory/store

Endpoints

MethodPathSummary
POST/v1/memoriesAdd memories from raw turns/text (extract → consolidate/dedup → store)
GET/v1/memoriesList a user's memories (most-recently-updated first)
DELETE/v1/memoriesGDPR (Art.17) erasure — forget EVERY memory for a user within the tenant
GET/v1/memories/searchSemantic recall of a user's memories relevant to a query (ranked)
DELETE/v1/memories/&#123;memory_id&#125;Forget one memory (IDOR-safe — scoped by org+user+id)
GET/healthliveness (db + embedder + llm-configured)
GET/metricsPrometheus exposition

Schemas

Error

FieldTypeDescription
errorstringstable machine code (slug), e.g. validation_error, unauthorized, upstream_failed, internal
reasonstringhuman-readable one-line explanation (no secrets/PII)
detailobject
request_idstring

AddMemoryRequest

FieldTypeDescription
organization_idstringproduct-tier tenant (I6); resolved anti-spoof when identity is wired
user_idstringend-user within the tenant (sub-tenant scope)
messagesarraychat turns to extract memories FROM (alt to text)
textstringraw text to extract memories FROM (alt to messages)
metadataobjectstored on new memories

AddMemoryResponse

FieldTypeDescription
memory_idsarrayids added or updated this call
addedinteger
updatedinteger
deletedinteger

Memory

FieldTypeDescription
idstring
contentstring
metadataobject
scorenumbersearch only — 1 - cosine distance (higher = more relevant)
created_atstring
updated_atstring

MemoryList

FieldTypeDescription
organization_idstring
user_idstring
countinteger
memoriesarray

SearchResponse

FieldTypeDescription
organization_idstring
user_idstring
countinteger
memoriesarray

Generated by scripts/gen-capability-docs.py from contracts/long-term-memory/v1/openapi.yaml — the contract IS the source of truth; edit the contract, not this page.