plan
Walk from a start state to a goal across the memory graph, and get the steps back.
plan(input: PlanInput): Promise<PlanResult>plan(request: PlanRequest): Promise<PlanStep[]>
planFrames(request: PlanRequest): Promise<PlanResponseFrame[]>Parameters
startEndpointrequiredWhere to start, as { text } or { memoryId } — a description Brain resolves, or a memory you already have.
goalEndpointrequiredWhere to end up, in the same shape.
maxStepsintegeroptionalStep budget.
maxWallTimeMsintegeroptionalWall-clock budget. Exceeding it is QueryOverBudget — an error, not a truncated answer.
maxBranchesintegeroptionalBranching factor cap.
strategystringoptionalA strategy hint. An enum (strategyHint) on the wire.
Returns
stepsPlanStep[]alwaysThe path. Empty means no path was found — not an error.
steps[].stepIndexintegeralwaysPosition in the path.
steps[].memoryId / text—alwaysThe memory this step passes through.
steps[].transitionKindstringalwaysHow the plan got from the previous step to this one.
steps[].confidencefloatalwaysConfidence in the step.
steps[].estimatedDistanceToGoalfloatalwaysShould 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.
Was this page helpful?