zylon-ai/private-gpt · error · ValueError

No response was generated. Ensure the retriever returns node

Error message

No response was generated. Ensure the retriever returns nodes.

What it means

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.

Source

Thrown at private_gpt/components/workflows/others/summary_query_engine.py:205

            if self._stop_condition_fn:
                full_content = "\n".join(
                    node.get_content() for node in partial_summary_nodes
                )
                if self._stop_condition_fn(full_content):
                    response = Response(
                        response=full_content,
                        source_nodes=source_nodes,
                    )

            # Generate final response
            if response is None:
                response = self.synthesize(
                    query_bundle=query_bundle,
                    nodes=source_nodes,
                )

            if response is None:
                raise ValueError(
                    "No response was generated. Ensure the retriever returns nodes."
                )

            query_event.on_end(payload={EventPayload.RESPONSE: response})
            return response

    async def _aquery(self, query_bundle: QueryBundle) -> RESPONSE_TYPE:
        with self.callback_manager.event(
            CBEventType.QUERY, payload={EventPayload.QUERY_STR: query_bundle.query_str}
        ) as query_event:
            nodes_gen = await self._retriever.aretriever(query_bundle)
            partial_summary_nodes: list[BaseNode] = []

            async for node in map_elements_in_parallel(
                nodes_gen,
                lambda n: self.agenerate_summary_nodes(query_bundle, n),
                num_workers=self._num_workers,
            ):

View on GitHub (pinned to 4a030776a3)

Solutions

  1. Verify documents are ingested and the vector store the retriever uses is non-empty (check index doc counts).
  2. Test the retriever directly with the same query bundle and inspect len(nodes); loosen similarity_cutoff / top_k / filters if empty.
  3. 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.
  4. For structured (map-reduce partial summary) paths, confirm the partial-summary branch condition actually triggers when nodes exist.

Example fix

# before
response = self.synthesize(query_bundle=query_bundle, nodes=source_nodes)
if response is None:
    raise ValueError("No response was generated. Ensure the retriever returns nodes.")

# after
nodes = await self._retriever.aretriever(query_bundle)
if not nodes:
    return Response(response="No relevant content found to summarize.")
response = self.synthesize(query_bundle=query_bundle, nodes=nodes)
Defensive patterns

Strategy: validation

Validate before calling

nodes = await engine._retriever.aretriever(query_bundle)
if not nodes:
    return Response(response='No relevant content found to summarize.')

Type guard

def engine_has_nodes(engine, qb: QueryBundle) -> bool:
    return len(engine._retriever.retrieve(qb)) > 0

Try / catch

except ValueError as e:
    if 'Ensure the retriever returns nodes' in str(e):
        return Response(response=EMPTY_SUMMARY_MESSAGE)
    raise

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of zylon-ai/private-gpt@4a030776a3 (2026-08-15). Data as JSON: /api/errors/8f7238aad7c5f1f8. Report an issue: GitHub.