Brain Docs

Reference

Python SDKInstallationHTTP clientWire clientSync vs async
planreasonmaterialize_proceduralquery_explainquery_trace
ErrorsRetriesPagination
Brain/Docs
✦ ASKBrain on GitHubDashboard
Python 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(observation: dict, depth=None, confidence_threshold=None, max_inferences=None, budget_wall_time_ms=None) -> ReasonResult
Handshake credentialstable
reason(request: ReasonRequest) -> list[InferenceStep]
reason_frames(request: ReasonRequest) -> list[ReasonResponseFrame]

Parameters

ParameterTypeRequired
observationEndpointrequired

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

depthintegeroptional

How many inference hops.

confidence_thresholdfloatoptional

Drop inferences below this confidence.

max_inferencesintegeroptional

Cap on returned inferences.

budget_wall_time_msintegeroptional

Wall-clock budget.

Returns

FieldTypePresence
inferencesInferenceStep[]always

What Brain concluded.

inferences[].claimstringalways

The inferred claim, in words.

inferences[].supporting_memoriesstring[]always

Memories backing it.

inferences[].contradicting_memoriesstring[]always

Memories arguing against it.

inferences[].confidencefloatalways

Confidence in the inference.

inferences[].inference_kindstringalways

What sort of inference produced it.

inferences[].step_indexintegeralways

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.

materialize_procedural

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

On this page

ParametersReturns
Suggest an editOpen in Playground