Brain Docs

Reference

TypeScript SDKInstallationHTTP clientWire client
planreasonmaterializeProceduralqueryExplainqueryTrace
ErrorsRetriesPagination
Brain/Docs
✦ ASKBrain on GitHubDashboard
TypeScript SDKReasoningqueryTrace

queryTrace

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 queryExplain, this costs what the query costs.

POST/v1/query/traceBearer API keystable
queryTrace(input: QueryInput): Promise<QueryTraceResult>
Handshake credentialstable
queryTrace(request: QueryTraceRequest): Promise<QueryTraceResponse>

Parameters

ParameterTypeRequired
textstringrequired

The query text.

entityAnchorstringoptional

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.

timeRangeTimeRangeoptional

fromUnixMs and toUnixMs, both optional.

asOfRecordTimeUnixNanos64-bit integeroptional

Read the space as it stood at that record time.

confidenceMinfloatoptional

Confidence floor.

includeTombstonedbooleanoptional

Defaults to false.

includeSupersededbooleanoptional

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
traceTextstringalways

What the read actually did, as text.

totalLatencyMsfloatalways

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
queryExplainrecall

Was this page helpful?

queryExplain

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