Core concepts
Organization
Section titled “Organization”An organization is the tenant boundary. In the current runtime model, this maps
to the Clerk ownerId resolved for the request.
Subject
Section titled “Subject”A subject is the person, account, project, document, or entity the memory is
about. Use stable IDs such as customer_acme, user_123, or project_delta.
An agent is the system that creates, owns, or primarily uses a memory. Recording
agentId makes it possible to audit where a memory came from and filter
retrieval by workflow.
Namespace
Section titled “Namespace”A namespace separates memory use cases inside the same agent. It is derived
from pid and optional tid for compatibility.
Memory
Section titled “Memory”A memory is the durable record stored in D1. It includes content, metadata, and timestamps. If the caller provides an embedding, the API also indexes it in Vectorize.
Metadata
Section titled “Metadata”Metadata is caller-defined JSON. Use it for source IDs, confidence, document references, ticket IDs, or other filters that should travel with the memory.
Embedding
Section titled “Embedding”An embedding is a numeric vector representation of memory content or a search query. The API currently generates embeddings with Workers AI before indexing into Vectorize.