{"record":{"id":"c5af0a410cb925a4","repo":"run-llama/llama_index","slug":"summary-must-be-set-for-children-indices-if-the-i","errorCode":null,"errorMessage":"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.","messagePattern":"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\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"llama-index-core/llama_index/core/indices/composability/graph.py","lineNumber":63,"sourceCode":"        return self._all_indices[self._root_id].index_struct\n\n    @classmethod\n    def from_indices(\n        cls,\n        root_index_cls: Type[BaseIndex],\n        children_indices: Sequence[BaseIndex],\n        index_summaries: Optional[Sequence[str]] = None,\n        storage_context: Optional[StorageContext] = None,\n        **kwargs: Any,\n    ) -> \"ComposableGraph\":  # type: ignore\n        \"\"\"Create composable graph using this index class as the root.\"\"\"\n        from llama_index.core import Settings\n\n        with Settings.callback_manager.as_trace(\"graph_construction\"):\n            if index_summaries is None:\n                for index in children_indices:\n                    if index.index_struct.summary is None:\n                        raise ValueError(\n                            \"Summary must be set for children indices. \"\n                            \"If the index does a summary \"\n                            \"(through index.index_struct.summary), then \"\n                            \"it must be specified with then `index_summaries` \"\n                            \"argument in this function. We will support \"\n                            \"automatically setting the summary in the future.\"\n                        )\n                index_summaries = [\n                    index.index_struct.summary for index in children_indices\n                ]\n            else:\n                # set summaries for each index\n                for index, summary in zip(children_indices, index_summaries):\n                    index.index_struct.summary = summary\n\n            if len(children_indices) != len(index_summaries):\n                raise ValueError(\"indices and index_summaries must have same length!\")\n","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/run-llama/llama_index/blob/afd0fef371831f9bda13e5af7167cf4e981278ab/llama-index-core/llama_index/core/indices/composability/graph.py#L45-L81","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Pass index_summaries=['summary of index 1', 'summary of index 2', ...] matching each child index in order.","Or set the summary on each index before composing: index.index_struct.summary = '...' (then from_indices picks it up).","Use index.as_query_engine on a single index instead if you don't actually need composition."],"exampleFix":"# before\ngraph = ComposableGraph.from_indices(\n    TreeIndex, children_indices=[sales_idx, hr_idx],  # ValueError: no summaries\n)\n\n# after\ngraph = ComposableGraph.from_indices(\n    TreeIndex,\n    children_indices=[sales_idx, hr_idx],\n    index_summaries=[\n        \"Sales figures and quarterly revenue data\",\n        \"HR policies and employee handbook\",\n    ],\n)","handlingStrategy":"validation","validationCode":"if index_summaries is None:\n    missing = [i for i in children_indices if i.index_struct.summary is None]\n    if missing:\n        raise ValueError(f\"Pass index_summaries; {len(missing)} indices lack summaries\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass index_summaries explicitly when composing graphs.","Store each child index's summary next to its config so they travel together."],"tags":["composable-graph","validation","summaries"],"backgroundTag":null,"analyzedSha":"afd0fef371831f9bda13e5af7167cf4e981278ab","analyzedAt":"2026-08-15T05:42:58.429Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}