materializeProcedural
Render remembered directives into a system-prompt block, with the ids that went into it.
materializeProcedural(input?: MaterializeProceduralInput): Promise<MaterializeProceduralResult>materializeProcedural(request: MaterializeProceduralRequest): Promise<MaterializeProceduralResponse>Parameters
ParameterTypeRequired
sessions64-bit integer[]optionalRestrict to these sessions. The wire field is sessionFilter.
topKintegeroptionalHow many directives to include.
minConfidencefloatoptionalConfidence floor.
categoriesstring[]optionalRestrict to these categories.
Returns
FieldTypePresence
systemBlockstringalwaysThe rendered text, ready to prepend to a prompt.
statementIdsstring[]alwaysWhich statements went in — so you can cite them, or diff two renderings.
totalCandidatesintegeralwaysHow many were eligible before trimming.
trimmedByBudgetbooleanalwaystrue means directives did not make it in. The block is not the whole set, and an agent reading it is working from a partial picture.
Example
const p = await brain.materializeProcedural({ topK: 20, minConfidence: 0.6 });
if (p.trimmedByBudget) console.warn(`${p.totalCandidates} candidates, trimmed`);
const messages = [
{ role: "system", content: `${basePrompt}\n\n${p.systemBlock}` },
...history,
];The wire request takes an explicit spaceId and a requestId alongside the
filters.
See also
Was this page helpful?