Overview
Clusters are flexible groupings for organizing related memories. Unlike spaces which provide access isolation, clusters are labels that memories can belong to. A single memory can belong to multiple clusters.
Clusters vs Spaces: Use spaces for access control and tenant isolation. Use clusters for topical organization within a space.
Create Cluster
POST /clustersCreates a new cluster for organizing memories. Cluster names must be unique within a space.
Body Parameters
| Field | Type | Description |
|---|---|---|
| name | string (required) | Cluster name (1-255 characters). Unique within the account. |
| description | string | Optional description (max 1000 characters). |
| space_id | string | Optional space UUID to scope this cluster to. |
| color | string | Optional hex color code (e.g., #4A90D9). |
| metadata | object | Optional key-value pairs to attach to this cluster. |
Response (201)
{
"id": "<uuid>",
"name": "learning-progress",
"description": "Track user learning milestones",
"space_id": "<space-uuid>",
"color": "#4A90D9",
"metadata": {
"category": "education",
"auto_assign": true
},
"memory_count": 0,
"created_at": "2026-04-10T10:30:00Z"
}Get Cluster
GET /clusters/:clusterIdFetches a cluster by its UUID. Returns cluster details including memory count and optionally the memories themselves.
Path Parameters
| Field | Type | Description |
|---|---|---|
| clusterId | string (required) | The cluster UUID. |
Query Parameters
| Field | Type | Description |
|---|---|---|
| include_memories | boolean | Set to true to include the cluster's memories in the response. Default: false. |
| include | string | Comma-separated extras: quality_metrics. |
| limit | integer | Maximum number of memories to include when include_memories=true. Default: 20. |
| offset | integer | Offset for paginating included memories. Default: 0. |
| sort | string | Sort memories by (default: added_at). |
| order | string | asc or desc. Default: desc. |
Response (200)
{
"id": "<uuid>",
"name": "learning-progress",
"description": "Track user learning milestones",
"space_id": "<space-uuid>",
"color": "#4A90D9",
"cluster_type": "manual",
"memory_count": 47,
"silhouette_score": null,
"dbcv_score": null,
"cohesion_score": null,
"centroid_available": false,
"created_at": "2026-04-10T10:30:00Z",
"updated_at": "2026-04-12T14:22:00Z",
"memories": [
{
"id": "<uuid>",
"content": "Completed React tutorial",
"created_at": "2026-04-12T14:22:00Z"
}
],
"memories_pagination": {
"limit": 5,
"offset": 0,
"has_more": true
}
}List Clusters
GET /clustersReturns a list of all clusters, optionally filtered by space and scale.
Query Parameters
| Field | Type | Description |
|---|---|---|
| q | string | Search clusters by name or description. |
| space_id | string | Filter clusters by space UUID. Pass null to match clusters not scoped to any space. |
| cluster_type | string | Filter by type: manual, hdbscan, bertopic, community. |
| has_memories | boolean | Filter clusters that have (or lack) memories. |
| color | string | Filter by color (comma-separated for multiple). |
| include | string | Comma-separated extras: quality_metrics, topic_info. |
| sort | string | Sort by name (default), created_at, updated_at, memory_count, silhouette_score. |
| order | string | asc (default) or desc. |
| limit | integer | Maximum number of clusters to return. Default: 50, Max: 100. |
| offset | integer | Offset-based pagination. Default: 0. |
| cursor | string | Cursor for keyset pagination (base64 encoded). |
Response (200)
{
"data": [
{
"id": "<uuid>",
"name": "learning-progress",
"description": "Track user learning milestones",
"cluster_type": "manual",
"memory_count": 47,
"created_at": "2026-04-10T10:30:00Z"
}
],
"has_more": false
}Update Cluster
PATCH /clusters/:clusterIdUpdates an existing cluster. Only the fields you provide will be updated.
Path Parameters
| Field | Type | Description |
|---|---|---|
| clusterId | string (required) | The cluster UUID. |
Body Parameters
| Field | Type | Description |
|---|---|---|
| name | string | New name for the cluster. |
| description | string | New description (nullable). |
| color | string | New hex color (nullable). |
| metadata | object | Replacement metadata object. |
Response (200)
{
"id": "<uuid>",
"name": "learning-progress",
"description": "Track learning milestones and achievements",
"color": "#22C55E",
"memory_count": 47,
"created_at": "2026-04-10T10:30:00Z",
"updated_at": "2026-04-14T09:15:00Z"
}Delete Cluster
DELETE /clusters/:clusterIdDeletes a cluster. Memories previously associated with the cluster are unlinked; the underlying memories are not deleted.
Path Parameters
| Field | Type | Description |
|---|---|---|
| clusterId | string (required) | The cluster UUID. |
Response (204)
Returns no content on successful deletion.
Note: Deleting a cluster only removes the cluster and its memory associations. The memories themselves remain in the account and are still searchable.
Manage Memory-Cluster Associations
Cluster membership is managed from the memory side, via the Memories API. The endpoints below are documented here for discoverability.
Add a memory to one or more clusters
POST /memories/:id/clustersAssociates a memory with the given clusters.
Body Parameters
| Field | Type | Description |
|---|---|---|
| cluster_ids | string[] (required) | Array of cluster UUIDs. |
| confidence | number | Association confidence (0-1). Default: 1.0. |
Remove a memory from a cluster
DELETE /memories/:id/clusters/:clusterIdDissociates a memory from a single cluster. Returns no content on success.
List a memory's clusters
GET /memories/:id/clustersReturns all clusters the memory belongs to.
List Cluster Memories
GET /clusters/:clusterId/memoriesReturns a paginated list of memories belonging to a cluster.
Path Parameters
| Field | Type | Description |
|---|---|---|
| clusterId | string (required) | The cluster UUID. |
Query Parameters
| Field | Type | Description |
|---|---|---|
| limit | integer | Maximum memories to return. Default: 50. |
| offset | integer | Offset for pagination. Default: 0. |
| sort | string | Sort field (default: added_at). |
| order | string | asc or desc. Default: desc. |
Response (200)
{
"cluster_id": "<uuid>",
"cluster_name": "learning-progress",
"memories": [
{
"id": "<uuid>",
"content": "Completed React tutorial",
"created_at": "2026-04-12T14:22:00Z"
}
],
"pagination": {
"limit": 5,
"offset": 0,
"count": 2,
"has_more": true
}
}Account Cluster Statistics
GET /clusters/statsReturns account-wide cluster statistics.
Query Parameters
| Field | Type | Description |
|---|---|---|
| include | string | Comma-separated extras. Supported: color_distribution. |
Cluster Quality & Topics
Per-cluster quality and topic endpoints:
Get quality metrics for a cluster
GET /clusters/:id/qualityReturns silhouette, DBCV and cohesion scores if available.
Get topic information for a cluster
GET /clusters/:id/topicsReturns topic label, keywords and representation extracted by topic modelling.
Queue a quality metric refresh
POST /clusters/:id/refresh-metricsEnqueues a background job to recompute quality metrics for the cluster.
Queue a centroid recomputation
POST /clusters/:id/recompute-centroidEnqueues a background job to recompute the cluster centroid.
Trigger Clustering Jobs
Trigger incremental clustering
POST /clusters/incrementalQueues an incremental clustering job that assigns new or selected memories to existing clusters.
Body Parameters
| Field | Type | Description |
|---|---|---|
| space_id | string | Personal space UUID to scope the job. |
| team_space_id | string | Team space UUID (multi-agent collaboration). |
| memory_ids | string[] | Optional array of memory UUIDs to include. |
Response (202)
{
"status": "queued",
"job_id": "<job-id>",
"message": "Incremental clustering job queued",
"params": { "space_id": "<space-uuid>", "memory_count": "all_new" }
}Trigger full HDBSCAN clustering
POST /clusters/fullQueues a full HDBSCAN clustering job that creates new clusters from all unclustered memories.
Get clustering run status
GET /clusters/statusReturns the most recent clustering run, plus aggregate counts.
List recent clustering runs
GET /clusters/runsReturns a list of clustering runs (filterable by status).
Get clustering configuration
GET /clusters/configReturns the account's clustering configuration (algorithm, min_cluster_size, auto_enabled).
Update clustering configuration
POST /clusters/configUpdates the account's clustering configuration.
Body Parameters
| Field | Type | Description |
|---|---|---|
| min_cluster_size | integer | Minimum cluster size. |
| algorithm | string | Clustering algorithm (e.g. hdbscan). |
| auto_enabled | boolean | Enable background auto-clustering. |
When to use: Trigger clustering jobs after bulk imports or significant
content changes. Clustering otherwise runs automatically in the background when enabled
via /clusters/config.
Cluster Object
The cluster object contains the following fields:
| Field | Type | Description |
|---|---|---|
| id | string | UUID identifier for the cluster. |
| name | string | Cluster name (unique within the account). |
| description | string | null | Optional description of the cluster's purpose. |
| space_id | string | null | The space this cluster is scoped to, or null for account-wide clusters. |
| cluster_type | string | One of manual, hdbscan, bertopic, community. |
| color | string | null | Optional hex color code for UI display. |
| metadata | object | Custom key-value pairs attached to this cluster. |
| memory_count | integer | Number of memories currently associated with this cluster. |
| silhouette_score | number | null | Clustering quality metric (null for manual clusters). |
| dbcv_score | number | null | Density-Based Cluster Validity score (null for manual clusters). |
| cohesion_score | number | null | Cohesion score (null for manual clusters). |
| topic_label | string | null | Topic label if topic modelling has been applied. |
| topic_keywords | string[] | null | Topic keywords if topic modelling has been applied. |
| created_at | string | ISO 8601 timestamp of when the cluster was created. |
| updated_at | string | ISO 8601 timestamp of when the cluster was last updated. |