run-llama/llama_index · error · ValueError

Query bundle must be provided.

Error message

Query bundle must be provided.

What it means

Error "Query bundle must be provided." thrown in run-llama/llama_index.

Source

Thrown at llama-index-core/llama_index/core/postprocessor/structured_llm_rerank.py:158

    def class_name(cls) -> str:
        return "StructuredLLMRerank"

    def _postprocess_nodes(
        self,
        nodes: List[NodeWithScore],
        query_bundle: Optional[QueryBundle] = None,
    ) -> List[NodeWithScore]:
        dispatcher.event(
            ReRankStartEvent(
                query=query_bundle,
                nodes=nodes,
                top_n=self.top_n,
                model_name=self.llm.metadata.model_name,
            )
        )

        if query_bundle is None:
            raise ValueError("Query bundle must be provided.")
        if len(nodes) == 0:
            return []

        initial_results: List[NodeWithScore] = []
        with self.callback_manager.event(
            CBEventType.RERANKING,
            payload={
                EventPayload.NODES: nodes,
                EventPayload.MODEL_NAME: self.llm.metadata.model_name,
                EventPayload.QUERY_STR: query_bundle.query_str,
                EventPayload.TOP_K: self.top_n,
            },
        ) as event:
            for idx in range(0, len(nodes), self.choice_batch_size):
                nodes_batch = [
                    node.node for node in nodes[idx : idx + self.choice_batch_size]
                ]

View on GitHub (pinned to afd0fef371)

Solutions

  1. Pass a query_bundle to the StructuredLLMRerank postprocessor.
  2. Ensure the query bundle is forwarded by the calling query engine.

When it happens

Trigger: Thrown at llama-index-core/llama_index/core/postprocessor/structured_llm_rerank.py:158 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of run-llama/llama_index@afd0fef371 (2026-08-15). Data as JSON: /api/errors/1493e82d03a69668. Report an issue: GitHub.