Skip to content

REST API

Brain API

REST endpoints for the Brain area of Lessly.

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

NameInTypeRequiredDescription
productIdbodystringExplicit product id whose SHARED memory will be wiped. Never inferred from ambient context.
confirmProductIdbodystringMust EXACTLY equal productId (double-entry confirmation).
confirmbodybooleanMust be true to proceed. Guards against accidental invocation.

Response

FieldTypeAlwaysDescription
scopestring
productIdstring
graphDeletednumber
vectorsDeletednumber
connectorStateRowsClearednumber
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

FieldTypeAlwaysDescription
acceptedboolean
snapshotIdstring
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

NameInTypeRequiredDescription
snapshotIdpathstringSpecific 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

NameInTypeRequiredDescription
connectorIdquerystring
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

NameInTypeRequiredDescription
connectorIdquerystring
spaceIdquerystring
searchquerystring
GET/brain/clickup/spaces

List the spaces in a ClickUp connection (optionally filtered by search)

MCP tool: brain_clickup_spaces_list

Parameters

NameInTypeRequiredDescription
connectorIdquerystring
searchquerystring
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

FieldTypeAlwaysDescription
run_idstring
acceptedboolean
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

FieldTypeAlwaysDescription
sweepobject
digestobject
engineobject
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

FieldTypeAlwaysDescription
run_idstring
acceptedboolean
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

NameInTypeRequiredDescription
typebodystring
namebodystring
connectorIdbodystring
ownerbodystring
repobodystring
branchbodystring
configbodystring
clickupConfigbodyobject
loadModebodystring
modelbodystring
sourceAuthoritybodystring

Response

FieldTypeAlwaysDescription
idstring
namestring
repostring
typestring
modelstring
ownerstring
branchstring
configstring
enabledboolean
loadModestring
lastRunAtstring
lastResultstring
connectorIdstring
clickupConfigstring
degradedCountnumber
effectiveModelstring
sourceAuthoritystring
unmeasuredCountnumber
DELETE/brain/daemons/:id

Remove an ingestion daemon and its connector state (leaves ingested memory)

MCP tool: brain_daemon_remove

Parameters

NameInTypeRequiredDescription
idpathstring

Response

FieldTypeAlwaysDescription
okboolean
GET/brain/daemons/:id

Get a specific ingestion daemon by id

MCP tool: brain_daemon_get

Parameters

NameInTypeRequiredDescription
idpathstring

Response

FieldTypeAlwaysDescription
idstring
namestring
repostring
typestring
modelstring
ownerstring
branchstring
configstring
enabledboolean
loadModestring
lastRunAtstring
lastResultstring
connectorIdstring
clickupConfigstring
degradedCountnumber
effectiveModelstring
sourceAuthoritystring
unmeasuredCountnumber
PUT/brain/daemons/:id

Update an ingestion daemon (config, enabled, name, branch)

MCP tool: brain_daemon_update

Parameters

NameInTypeRequiredDescription
namebodystring
configbodystring
clickupConfigbodyobject
enabledbodyboolean
branchbodystring
loadModebodystring
modelbodystring
sourceAuthoritybodystring
idpathstring

Response

FieldTypeAlwaysDescription
okboolean
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

NameInTypeRequiredDescription
idpathstring

Response

FieldTypeAlwaysDescription
runobject
modelstring
daemonIdstring
loadModestring
pendingCountnumber
supportsBatchboolean
effectiveModelstring
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

NameInTypeRequiredDescription
idpathstring
pathsbodyarray

Response

FieldTypeAlwaysDescription
clearedarray
notFoundarray
triggeredboolean
triggerErrorstring
skippedPendingarray
POST/brain/daemons/:id/run

Trigger an immediate run for a daemon and return its current status

MCP tool: brain_daemon_run

Parameters

NameInTypeRequiredDescription
idpathstring

Response

FieldTypeAlwaysDescription
doneboolean
runIdstring
statusstring
sourcesarray
progressobject
routedTostring
triggeredboolean
triggerErrorstring
GET/brain/daemons/:id/runs

Recent run history for a daemon with per-run ingest counts

MCP tool: brain_daemon_runs

Parameters

NameInTypeRequiredDescription
idpathstring
limitqueryinteger

Response

FieldTypeAlwaysDescription
runsarray
daemonIdstring
GET/brain/daemons/:id/status

Get the latest run status for a daemon

MCP tool: brain_daemon_status

Parameters

NameInTypeRequiredDescription
idpathstring

Response

FieldTypeAlwaysDescription
doneboolean
runIdstring
statusstring
sourcesarray
progressobject
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

NameInTypeRequiredDescription
runIdpathstring
outcomequerystring
sourceKindquerystring
limitqueryinteger
cursorquerystring

Response

FieldTypeAlwaysDescription
itemsarray
runIdstring
countsobject
nextCursorstring
GET/brain/knowledge/entities

Search product knowledge-graph entities (Feature, Decision, Risk, …) for the current product

MCP tool: brain_knowledge_search

Parameters

NameInTypeRequiredDescription
namequerystringFilter by entity name / alias substring
entity_typequerystringFilter by ontology entity type (e.g. Feature, Integration)
limitqueryintegerMax entities
offsetqueryintegerPagination offset
scopequerystringRead scope; 'both' (default) unions shared + your private

Response

FieldTypeAlwaysDescription
totalnumber
entitiesarray
elapsed_msnumber
request_idstring
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

NameInTypeRequiredDescription
entity_refpathstringEntity id, name, or alias to fetch backing memories for
limitqueryintegerMax memories (default 50)
offsetqueryintegerPagination offset
scopequerystringRead scope; 'both' (default) unions shared + your private

Response

FieldTypeAlwaysDescription
totalnumber
entityobject
memoriesarray
elapsed_msnumber
request_idstring
GET/brain/knowledge/entities/:entity_ref/neighborhood

Expand the neighborhood (related entities + relations) around one knowledge entity

MCP tool: brain_knowledge_neighborhood

Parameters

NameInTypeRequiredDescription
entity_refpathstringEntity id or name to expand around
depthqueryintegerHops to expand (engine clamps to 3)
relation_typequerystringOnly traverse this relation type
entity_typequerystringOnly include neighbors of this entity type
limitqueryintegerMax neighbors
scopequerystringRead scope; 'both' (default) unions shared + your private

Response

FieldTypeAlwaysDescription
rootobject
entitiesarray
relationsarray
elapsed_msnumber
request_idstring
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

NameInTypeRequiredDescription
limitqueryintegerMax 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
scopequerystringRead scope; 'both' (default) unions shared + your private

Response

FieldTypeAlwaysDescription
edgesarray
nodesarray
totalsobject
truncatedboolean
elapsed_msnumber
request_idstring
GET/brain/knowledge/relations

List typed relations (depends_on, competes_with, …) in the product knowledge graph

MCP tool: brain_knowledge_relations

Parameters

NameInTypeRequiredDescription
relation_typequerystringFilter by ontology relation type (e.g. depends_on)
source_entityquerystringFilter by source entity id or name
target_entityquerystringFilter by target entity id or name
limitqueryintegerMax relations
scopequerystringRead scope; 'both' (default) unions shared + your private

Response

FieldTypeAlwaysDescription
relationsarray
elapsed_msnumber
request_idstring
GET/brain/memory

List memories (shared + your private by default)

MCP tool: brain_memory_list

Parameters

NameInTypeRequiredDescription
scopequerystringRead scope; 'both' (default) unions shared + your private
limitqueryinteger
offsetqueryinteger
orderquerystring

Response

FieldTypeAlwaysDescription
totalnumber
memoriesarray
POST/brain/memory

Store a memory for the current product

MCP tool: brain_memory_add

Parameters

NameInTypeRequiredDescription
contentbodystringThe memory text to store
metadatabodyobjectOptional structured metadata
scopebodystring'shared' = product-wide pool (default); 'private' = this agent only
source_authoritybodystringSource authority (highest→lowest): policy > official > team > informal. Omit to default to official; an unrecognized value is rejected.

Response

FieldTypeAlwaysDescription
successboolean
memory_idstring
request_idstring
DELETE/brain/memory/:memory_id

Delete a memory you own (or a shared one)

MCP tool: brain_memory_delete

Parameters

NameInTypeRequiredDescription
memory_idpathstringEngine memory id

Response

FieldTypeAlwaysDescription
successboolean
request_idstring
deleted_countnumber
GET/brain/memory/:memory_id

Get one memory by id (product+agent scoped)

MCP tool: brain_memory_get

Parameters

NameInTypeRequiredDescription
memory_idpathstringEngine memory id

Response

FieldTypeAlwaysDescription
tagsarray
layerstringEngine memory layer (l0_basic_info…l7_intention)
customobject
sourcestring
statusstring
contentstring
user_idstring
agent_idstring
is_latestboolean
memory_atnumber
memory_idstring
speculatestring
confidencenumber
elapsed_msnumber
request_idstring
supersedesarray
gmt_creatednumber
superseded_byarray
source_authoritystringSource authority (highest→lowest): policy > official > team > informal
source_raw_memory_idstring
PATCH/brain/memory/:memory_id

Replace a memory you own (or a shared one)

MCP tool: brain_memory_update

Parameters

NameInTypeRequiredDescription
memory_idpathstringEngine memory id
contentbodystringReplacement content

Response

FieldTypeAlwaysDescription
successboolean
memory_idstring
request_idstring
GET/brain/memory/search

Search memories for the current product

MCP tool: brain_memory_search

Parameters

NameInTypeRequiredDescription
queryquerystringNatural-language search query
limitqueryintegerMax results per channel
scopequerystringRead scope; 'both' (default) unions shared + your private. A person sees shared only (empty private namespace).

Response

FieldTypeAlwaysDescription
normalarray
profilearray
proactivearray
GET/brain/memory/stats

Summary counts for the current product (memories by layer, graph nodes/edges, entities)

MCP tool: brain_memory_stats

Parameters

NameInTypeRequiredDescription
scopequerystringRead scope; 'both' (default) unions shared + your private

Response

FieldTypeAlwaysDescription
graphobject
memoriesobject
knowledgeobject
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

NameInTypeRequiredDescription
snapshotIdbodystringThe snapshot id to restore for the current product.
confirmProductIdbodystringMust EXACTLY equal the current product id (double-entry confirmation).
confirmbodybooleanMust be true. DESTRUCTIVE: the product's current Brain is wiped and replaced.

Response

FieldTypeAlwaysDescription
acceptedboolean
restoreIdstring
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

NameInTypeRequiredDescription
restoreIdpathstringThe 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

NameInTypeRequiredDescription
daysqueryintegerHow many UTC days of this product's ledger to return, ending today (default 30, max 90)

Response

FieldTypeAlwaysDescription
notestring
productobjectBrain's own ledger, for THIS product only
platformobjectThe platform billing aggregate for the whole ORG; null if it could not be read
platform_errorstringWhy 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

NameInTypeRequiredDescription
connectorIdquerystring
repoFullNamequerystring
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

NameInTypeRequiredDescription
connectorIdquerystring
pagequeryinteger
searchquerystring
Was this page helpful?
Esc

Start typing to search the docs.

navigateselect