{"record":{"id":"8f7238aad7c5f1f8","repo":"zylon-ai/private-gpt","slug":"no-response-was-generated-ensure-the-retriever-re","errorCode":null,"errorMessage":"No response was generated. Ensure the retriever returns nodes.","messagePattern":"No response was generated\\. Ensure the retriever returns nodes\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"private_gpt/components/workflows/others/summary_query_engine.py","lineNumber":205,"sourceCode":"            if self._stop_condition_fn:\n                full_content = \"\\n\".join(\n                    node.get_content() for node in partial_summary_nodes\n                )\n                if self._stop_condition_fn(full_content):\n                    response = Response(\n                        response=full_content,\n                        source_nodes=source_nodes,\n                    )\n\n            # Generate final response\n            if response is None:\n                response = self.synthesize(\n                    query_bundle=query_bundle,\n                    nodes=source_nodes,\n                )\n\n            if response is None:\n                raise ValueError(\n                    \"No response was generated. Ensure the retriever returns nodes.\"\n                )\n\n            query_event.on_end(payload={EventPayload.RESPONSE: response})\n            return response\n\n    async def _aquery(self, query_bundle: QueryBundle) -> RESPONSE_TYPE:\n        with self.callback_manager.event(\n            CBEventType.QUERY, payload={EventPayload.QUERY_STR: query_bundle.query_str}\n        ) as query_event:\n            nodes_gen = await self._retriever.aretriever(query_bundle)\n            partial_summary_nodes: list[BaseNode] = []\n\n            async for node in map_elements_in_parallel(\n                nodes_gen,\n                lambda n: self.agenerate_summary_nodes(query_bundle, n),\n                num_workers=self._num_workers,\n            ):","sourceCodeStart":187,"sourceCodeEnd":223,"githubUrl":"https://github.com/zylon-ai/private-gpt/blob/4a030776a31a901ad80b1bf4d7faa2c1a367efbb/private_gpt/components/workflows/others/summary_query_engine.py#L187-L223","documentation":"Raised by SummaryQueryEngine._query/_aquery after both the partial-summaries path and self.synthesize(...) returned None. The engine treats a None synthesis as a retrieval/synthesis failure and tells you the most common root cause: the retriever gave back no source nodes, so there was nothing to summarize.","triggerScenarios":"Retriever returns an empty node list for the query bundle AND synthesize(nodes=[]) yields None; vector index empty (no ingested documents); filters excluding all nodes; synthesize() overridden to return None on empty input.","commonSituations":"Summarizing before ingestion completes; index cleared or pointed at the wrong storage; metadata filters that exclude every chunk; embeddings mismatch making all scores fall below top_k/similarity cutoff.","solutions":["Verify documents are ingested and the vector store the retriever uses is non-empty (check index doc counts).","Test the retriever directly with the same query bundle and inspect len(nodes); loosen similarity_cutoff / top_k / filters if empty.","If synthesize() is custom, make it return a Response (even an empty-text one) instead of None for empty node lists, or pre-check and return a fallback Response.","For structured (map-reduce partial summary) paths, confirm the partial-summary branch condition actually triggers when nodes exist."],"exampleFix":"# before\nresponse = self.synthesize(query_bundle=query_bundle, nodes=source_nodes)\nif response is None:\n    raise ValueError(\"No response was generated. Ensure the retriever returns nodes.\")\n\n# after\nnodes = await self._retriever.aretriever(query_bundle)\nif not nodes:\n    return Response(response=\"No relevant content found to summarize.\")\nresponse = self.synthesize(query_bundle=query_bundle, nodes=nodes)","handlingStrategy":"validation","validationCode":"nodes = await engine._retriever.aretriever(query_bundle)\nif not nodes:\n    return Response(response='No relevant content found to summarize.')","typeGuard":"def engine_has_nodes(engine, qb: QueryBundle) -> bool:\n    return len(engine._retriever.retrieve(qb)) > 0","tryCatchPattern":"except ValueError as e:\n    if 'Ensure the retriever returns nodes' in str(e):\n        return Response(response=EMPTY_SUMMARY_MESSAGE)\n    raise","preventionTips":["Health-check the vector index (doc/node counts) before serving summarize requests","Ingest and wait for index persistence before enabling the endpoint","Loosen over-aggressive similarity filters in retriever config"],"tags":["retriever","empty-index","llama-index","summarization"],"backgroundTag":null,"analyzedSha":"4a030776a31a901ad80b1bf4d7faa2c1a367efbb","analyzedAt":"2026-08-15T03:51:26.951Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}