Brain Docs

Reference

TypeScript SDKInstallationHTTP clientWire client
planreasonmaterializeProceduralqueryExplainqueryTrace
ErrorsRetriesPagination
Brain/Docs
✦ ASKBrain on GitHubDashboard
TypeScript SDKReasoningreason

reason

Draw inferences from an observation, with both the supporting and the contradicting evidence.

PURPOSE

Draw inferences from an observation. Brain reports the evidence on both sides rather than resolving conflicts for you.

POST/v1/reasonBearer API keystable
reason(input: ReasonInput): Promise<ReasonResult>
Handshake credentialstable
reason(request: ReasonRequest): Promise<InferenceStep[]>
reasonFrames(request: ReasonRequest): Promise<ReasonResponseFrame[]>

Parameters

ParameterTypeRequired
observationEndpointrequired

What was observed, as { text } or { memoryId }. An ObservationInput on the wire.

depthintegeroptional

How many inference hops.

confidenceThresholdfloatoptional

Drop inferences below this confidence.

maxInferencesintegeroptional

Cap on returned inferences.

budgetWallTimeMsintegeroptional

Wall-clock budget.

Returns

FieldTypePresence
inferencesInferenceStep[]always

What Brain concluded.

inferences[].claimstringalways

The inferred claim, in words.

inferences[].supportingMemoriesstring[]always

Memories backing it.

inferences[].contradictingMemoriesstring[]always

Memories arguing against it.

inferences[].confidencefloatalways

Confidence in the inference.

inferences[].inferenceKindstringalways

What sort of inference produced it.

inferences[].stepIndexintegeralways

Position in the chain.

Read contradictingMemories

An inference can arrive with both supporting and contradicting evidence. Brain reports both rather than resolving the conflict — a high-confidence claim with a non-empty contradictingMemories is exactly the case worth surfacing to a human rather than acting on.

The wire request adds a sessionFilter and a trace flag, and has a frame-level form.

See also
planHow recall decides

Was this page helpful?

plan

Walk from a start state to a goal across the memory graph, and get the steps back.

materializeProcedural

Render remembered directives into a system-prompt block, with the ids that went into it.

On this page

ParametersReturns
Suggest an editOpen in Playground