Docs / API reference

API reference

Every method, parameter, request, and response schema.

Sourced history for changing facts — cited or honestly absent.

Two calls are the whole product:

code
const brain = await client.brains.create({ id, self });
await brain.remember(anything);
const ctx = await brain.context(question);

Four layers, and no layer silently acquires the authority of the layer after it:

code
Record  = what entered the system
Memory  = what the system inferred
Object  = what the application accepted
Context = what is eligible for this task

Every returned assertion carries provenance to a source Record. A miss means no eligible result was found — never that the fact is false. Unknowns are explicit. Conflicts are preserved. Attribution is enforced by default: nothing is returned as the subject's own unless ownership is established.

The simplicity budget

Not a preference — scripts/check_api_simplicity.py parses this contract and fails the build on a sixth resource, an eighth read knob, or a query parameter that declares neither x-brain-knob nor x-brain-view-param. The counts below are read out of the contract by this generator, the same way the gate reads them.

5
resources
Brain · Context · Memory · Object · Record
7
read knobs
as_of · budget · filter · include · mode · purpose · schema
3
write knobs
occurred_at · source · visibility
6
view params
as_of · cursor · limit · owner · since_watermark · subject

No knob may change what is TRUE. A knob may only change what is RETURNED.

Operations

methodpathoperationIdsummary
POST/brainscreateBrainCreate a Brain
GET/brains/{brain_id}getBrainInspect a Brain
DELETE/brains/{brain_id}forgetBrainDelete a Brain and everything derived from it
GET/brains/{brain_id}/profilegetProfileThe always-fresh self card — who this Brain is, every line cited
POST/brains/{brain_id}/contextcreateContextGet task-ready context — cited, budgeted, honest
GET/brains/{brain_id}/traceslistTracesEvery Context request this Brain served, newest first
GET/brains/{brain_id}/traces/{trace_id}getTraceInspect one Context request — its lanes, scores, citations, budget and cost
GET/brains/{brain_id}/memorieslistMemoriesInspect what the system inferred
GET/brains/{brain_id}/memories/{memory_id}getMemoryInspect one Memory, its revisions, and its evidence
POST/brains/{brain_id}/objectsacceptObjectAccept application truth
GET/brains/{brain_id}/objects/{object_type}/{object_key}getObjectInspect the accepted Object
GET/brains/{brain_id}/censusgetCensusWhat is noisy in THIS Brain's own data
POST/brains/{brain_id}/recordsrememberRecordRemember anything
GET/brains/{brain_id}/records/{record_id}getRecordInspect a Record and its processing state
DELETE/brains/{brain_id}/records/{record_id}forgetRecordDelete a Record and cascade to everything derived from it

Operation guide

Every section below is generated from the same OpenAPI document as the clients. The examples use environment variables, contain no credential, and open the same-origin playground without sending a request until you choose to run it.

POST createBrain

Create a Brain

POST /brains Try this operation

Parameters

nameinrequiredschemameaning
Idempotency-KeyheadernostringPlumbing, not a knob. Replays return the original response body.

Request

JSON body · BrainCreate

fieldrequiredschemameaning
idyesSlug
namenostring
selfnoSelfEntity
self.typeyesstring
self.nameyesstring
JSON
{
  "id": "ada"
}

Responses

statusschemameaning
201BrainCreated
defaultError

Errors

All non-success responses use the shared Error schema and carry a stable code, request ID, and live error guide.

cURL

cURL
curl -sS -X POST \
  "$BRAIN/brains" \
  -H "Authorization: Bearer $KEY" \
  -H "Idempotency-Key: docs-example-1" \
  -H "Content-Type: application/json" \
  --data '{"id":"ada"}'

GET getBrain

Inspect a Brain

GET /brains/{brain_id} Try this operation

Parameters

nameinrequiredschemameaning
brain_idpathyesSlug

Request

No request body.

Responses

statusschemameaning
200BrainOK
defaultError

Errors

All non-success responses use the shared Error schema and carry a stable code, request ID, and live error guide.

cURL

cURL
curl -sS -X GET \
  "$BRAIN/brains/ada" \
  -H "Authorization: Bearer $KEY"

DELETE forgetBrain

Delete a Brain and everything derived from it

DELETE /brains/{brain_id} Try this operation

Parameters

nameinrequiredschemameaning
brain_idpathyesSlug

Request

No request body.

Responses

statusschemameaning
200DeletionReceiptDeleted, with a receipt
defaultError

Errors

All non-success responses use the shared Error schema and carry a stable code, request ID, and live error guide.

cURL

cURL
curl -sS -X DELETE \
  "$BRAIN/brains/ada" \
  -H "Authorization: Bearer $KEY"

GET getProfile

The always-fresh self card — who this Brain is, every line cited

GET /brains/{brain_id}/profile Try this operation

Parameters

nameinrequiredschemameaning
brain_idpathyesSlug
limitquerynointeger

Request

No request body.

Responses

statusschemameaning
200ProfileOK
defaultError

Errors

All non-success responses use the shared Error schema and carry a stable code, request ID, and live error guide.

cURL

cURL
curl -sS -X GET \
  "$BRAIN/brains/ada/profile" \
  -H "Authorization: Bearer $KEY"

GET getCensus

What is noisy in THIS Brain's own data

GET /brains/{brain_id}/census Try this operation

Parameters

nameinrequiredschemameaning
brain_idpathyesSlug

Request

No request body.

Responses

statusschemameaning
200CensusOK
defaultError

Errors

All non-success responses use the shared Error schema and carry a stable code, request ID, and live error guide.

cURL

cURL
curl -sS -X GET \
  "$BRAIN/brains/ada/census" \
  -H "Authorization: Bearer $KEY"

GET listTraces

Every Context request this Brain served, newest first

GET /brains/{brain_id}/traces Try this operation

Parameters

nameinrequiredschemameaning
brain_idpathyesSlug
limitquerynointeger

Request

No request body.

Responses

statusschemameaning
200TracePageOK
defaultError

Errors

All non-success responses use the shared Error schema and carry a stable code, request ID, and live error guide.

cURL

cURL
curl -sS -X GET \
  "$BRAIN/brains/ada/traces" \
  -H "Authorization: Bearer $KEY"

GET getTrace

Inspect one Context request — its lanes, scores, citations, budget and cost

GET /brains/{brain_id}/traces/{trace_id} Try this operation

Parameters

nameinrequiredschemameaning
brain_idpathyesSlug
trace_idpathyesstringThe `id` of the Context being explained, or the `trc_…` id of a failed request.

Request

No request body.

Responses

statusschemameaning
200TraceOK
defaultError

Errors

All non-success responses use the shared Error schema and carry a stable code, request ID, and live error guide.

cURL

cURL
curl -sS -X GET \
  "$BRAIN/brains/ada/traces/ctx_01K7QEXAMPLE" \
  -H "Authorization: Bearer $KEY"

POST rememberRecord

Remember anything

POST /brains/{brain_id}/records Try this operation

Parameters

nameinrequiredschemameaning
brain_idpathyesSlug
Idempotency-KeyheadernostringPlumbing, not a knob. Replays return the original response body.

Request

JSON body · RecordCreate

fieldrequiredschemameaning
contentyesstring | MessageContent | DocumentContent | EventContent | FactContent | CorrectionContentPlain text, or ONE typed shape tagged by `kind`. Text is the two-call quickstart and stays first-class; a typed shape is how structure that already exists survives the trip, because a speaker is a person, a thread is an episode and a participant is an edge — and none of that is…
sourcenoSource
source.namenostring
source.external_idnostring
source.trustnostring
visibilitynoVisibility
occurred_atnostringWhen it happened. Defaults to now; wrong for anything historical.
JSON
{
  "content": "The customer prefers annual billing."
}

Responses

statusschemameaning
202RecordAccepted and durably queued
defaultError

Errors

All non-success responses use the shared Error schema and carry a stable code, request ID, and live error guide.

cURL

cURL
curl -sS -X POST \
  "$BRAIN/brains/ada/records" \
  -H "Authorization: Bearer $KEY" \
  -H "Idempotency-Key: docs-example-1" \
  -H "Content-Type: application/json" \
  --data '{"content":"The customer prefers annual billing."}'

GET getRecord

Inspect a Record and its processing state

GET /brains/{brain_id}/records/{record_id} Try this operation

Parameters

nameinrequiredschemameaning
brain_idpathyesSlug
record_idpathyesstring

Request

No request body.

Responses

statusschemameaning
200RecordOK
defaultError

Errors

All non-success responses use the shared Error schema and carry a stable code, request ID, and live error guide.

cURL

cURL
curl -sS -X GET \
  "$BRAIN/brains/ada/records/rec_01K7QEXAMPLE" \
  -H "Authorization: Bearer $KEY"

DELETE forgetRecord

Delete a Record and cascade to everything derived from it

DELETE /brains/{brain_id}/records/{record_id} Try this operation

Parameters

nameinrequiredschemameaning
brain_idpathyesSlug
record_idpathyesstring

Request

No request body.

Responses

statusschemameaning
200DeletionReceiptDeleted, with a receipt
defaultError

Errors

All non-success responses use the shared Error schema and carry a stable code, request ID, and live error guide.

cURL

cURL
curl -sS -X DELETE \
  "$BRAIN/brains/ada/records/rec_01K7QEXAMPLE" \
  -H "Authorization: Bearer $KEY"

GET listMemories

Inspect what the system inferred

GET /brains/{brain_id}/memories Try this operation

Parameters

nameinrequiredschemameaning
brain_idpathyesSlug
subjectquerynostring
ownerquerynostring
as_ofquerynostring
since_watermarkquerynostringDelta read. Returns only Memories that changed after this boundary, oldest change first — the incremental-sync loop is: read a page, apply it, send its `watermark` back, repeat while `has_more`. CHANGED means TRANSACTION time — when this Brain learned or revised the Memory — not…
cursorquerynostring
limitquerynointeger

Request

No request body.

Responses

statusschemameaning
200MemoryPageOK
defaultError

Errors

All non-success responses use the shared Error schema and carry a stable code, request ID, and live error guide.

cURL

cURL
curl -sS -X GET \
  "$BRAIN/brains/ada/memories" \
  -H "Authorization: Bearer $KEY"

GET getMemory

Inspect one Memory, its revisions, and its evidence

GET /brains/{brain_id}/memories/{memory_id} Try this operation

Parameters

nameinrequiredschemameaning
brain_idpathyesSlug
memory_idpathyesstring

Request

No request body.

Responses

statusschemameaning
200MemoryOK
defaultError

Errors

All non-success responses use the shared Error schema and carry a stable code, request ID, and live error guide.

cURL

cURL
curl -sS -X GET \
  "$BRAIN/brains/ada/memories/mem_01K7QEXAMPLE" \
  -H "Authorization: Bearer $KEY"

POST acceptObject

Accept application truth

POST /brains/{brain_id}/objects Try this operation

Parameters

nameinrequiredschemameaning
brain_idpathyesSlug
Idempotency-KeyheadernostringPlumbing, not a knob. Replays return the original response body.

Request

JSON body · ObjectAccept

fieldrequiredschemameaning
typeyesSlug
keyyesSlug
valueyes
if_versionnointeger | nullOptimistic concurrency. Stale writes fail with the current version.
JSON
{
  "type": "preference",
  "key": "billing",
  "value": {
    "plan": "annual"
  }
}

Responses

statusschemameaning
201ObjectAccepted
defaultError

Errors

All non-success responses use the shared Error schema and carry a stable code, request ID, and live error guide.

cURL

cURL
curl -sS -X POST \
  "$BRAIN/brains/ada/objects" \
  -H "Authorization: Bearer $KEY" \
  -H "Idempotency-Key: docs-example-1" \
  -H "Content-Type: application/json" \
  --data '{"type":"preference","key":"billing","value":{"plan":"annual"}}'

GET getObject

Inspect the accepted Object

GET /brains/{brain_id}/objects/{object_type}/{object_key} Try this operation

Parameters

nameinrequiredschemameaning
brain_idpathyesSlug
object_typepathyesSlug
object_keypathyesSlug

Request

No request body.

Responses

statusschemameaning
200ObjectOK
defaultError

Errors

All non-success responses use the shared Error schema and carry a stable code, request ID, and live error guide.

cURL

cURL
curl -sS -X GET \
  "$BRAIN/brains/ada/objects/preference/billing" \
  -H "Authorization: Bearer $KEY"

POST createContext

Get task-ready context — cited, budgeted, honest

POST /brains/{brain_id}/context Try this operation

Parameters

nameinrequiredschemameaning
brain_idpathyesSlug
Brain-WatermarkheadernostringPlumbing, not a knob. Guarantees the Context is at or after this boundary.

Request

JSON body · ContextRequest

fieldrequiredschemameaning
queryyesstring
purposenostringOne word sets policy, sensitivity, and eligibility for a class of task.
as_ofnostringApplies world-time eligibility to returned Memory components. The evidence text is a selected chunk projection and records this boundary but does not yet reconstruct a historical chunk index.
budgetnoobject
budget.tokensnointeger
budget.msnointeger
includenoarraySelect response components. `memories` are cited, temporally eligible Memory atoms whose complete Record lineage is contained in the selected evidence window.
schemanoobjectRequest structured context. Invalid means unavailable, never malformed.
filternoobjectNarrow what is eligible. `since`, `until` and `sources` are enforced. `subjects`, `owner` and `sensitivity_lte` are recorded on the receipt and NOT enforced on Context — use `listMemories` for subject and owner filtering, where those fields exist.
filter.subjectsnoarray
filter.ownernostring
filter.sourcesnoarray
filter.sincenostring
filter.untilnostring
filter.sensitivity_ltenostring | null
modenostring`fast` never composes an answer — it assembles cited evidence and asserts nothing, which is what makes it unable to fabricate. A ready `fast` Context on the hosted spine spends ONE model call — a query embedding — and `cost.generative_calls` is therefore `0`, with `embedding_cal…
JSON
{
  "query": "What should the agent know right now?"
}

Responses

statusschemameaning
200ContextOK — a single Context, or an SSE stream when `Accept: text/event-stream` met `mode: thorough`
202ContextNot yet assemblable at the requested watermark, or `thorough` exceeded the synchronous budget
defaultError

Errors

All non-success responses use the shared Error schema and carry a stable code, request ID, and live error guide.

cURL

cURL
curl -sS -X POST \
  "$BRAIN/brains/ada/context" \
  -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  --data '{"query":"What should the agent know right now?"}'

The five resources

resourceisalways carries
BrainOne durable, isolated memory boundary.id, object, self, created_at
ContextTask-ready, budgeted retrieval with lineage and unknowns. What is eligible now.id, object, query, watermark, status, citations, unknowns, budget
MemoryAn atomic, temporal assertion derived from Records. What the system inferred.id, object, statement, subject, owner, valid_from, citations, version
ObjectImmutable, versioned, developer-governed state. What the application accepted.id, object, type, key, value, version, accepted_by, created_at
RecordImmutable raw input. What entered the system.id, object, status, created_at

Servers

url
https://api.brain.new/v1Cloud
http://localhost:8000/v1Brain Local — identical contract, local engine. Port 8000 is `memory_api.app`; 8787 is `brain.api`, a DIFFERENT application that 404s on every route here. This said 8787 until 2026-07-29, so a generated client built from the contract pointed at the wrong service.

The raw contract is published beside this page: openapi.yaml — the same bytes both SDKs are generated from, and the file the conformance fuzzer checks every response against.