REST API
The Brain area publishes 41 REST endpoints. Paths are relative to https://api.lessly.com; see Authentication for the required header.
POST/brain/admin/shared-memory/reset
DESTRUCTIVE admin op: reset a product's SHARED Brain memory (vectors + knowledge graph) and clear its connector_state so a re-ingest re-writes. Requires confirm:true AND confirmProductId echo; gated by an env arm flag, an env allowlist, and governance access.
MCP tool: brain_product_shared_memory_reset
Parameters
| Name | In | Type | Required | Description |
|---|
| productId | body | string | • | Explicit product id whose SHARED memory will be wiped. Never inferred from ambient context. |
| confirmProductId | body | string | • | Must EXACTLY equal productId (double-entry confirmation). |
| confirm | body | boolean | • | Must be true to proceed. Guards against accidental invocation. |
Response
| Field | Type | Always | Description |
|---|
| scope | string | • | — |
| productId | string | • | — |
| graphDeleted | number | • | — |
| vectorsDeleted | number | • | — |
| connectorStateRowsCleared | number | • | — |
GET/brain/backups
List the current product's backups (most recent first).
MCP tool: brain_backups_list
Parameters
No parameters.
POST/brain/backups
Request an on-demand point-in-time backup of the current product's Brain memory. Async (202): records a running snapshot and runs the backup in the background — returns { accepted, snapshotId }; poll brain_backups_list / brain_backup_status for completion. Rejects (409) if a backup is already running for the product.
MCP tool: brain_backup_create
Parameters
No parameters.
Response
| Field | Type | Always | Description |
|---|
| accepted | boolean | • | — |
| snapshotId | string | • | — |
GET/brain/backups/:snapshotId
Get a backup status by snapshot id, or the latest backup for the current product.
MCP tool: brain_backup_status
Parameters
| Name | In | Type | Required | Description |
|---|
| snapshotId | path | string | — | Specific snapshot to look up; omit for the latest. |
GET/brain/clickup/channels
List the chat channels in a ClickUp workspace connection (for selecting channels to ingest)
MCP tool: brain_clickup_channels_list
Parameters
| Name | In | Type | Required | Description |
|---|
| connectorId | query | string | • | — |
GET/brain/clickup/connections
List the ClickUp workspace connections available to the current product
MCP tool: brain_clickup_connections_list
Parameters
No parameters.
GET/brain/clickup/lists
List all lists in a ClickUp space (folderless and within folders, optionally filtered by search)
MCP tool: brain_clickup_lists_list
Parameters
| Name | In | Type | Required | Description |
|---|
| connectorId | query | string | • | — |
| spaceId | query | string | • | — |
| search | query | string | — | — |
GET/brain/clickup/spaces
List the spaces in a ClickUp connection (optionally filtered by search)
MCP tool: brain_clickup_spaces_list
Parameters
| Name | In | Type | Required | Description |
|---|
| connectorId | query | string | • | — |
| search | query | string | — | — |
POST/brain/cognition/digest
Queue a System-2 digest over the product shared pool (async); returns { accepted, run_id }. Poll brain_cognition_status for the result.
MCP tool: brain_cognition_digest
Parameters
No parameters.
Response
| Field | Type | Always | Description |
|---|
| run_id | string | • | — |
| accepted | boolean | • | — |
GET/brain/cognition/status
Read the engine-global System-2 queue gauge plus this product's last digest/sweep run (status, counts, timing).
MCP tool: brain_cognition_status
Parameters
No parameters.
Response
| Field | Type | Always | Description |
|---|
| sweep | object | • | — |
| digest | object | • | — |
| engine | object | • | — |
POST/brain/cognition/sweep
Queue a cross-domain sweep over the product shared pool (async); returns { accepted, run_id }. Poll brain_cognition_status for the result.
MCP tool: brain_cognition_sweep
Parameters
No parameters.
Response
| Field | Type | Always | Description |
|---|
| run_id | string | • | — |
| accepted | boolean | • | — |
GET/brain/daemons
List configured ingestion daemons for this product
MCP tool: brain_daemons_list
Parameters
No parameters.
POST/brain/daemons
Create a new ingestion daemon (github, clickup or gdrive)
MCP tool: brain_daemon_create
Parameters
| Name | In | Type | Required | Description |
|---|
| type | body | string | — | — |
| name | body | string | — | — |
| connectorId | body | string | — | — |
| owner | body | string | — | — |
| repo | body | string | — | — |
| branch | body | string | — | — |
| config | body | string | — | — |
| clickupConfig | body | object | — | — |
| loadMode | body | string | — | — |
| model | body | string | — | — |
| sourceAuthority | body | string | — | — |
Response
| Field | Type | Always | Description |
|---|
| id | string | • | — |
| name | string | • | — |
| repo | string | • | — |
| type | string | • | — |
| model | string | • | — |
| owner | string | • | — |
| branch | string | • | — |
| config | string | — | — |
| enabled | boolean | • | — |
| loadMode | string | • | — |
| lastRunAt | string | • | — |
| lastResult | string | — | — |
| connectorId | string | • | — |
| clickupConfig | string | — | — |
| degradedCount | number | • | — |
| effectiveModel | string | • | — |
| sourceAuthority | string | • | — |
| unmeasuredCount | number | • | — |
DELETE/brain/daemons/:id
Remove an ingestion daemon and its connector state (leaves ingested memory)
MCP tool: brain_daemon_remove
Parameters
| Name | In | Type | Required | Description |
|---|
| id | path | string | • | — |
Response
| Field | Type | Always | Description |
|---|
| ok | boolean | • | — |
GET/brain/daemons/:id
Get a specific ingestion daemon by id
MCP tool: brain_daemon_get
Parameters
| Name | In | Type | Required | Description |
|---|
| id | path | string | • | — |
Response
| Field | Type | Always | Description |
|---|
| id | string | • | — |
| name | string | • | — |
| repo | string | • | — |
| type | string | • | — |
| model | string | • | — |
| owner | string | • | — |
| branch | string | • | — |
| config | string | — | — |
| enabled | boolean | • | — |
| loadMode | string | • | — |
| lastRunAt | string | • | — |
| lastResult | string | — | — |
| connectorId | string | • | — |
| clickupConfig | string | — | — |
| degradedCount | number | • | — |
| effectiveModel | string | • | — |
| sourceAuthority | string | • | — |
| unmeasuredCount | number | • | — |
PUT/brain/daemons/:id
Update an ingestion daemon (config, enabled, name, branch)
MCP tool: brain_daemon_update
Parameters
| Name | In | Type | Required | Description |
|---|
| name | body | string | — | — |
| config | body | string | — | — |
| clickupConfig | body | object | — | — |
| enabled | body | boolean | — | — |
| branch | body | string | — | — |
| loadMode | body | string | — | — |
| model | body | string | — | — |
| sourceAuthority | body | string | — | — |
| id | path | string | — | — |
Response
| Field | Type | Always | Description |
|---|
| ok | boolean | • | — |
GET/brain/daemons/:id/batch-status
Get batch ingestion status for a daemon (pending count, job, ETA, model, outcome)
MCP tool: brain_daemon_batch_status
Parameters
| Name | In | Type | Required | Description |
|---|
| id | path | string | • | — |
Response
| Field | Type | Always | Description |
|---|
| run | object | • | — |
| model | string | • | — |
| daemonId | string | • | — |
| loadMode | string | • | — |
| pendingCount | number | • | — |
| supportsBatch | boolean | • | — |
| effectiveModel | string | • | — |
POST/brain/daemons/:id/reingest
Force re-ingest of specific document paths for a daemon: clears their stored content hash and triggers a realtime run, so degraded or never-measured documents are re-extracted instead of hash-skipped forever
MCP tool: brain_daemon_reingest
Parameters
| Name | In | Type | Required | Description |
|---|
| id | path | string | • | — |
| paths | body | array | • | — |
Response
| Field | Type | Always | Description |
|---|
| cleared | array | • | — |
| notFound | array | • | — |
| triggered | boolean | • | — |
| triggerError | string | — | — |
| skippedPending | array | • | — |
POST/brain/daemons/:id/run
Trigger an immediate run for a daemon and return its current status
MCP tool: brain_daemon_run
Parameters
| Name | In | Type | Required | Description |
|---|
| id | path | string | • | — |
Response
| Field | Type | Always | Description |
|---|
| done | boolean | • | — |
| runId | string | • | — |
| status | string | • | — |
| sources | array | • | — |
| progress | object | • | — |
| routedTo | string | • | — |
| triggered | boolean | • | — |
| triggerError | string | — | — |
GET/brain/daemons/:id/runs
Recent run history for a daemon with per-run ingest counts
MCP tool: brain_daemon_runs
Parameters
| Name | In | Type | Required | Description |
|---|
| id | path | string | • | — |
| limit | query | integer | — | — |
Response
| Field | Type | Always | Description |
|---|
| runs | array | • | — |
| daemonId | string | • | — |
GET/brain/daemons/:id/status
Get the latest run status for a daemon
MCP tool: brain_daemon_status
Parameters
| Name | In | Type | Required | Description |
|---|
| id | path | string | • | — |
Response
| Field | Type | Always | Description |
|---|
| done | boolean | • | — |
| runId | string | • | — |
| status | string | • | — |
| sources | array | • | — |
| progress | object | • | — |
GET/brain/daemons/gdrive/connections
List Google Drive connections for this product with their picked files
MCP tool: brain_gdrive_connections_list
Parameters
No parameters.
GET/brain/daemons/runs/:runId/items
List the per-item ingest ledger for a run (filter by outcome, esp. denied)
MCP tool: brain_daemon_run_items
Parameters
| Name | In | Type | Required | Description |
|---|
| runId | path | string | • | — |
| outcome | query | string | — | — |
| sourceKind | query | string | — | — |
| limit | query | integer | — | — |
| cursor | query | string | — | — |
Response
| Field | Type | Always | Description |
|---|
| items | array | • | — |
| runId | string | • | — |
| counts | object | • | — |
| nextCursor | string | • | — |
GET/brain/knowledge/entities
Search product knowledge-graph entities (Feature, Decision, Risk, …) for the current product
MCP tool: brain_knowledge_search
Parameters
| Name | In | Type | Required | Description |
|---|
| name | query | string | — | Filter by entity name / alias substring |
| entity_type | query | string | — | Filter by ontology entity type (e.g. Feature, Integration) |
| limit | query | integer | — | Max entities |
| offset | query | integer | — | Pagination offset |
| scope | query | string | — | Read scope; 'both' (default) unions shared + your private |
Response
| Field | Type | Always | Description |
|---|
| total | number | • | — |
| entities | array | • | — |
| elapsed_ms | number | • | — |
| request_id | string | • | — |
GET/brain/knowledge/entities/:entity_ref/memories
List the memories a knowledge entity was extracted from (its DERIVED_FROM evidence)
MCP tool: brain_knowledge_entity_memories
Parameters
| Name | In | Type | Required | Description |
|---|
| entity_ref | path | string | • | Entity id, name, or alias to fetch backing memories for |
| limit | query | integer | — | Max memories (default 50) |
| offset | query | integer | — | Pagination offset |
| scope | query | string | — | Read scope; 'both' (default) unions shared + your private |
Response
| Field | Type | Always | Description |
|---|
| total | number | • | — |
| entity | object | • | — |
| memories | array | • | — |
| elapsed_ms | number | • | — |
| request_id | string | • | — |
GET/brain/knowledge/entities/:entity_ref/neighborhood
Expand the neighborhood (related entities + relations) around one knowledge entity
MCP tool: brain_knowledge_neighborhood
Parameters
| Name | In | Type | Required | Description |
|---|
| entity_ref | path | string | • | Entity id or name to expand around |
| depth | query | integer | — | Hops to expand (engine clamps to 3) |
| relation_type | query | string | — | Only traverse this relation type |
| entity_type | query | string | — | Only include neighbors of this entity type |
| limit | query | integer | — | Max neighbors |
| scope | query | string | — | Read scope; 'both' (default) unions shared + your private |
Response
| Field | Type | Always | Description |
|---|
| root | object | • | — |
| entities | array | • | — |
| relations | array | • | — |
| elapsed_ms | number | • | — |
| request_id | string | • | — |
GET/brain/knowledge/graph
Export the product knowledge graph (entities + typed relations) as nodes and edges; truncation keeps the highest-degree nodes, so a small limit returns the hub concepts
MCP tool: brain_knowledge_graph
Parameters
| Name | In | Type | Required | Description |
|---|
| limit | query | integer | — | Max nodes (default 5000). When the cap applies the HIGHEST-DEGREE nodes are kept, so a small limit (e.g. 100) returns the hub concepts — that is usually what you want |
| scope | query | string | — | Read scope; 'both' (default) unions shared + your private |
Response
| Field | Type | Always | Description |
|---|
| edges | array | • | — |
| nodes | array | • | — |
| totals | object | • | — |
| truncated | boolean | • | — |
| elapsed_ms | number | • | — |
| request_id | string | • | — |
GET/brain/knowledge/relations
List typed relations (depends_on, competes_with, …) in the product knowledge graph
MCP tool: brain_knowledge_relations
Parameters
| Name | In | Type | Required | Description |
|---|
| relation_type | query | string | — | Filter by ontology relation type (e.g. depends_on) |
| source_entity | query | string | — | Filter by source entity id or name |
| target_entity | query | string | — | Filter by target entity id or name |
| limit | query | integer | — | Max relations |
| scope | query | string | — | Read scope; 'both' (default) unions shared + your private |
Response
| Field | Type | Always | Description |
|---|
| relations | array | • | — |
| elapsed_ms | number | • | — |
| request_id | string | • | — |
GET/brain/memory
List memories (shared + your private by default)
MCP tool: brain_memory_list
Parameters
| Name | In | Type | Required | Description |
|---|
| scope | query | string | — | Read scope; 'both' (default) unions shared + your private |
| limit | query | integer | — | — |
| offset | query | integer | — | — |
| order | query | string | — | — |
Response
| Field | Type | Always | Description |
|---|
| total | number | • | — |
| memories | array | • | — |
POST/brain/memory
Store a memory for the current product
MCP tool: brain_memory_add
Parameters
| Name | In | Type | Required | Description |
|---|
| content | body | string | • | The memory text to store |
| metadata | body | object | — | Optional structured metadata |
| scope | body | string | — | 'shared' = product-wide pool (default); 'private' = this agent only |
| source_authority | body | string | — | Source authority (highest→lowest): policy > official > team > informal. Omit to default to official; an unrecognized value is rejected. |
Response
| Field | Type | Always | Description |
|---|
| success | boolean | • | — |
| memory_id | string | • | — |
| request_id | string | • | — |
DELETE/brain/memory/:memory_id
Delete a memory you own (or a shared one)
MCP tool: brain_memory_delete
Parameters
| Name | In | Type | Required | Description |
|---|
| memory_id | path | string | • | Engine memory id |
Response
| Field | Type | Always | Description |
|---|
| success | boolean | • | — |
| request_id | string | • | — |
| deleted_count | number | • | — |
GET/brain/memory/:memory_id
Get one memory by id (product+agent scoped)
MCP tool: brain_memory_get
Parameters
| Name | In | Type | Required | Description |
|---|
| memory_id | path | string | • | Engine memory id |
Response
| Field | Type | Always | Description |
|---|
| tags | array | • | — |
| layer | string | • | Engine memory layer (l0_basic_info…l7_intention) |
| custom | object | • | — |
| source | string | • | — |
| status | string | • | — |
| content | string | • | — |
| user_id | string | • | — |
| agent_id | string | • | — |
| is_latest | boolean | • | — |
| memory_at | number | • | — |
| memory_id | string | • | — |
| speculate | string | • | — |
| confidence | number | • | — |
| elapsed_ms | number | • | — |
| request_id | string | • | — |
| supersedes | array | • | — |
| gmt_created | number | • | — |
| superseded_by | array | • | — |
| source_authority | string | • | Source authority (highest→lowest): policy > official > team > informal |
| source_raw_memory_id | string | • | — |
PATCH/brain/memory/:memory_id
Replace a memory you own (or a shared one)
MCP tool: brain_memory_update
Parameters
| Name | In | Type | Required | Description |
|---|
| memory_id | path | string | • | Engine memory id |
| content | body | string | • | Replacement content |
Response
| Field | Type | Always | Description |
|---|
| success | boolean | • | — |
| memory_id | string | • | — |
| request_id | string | • | — |
GET/brain/memory/search
Search memories for the current product
MCP tool: brain_memory_search
Parameters
| Name | In | Type | Required | Description |
|---|
| query | query | string | • | Natural-language search query |
| limit | query | integer | — | Max results per channel |
| scope | query | string | — | Read scope; 'both' (default) unions shared + your private. A person sees shared only (empty private namespace). |
Response
| Field | Type | Always | Description |
|---|
| normal | array | • | — |
| profile | array | • | — |
| proactive | array | • | — |
GET/brain/memory/stats
Summary counts for the current product (memories by layer, graph nodes/edges, entities)
MCP tool: brain_memory_stats
Parameters
| Name | In | Type | Required | Description |
|---|
| scope | query | string | — | Read scope; 'both' (default) unions shared + your private |
Response
| Field | Type | Always | Description |
|---|
| graph | object | • | — |
| memories | object | • | — |
| knowledge | object | • | — |
POST/brain/restores
DESTRUCTIVE: full-replace restore of the current product's Brain from a snapshot (wipe + load). Takes an automatic pre-restore snapshot first (safety net). Requires confirm:true AND confirmProductId echo; refuses on product/snapshot mismatch or embedding-dims mismatch. Async — returns { accepted, restoreId }; poll brain_restore_status.
MCP tool: brain_backup_restore
Parameters
| Name | In | Type | Required | Description |
|---|
| snapshotId | body | string | • | The snapshot id to restore for the current product. |
| confirmProductId | body | string | • | Must EXACTLY equal the current product id (double-entry confirmation). |
| confirm | body | boolean | • | Must be true. DESTRUCTIVE: the product's current Brain is wiped and replaced. |
Response
| Field | Type | Always | Description |
|---|
| accepted | boolean | • | — |
| restoreId | string | • | — |
GET/brain/restores/:restoreId
Read a restore run's status (pending|wiped|importing|completed|failed) with counts + timing, by restoreId (returned by brain_backup_restore).
MCP tool: brain_restore_status
Parameters
| Name | In | Type | Required | Description |
|---|
| restoreId | path | string | • | The restore run id (returned by brain_backup_restore). |
GET/brain/usage/report
Reported LLM/embedding token usage for this product, next to the platform billing aggregate
MCP tool: brain_usage_report
Parameters
| Name | In | Type | Required | Description |
|---|
| days | query | integer | — | How many UTC days of this product's ledger to return, ending today (default 30, max 90) |
Response
| Field | Type | Always | Description |
|---|
| note | string | • | — |
| product | object | • | Brain's own ledger, for THIS product only |
| platform | object | • | The platform billing aggregate for the whole ORG; null if it could not be read |
| platform_error | string | • | Why the platform aggregate is null; null when it was read successfully |
GET/brain/vcs/branches
List branches for a repository on a GitHub connection
MCP tool: brain_connector_branches_list
Parameters
| Name | In | Type | Required | Description |
|---|
| connectorId | query | string | • | — |
| repoFullName | query | string | • | — |
GET/brain/vcs/connections
List the GitHub connections available to the current product
MCP tool: brain_connector_connections_list
Parameters
No parameters.
GET/brain/vcs/repos
List repositories accessible to a GitHub connection (optionally filtered by search)
MCP tool: brain_connector_repos_list
Parameters
| Name | In | Type | Required | Description |
|---|
| connectorId | query | string | • | — |
| page | query | integer | — | — |
| search | query | string | — | — |
Was this page helpful?Thanks for your feedback!