Okay, thanks for your patience. So it seems to me that you're using
SummaryIndex
as the root BaseIndex type. Perhaps building it using pseudo-code like
graph = ComposableGraph.from_indices(
SummaryIndex,
[index1, ..., index20]
index_summaries=[idx1_summary, ..., idx2_summary]
storage_context=storage_context
)
If this is true, then for the root
SummaryIndex
, the default retriever mode, it will use
SummaryIndexRetriever
that just retrieves all of the nodes -- in this case all of the 20 index. Based on what you're describing, I feel like you're using default retriever mode.
You can do some "routing" based upon the summary texts. Depends on what kind of logic you would like to use. If you change retriever mode to
retriever_mode=embedding
then it will perform a top-k similarity between the query and the summary_index and use only the top-k retrieved documents/nodes to answer the query.