Brain Docs

Reference

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

query_trace

Run a query and get back what actually happened, with the measured latency.

PURPOSE

Run the query and report what happened, with the measured latency. Unlike query_explain, this costs what the query costs.

POST/v1/query/traceBearer API keystable
query_trace(text: str, **filters) -> QueryTraceResult
Handshake credentialstable
query_trace(request: QueryTraceRequest) -> QueryTraceResponse

Parameters

ParameterTypeRequired
textstringrequired

The query text.

entity_anchorstringoptional

Anchor the graph retriever on an entity.

kindsstring[]optional

Restrict to these memory kinds.

predicatesstring[]optional

Restrict to these predicates.

sessions64-bit integer[]optional

Restrict to these sessions.

time_rangeTimeRangeoptional

fromUnixMs and toUnixMs, both optional.

as_of_record_time_unix_nanos64-bit integeroptional

Read the space as it stood at that record time.

confidence_minfloatoptional

Confidence floor.

include_tombstonedbooleanoptional

Defaults to false.

include_supersededbooleanoptional

Defaults to false.

limitintegeroptional

Result cap.

retrieversstring[]optional

Pin the lanes instead of letting the router choose.

fusionFusionConfigoptional

k, semanticWeight, lexicalWeight and graphWeight — override the reciprocal-rank fusion parameters.

Returns

FieldTypePresence
trace_textstringalways

What the read actually did, as text.

total_latency_msfloatalways

Measured, not estimated.

This is the verb for "what did it actually do, and where did the time go". For a trace attached to a normal read instead, ask recall for one — but note the size warning there.

See also
query_explainrecall

Was this page helpful?

query_explain

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

subscribe

Open a live feed of what is landing in a space, and resume it exactly by log position.

On this page

ParametersReturns
Suggest an editOpen in Playground