query_explain
See the plan Brain would run for a query, and its estimated cost — without running it.
query_explain(text: str, **filters) -> QueryExplainResultquery_explain(request: QueryExplainRequest) -> QueryExplainResponseParameters
textstringrequiredThe query text.
entity_anchorstringoptionalAnchor the graph retriever on an entity.
kindsstring[]optionalRestrict to these memory kinds.
predicatesstring[]optionalRestrict to these predicates.
sessions64-bit integer[]optionalRestrict to these sessions.
time_rangeTimeRangeoptionalfromUnixMs and toUnixMs, both optional.
as_of_record_time_unix_nanos64-bit integeroptionalRead the space as it stood at that record time.
confidence_minfloatoptionalConfidence floor.
include_tombstonedbooleanoptionalDefaults to false.
include_supersededbooleanoptionalDefaults to false.
limitintegeroptionalResult cap.
retrieversstring[]optionalPin the lanes instead of letting the router choose.
fusionFusionConfigoptionalk, semanticWeight, lexicalWeight and graphWeight — override the reciprocal-rank fusion parameters.
Returns
plan_textstringalwaysThe plan, as text.
estimated_cost_msfloatalwaysWhat the planner thinks it would cost.
Pin retrievers and call this to ask "what would this plan cost".
Leave retrievers unset to ask "what would the router pick today". The
second answer changes as the space grows; the first does not.
The wire request wraps a full QueryRequest under a query field.
Was this page helpful?