Skip to Content

Schemas Endpoints

Schemas define the structure of the memories your agents can create. They act as blueprints for the extraction process.

Register Schema

Register a new schema for memory extraction.

Endpoint: POST /schemas

Request Body

FieldTypeRequiredDescription
namestringYesUnique name for the schema (e.g., UserProfile).
descriptionstringYesDescription of what this schema represents (used by the LLM).
uniqueOnstring[]NoFields that identify the same entity for auto-supersede.
schemastringYesJSON Schema string defining the data structure.

uniqueOn Behavior

  • ["kind"]: One memory per schema type (e.g., user profile). New memories supersede previous.
  • ["email"]: One memory per unique email address.
  • Omit: Multiple instances allowed (e.g., tasks, events).

Example Request

{ "name": "Task", "description": "A task that the user needs to complete", "schema": "{\"type\":\"object\",\"properties\":{\"title\":{\"type\":\"string\"},\"status\":{\"type\":\"string\"}}}" }

Example with Auto-Supersede

{ "name": "UserProfile", "description": "User preferences and settings", "uniqueOn": ["kind"], "schema": "{\"type\":\"object\",\"properties\":{\"theme\":{\"type\":\"string\"},\"language\":{\"type\":\"string\"}}}" }

Response

{ "success": true, "schema": { "name": "Task", "description": "..." } }

List Schemas

Retrieve all schemas registered by your account.

Endpoint: GET /schemas

Response

{ "success": true, "schemas": [ { "name": "UserProfile", ... }, { "name": "Task", ... } ] }

Get Schema

Get details of a specific schema.

Endpoint: GET /schemas/[name]

Parameters

ParameterTypeRequiredDescription
namestringYesThe name of the schema.

Response

{ "success": true, "schema": { ... } }

Update Schema

Update an existing schema’s description or structure.

Endpoint: PATCH /schemas/[name]

Request Body

FieldTypeRequiredDescription
descriptionstringNoNew description.
schemastringNoNew JSON Schema string.
uniqueOnstring[]NoNew unique fields for auto-supersede.

Example Request

{ "description": "Updated task definition with priority" }

Delete Schema

Delete a schema. This prevents future memories from being created with this schema, but does not delete existing memories.

Endpoint: DELETE /schemas/[name]

Response

{ "success": true, "deleted": 1 }
Last updated on