Skip to content

Core concepts

An organization is the tenant boundary. In the current runtime model, this maps to the Clerk ownerId resolved for the request.

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.

A namespace separates memory use cases inside the same agent. It is derived from pid and optional tid for compatibility.

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 is caller-defined JSON. Use it for source IDs, confidence, document references, ticket IDs, or other filters that should travel with the memory.

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.