Brain Docs

Reference

TypeScript SDKInstallationHTTP clientWire client
planreasonmaterializeProceduralqueryExplainqueryTrace
ErrorsRetriesPagination
Brain/Docs
✦ ASKBrain on GitHubDashboard
TypeScript 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
plan(input: PlanInput): Promise<PlanResult>
Handshake credentialstable
plan(request: PlanRequest): Promise<PlanStep[]>
planFrames(request: PlanRequest): Promise<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.

maxStepsintegeroptional

Step budget.

maxWallTimeMsintegeroptional

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

maxBranchesintegeroptional

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[].stepIndexintegeralways

Position in the path.

steps[].memoryId / text—always

The memory this step passes through.

steps[].transitionKindstringalways

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

steps[].confidencefloatalways

Confidence in the step.

steps[].estimatedDistanceToGoalfloatalways

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?

listExtractors

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