Brain Docs

Reference

Python SDKInstallationHTTP clientWire clientSync vs async
planreasonmaterialize_proceduralquery_explainquery_trace
ErrorsRetriesPagination
Brain/Docs
✦ ASKBrain on GitHubDashboard
Python SDKReasoningmaterialize_procedural

materialize_procedural

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

PURPOSE

Render the caller's remembered directives — the preferences and standing instructions in the graph — into one block of text you can prepend to a system prompt. The body is optional; every field is a filter.

POST/v1/procedural/materializeBearer API keystable
materialize_procedural(sessions=None, top_k=None, min_confidence=None, categories=None) -> MaterializeProceduralResult
Handshake credentialstable
materialize_procedural(request: MaterializeProceduralRequest) -> MaterializeProceduralResponse

Parameters

ParameterTypeRequired
sessions64-bit integer[]optional

Restrict to these sessions. The wire field is sessionFilter.

top_kintegeroptional

How many directives to include.

min_confidencefloatoptional

Confidence floor.

categoriesstring[]optional

Restrict to these categories.

Returns

FieldTypePresence
system_blockstringalways

The rendered text, ready to prepend to a prompt.

statement_idsstring[]always

Which statements went in — so you can cite them, or diff two renderings.

total_candidatesintegeralways

How many were eligible before trimming.

trimmed_by_budgetbooleanalways

true 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

p = brain.materialize_procedural(top_k=20, min_confidence=0.6)
if p.trimmed_by_budget:
    print(f"{p.total_candidates} candidates, trimmed")

messages = [{"role": "system", "content": f"{base_prompt}\n\n{p.system_block}"}, *history]

The wire request takes an explicit spaceId and a requestId alongside the filters.

See also
list_statementsWhat to write

Was this page helpful?

reason

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

query_explain

See the plan Brain would run for a query, and its estimated cost — without running it.

On this page

ParametersReturnsExample
Suggest an editOpen in Playground