def _construct_parent_nodes(
        self,
        index_graph: IndexGraph,
        indices: List[int],
        cur_nodes_chunks: List[List[BaseNode]],
        summaries: List[str],
    ) -> Dict[int, str]:
        """
        Construct parent nodes.

        Save nodes to docstore.

        """
        new_node_dict = {}
        for i, cur_nodes_chunk, new_summary in zip(
            indices, cur_nodes_chunks, summaries
        ):
            logger.debug(
                f"> {i}/{len(cur_nodes_chunk)}, "
                f"summary: {truncate_text(new_summary, 50)}"
            )
            new_node = TextNode(text=new_summary)
            index_graph.insert(new_node, children_nodes=cur_nodes_chunk)
            index = index_graph.get_index(new_node)
            new_node_dict[index] = new_node.node_id
            self._docstore.add_documents([new_node], allow_update=False)
        return new_node_dict

        Construct parent nodes.

        Save nodes to docstore.

        
llama-index-core/llama_index/core/indices/common_tree/base.py