Brain Docs

Reference

Rust SDKInstallationHTTP clientWire client
planreasonmaterialize_proceduralquery_explainquery_trace
ErrorsRetriesPagination
Brain/Docs
✦ ASKBrain on GitHubDashboard
Rust SDKReasoningplan

plan

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

PURPOSE

Find a path from a start state to a goal across the memory graph. Both endpoints are given as text Brain resolves, or as a memory you already hold.

POST/v1/planBearer API keystable
async fn plan(&self, input: &PlanInput) -> Result<PlanResult, BrainHttpError>
Handshake credentialstable
async fn plan(&self, request: &PlanRequest) -> Result<Vec<PlanStep>>
async fn plan_frames(&self, request: &PlanRequest) -> Result<Vec<PlanResponseFrame>>

Parameters

ParameterTypeRequired
startEndpointrequired

Where to start, as { text } or { memoryId } — a description Brain resolves, or a memory you already have.

goalEndpointrequired

Where to end up, in the same shape.

max_stepsintegeroptional

Step budget.

max_wall_time_msintegeroptional

Wall-clock budget. Exceeding it is QueryOverBudget — an error, not a truncated answer.

max_branchesintegeroptional

Branching factor cap.

strategystringoptional

A strategy hint. An enum (strategyHint) on the wire.

Returns

FieldTypePresence
stepsPlanStep[]always

The path. Empty means no path was found — not an error.

steps[].step_indexintegeralways

Position in the path.

steps[].memory_id / text—always

The memory this step passes through.

steps[].transition_kindstringalways

How the plan got from the previous step to this one.

steps[].confidencefloatalways

Confidence in the step.

steps[].estimated_distance_to_goalfloatalways

Should fall monotonically. A step where it rises is where the plan doubled back — worth surfacing when you are debugging a bad plan.

The wire request takes structured PlanState endpoints, a PlanBudget, a sessionFilter and a trace flag, and has a frame-level form.

See also
reasonrecall

Was this page helpful?

list_extractors

The extractors bound to the active schema, and the extractor ids you attribute claims to.

reason

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

On this page

ParametersReturns
Suggest an editOpen in Playground