Skip to main content
TroopyDocs
Open Troopy
Troopy

API reference / Brain

Read the map of the brain

The brain as a map. Each doc and each source is the centre of a cluster, and its memories are round it. A memory that came from no document is in the cluster of the person who said it. One read gives the whole clusters that grew last, up to about limit nodes, oldest first. The other clusters come folded: their centre, with how many memories it holds (folded). With cluster, it gives one cluster whole. With teammate, it gives what one teammate knows: what it wrote down, what it wrote, and what it read in the brain in the last 30 days. A line joins two nodes of the same read. With since (asOf of the read before), it gives what came after that time, and the memories that a new memory replaced. It can give a node again: keep one node for each id. Each answer also tells which teammates read the brain in the last two minutes, and what they read.

get/api/v1/brain/map

Authorization

HeaderAuthorization: Bearer <API key>
Or the headerX-API-Key: <API key>
API keyMake one in Troopy under Settings > API keys. It acts as you, in its workspace.

Other ways to call it

CLItroopy brain map
MCP toolNone. Call it over REST or with the CLI.
Rate limit60 calls in 60 seconds, for each key

Query parameters

sincestring

Only what the brain got after this time

date-time

limitinteger

About how many nodes a read holds. A read never cuts a cluster

Default 5000 · At least 100 · At most 25000

clusterstring

Only one cluster, by the id of its centre: a doc, a source, or the key of the memories of one speaker

At most 120 characters

teammatestring

Only what one teammate knows, by its handle

At most 40 characters

Response

200 · application/json
data*object
6 properties
nodes*array<object>
12 properties
id*string

The id of a doc or a source, or the key of the memories of one speaker

kind*enum<string>

A doc, a source, a memory, or the centre of the memories of one speaker

docsourcememorygroup

type*string

The kind of a doc or a source, note for a memory, or who said the memories of a group: person, teammate or key

title*string
slug*string | null

The slug of a doc, to open it

cluster*string

The id of the centre of its cluster. A centre has its own id

at*string

When the brain got it

state*enum<string>

A newer memory replaced it, or a person said that it is wrong

livereplacedwrong

private*boolean

One of your own notes. It stays out of the shared brain

passagesinteger

A doc or a source: how many passages of its text search reads

originenum<string>

A memory: what a person said or saved, a fact that a teammate read in a document (in the cluster of its document), or a fact that the troop inferred from other notes

persondocumentinferred

foldedinteger

A centre whose memories the read left out, because the map holds more than one read: how many. Read its cluster to get them

edges*array<object>
3 properties
from*string
to*string
type*enum<string>

updates: a newer memory to the memory that it replaced. link: a doc to a source or a doc that it names. site: a web page to the page above it on its site. about: a fact to the record that it is about. related: two memories that mean nearly the same, or two docs, pages or files near in meaning. extends: a memory to the memory that it adds to. derives: an inferred fact to a memory that it follows from

updateslinksiteaboutrelatedextendsderives

activity*array<object>
6 properties
runId*string

A 24-character id

agent*object
3 properties
handle*string
name*string
avatar*object

Its face: a bot-avatars body type, colour (#RRGGBB), face and shading, a robot head, or an object with two eyes

6 properties
shape*enum<string>

cloverflowertrianglesquareblobghostcircledropstardroidmechalienhexagoncatcloudpilland 2 more

color*string
face*enum<string>

eyesmouth

shadingenum<string>

How its body is lit; fabric when unset

fabricplasticcrispsmoothflat

robotobject

A TV-headed robot (robot-heads) in place of the bot. shape, color, face and shading stay for the bot

5 properties
shape*enum<string>

rectanglesquarecirclehexagon

shell*string

The colour of its shell

trim*string

The colour of its ears and of the collar of its antenna

screen*string

The colour of the lights on its screen

antenna*boolean
objectobject

An object with two eyes in place of the bot. shape, color, face and shading stay for the bot

2 properties
shape*enum<string>

circlesquaretrianglepilldrophexagonpentagoncloudbeancloverflowersparkleburstapplechatbulband 13 more

color*string

The colour of the object

to*array<string>

The nodes that the teammate read

cited*array<string>

The nodes that its answer used

live*boolean

The teammate works now

at*string

ISO 8601 date and time

total*integer | null

How many nodes the whole map holds. Null for a read with since

cut*boolean

The read left out nodes: it folded the clusters that grew longest ago, or with since, more came than one read holds. After a read with since, read the whole map again

asOf*string

When the read began. Give it as since in the next read

Errors

400 invalid_inputFix the field named in detail. Each operation's schema is in /api/v1/openapi.json.
401 unauthorizedSend an API key as `Authorization: Bearer tr_live_...`. Create one in Troopy under Settings.
403 forbiddenThe key lacks a scope this operation needs, or its owner lacks the role. detail says which; create a key with the scope, or ask an organization owner or admin.
429 rate_limitedWait the number of seconds in Retry-After, then retry.