run-llama/llama_index · error · ValueError

Summary must be set for children indices. If the index does

Error message

Summary must be set for children indices. If the index does a summary (through index.index_struct.summary), then it must be specified with then `index_summaries` argument in this function. We will support automatically setting the summary in the future.

What it means

ComposableGraph.from_indices requires a summary for every child index because summaries become the IndexNode text used for routing queries between sub-indexes. If index_summaries is not passed, it falls back to index.index_struct.summary; any child whose summary is None raises ValueError telling you to pass index_summaries explicitly.

Source

Thrown at llama-index-core/llama_index/core/indices/composability/graph.py:63

        return self._all_indices[self._root_id].index_struct

    @classmethod
    def from_indices(
        cls,
        root_index_cls: Type[BaseIndex],
        children_indices: Sequence[BaseIndex],
        index_summaries: Optional[Sequence[str]] = None,
        storage_context: Optional[StorageContext] = None,
        **kwargs: Any,
    ) -> "ComposableGraph":  # type: ignore
        """Create composable graph using this index class as the root."""
        from llama_index.core import Settings

        with Settings.callback_manager.as_trace("graph_construction"):
            if index_summaries is None:
                for index in children_indices:
                    if index.index_struct.summary is None:
                        raise ValueError(
                            "Summary must be set for children indices. "
                            "If the index does a summary "
                            "(through index.index_struct.summary), then "
                            "it must be specified with then `index_summaries` "
                            "argument in this function. We will support "
                            "automatically setting the summary in the future."
                        )
                index_summaries = [
                    index.index_struct.summary for index in children_indices
                ]
            else:
                # set summaries for each index
                for index, summary in zip(children_indices, index_summaries):
                    index.index_struct.summary = summary

            if len(children_indices) != len(index_summaries):
                raise ValueError("indices and index_summaries must have same length!")

View on GitHub (pinned to afd0fef371)

Solutions

  1. Pass index_summaries=['summary of index 1', 'summary of index 2', ...] matching each child index in order.
  2. Or set the summary on each index before composing: index.index_struct.summary = '...' (then from_indices picks it up).
  3. Use index.as_query_engine on a single index instead if you don't actually need composition.

Example fix

# before
graph = ComposableGraph.from_indices(
    TreeIndex, children_indices=[sales_idx, hr_idx],  # ValueError: no summaries
)

# after
graph = ComposableGraph.from_indices(
    TreeIndex,
    children_indices=[sales_idx, hr_idx],
    index_summaries=[
        "Sales figures and quarterly revenue data",
        "HR policies and employee handbook",
    ],
)
Defensive patterns

Strategy: validation

Validate before calling

if index_summaries is None:
    missing = [i for i in children_indices if i.index_struct.summary is None]
    if missing:
        raise ValueError(f"Pass index_summaries; {len(missing)} indices lack summaries")

Prevention

When it happens

Trigger: Calling ComposableGraph.from_indices(GraphBuilder, indices=[idx1, idx2]) without index_summaries where one index was built without a summary; composing indexes constructed from raw nodes (which never set a summary) instead of from_documents.

Common situations: Multi-document/multi-domain composable graphs where each index covers a corpus; indexes rebuilt via insert() or loaded from storage losing their summary; assuming summaries are auto-generated.

Related errors


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