{"record":{"id":"96e66f0022dda75c","repo":"run-llama/llama_index","slug":"missing-query-bundle-in-extra-info","errorCode":null,"errorMessage":"Missing query bundle in extra info.","messagePattern":"Missing query bundle in extra info\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"llama-index-core/llama_index/core/postprocessor/node_recency.py","lineNumber":70,"sourceCode":"    @classmethod\n    def class_name(cls) -> str:\n        return \"FixedRecencyPostprocessor\"\n\n    def _postprocess_nodes(\n        self,\n        nodes: List[NodeWithScore],\n        query_bundle: Optional[QueryBundle] = None,\n    ) -> List[NodeWithScore]:\n        \"\"\"Postprocess nodes.\"\"\"\n        try:\n            import pandas as pd\n        except ImportError:\n            raise ImportError(\n                \"pandas is required for this function. Please install it with `pip install pandas`.\"\n            )\n\n        if query_bundle is None:\n            raise ValueError(\"Missing query bundle in extra info.\")\n\n        # sort nodes by date\n        node_dates = pd.to_datetime(\n            [node.node.metadata[self.date_key] for node in nodes]\n        )\n        sorted_node_idxs = np.flip(node_dates.argsort())\n        sorted_nodes = [nodes[idx] for idx in sorted_node_idxs]\n\n        return sorted_nodes[: self.top_k]\n\n\nDEFAULT_QUERY_EMBEDDING_TMPL = (\n    \"The current document is provided.\\n\"\n    \"----------------\\n\"\n    \"{context_str}\\n\"\n    \"----------------\\n\"\n    \"Given the document, we wish to find documents that contain \\n\"\n    \"similar context. Note that these documents are older \"","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/run-llama/llama_index/blob/afd0fef371831f9bda13e5af7167cf4e981278ab/llama-index-core/llama_index/core/postprocessor/node_recency.py#L52-L88","documentation":"Error \"Missing query bundle in extra info.\" thrown in run-llama/llama_index.","triggerScenarios":"Thrown at llama-index-core/llama_index/core/postprocessor/node_recency.py:70 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Include the query bundle in extra info when calling the recency postprocessor.","Use the postprocessor through a query engine so the query bundle is attached automatically."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"afd0fef371831f9bda13e5af7167cf4e981278ab","analyzedAt":"2026-08-15T05:42:58.429Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}