Find answers from the community

Updated 2 years ago

Hi everyone

Hi everyone!
I'm trying composability of indexes, based on https://gpt-index.readthedocs.io/en/latest/guides/use_cases.html#use-case-combining-information-across-multiple-indices

index1 = GPTSimpleVectorIndex(notion_docs) index2 = GPTSimpleVectorIndex(slack_docs) # Set summary text # you can set the summary manually, or you can # generate the summary itself using LlamaIndex index1.set_text("summary1") index2.set_text("summary2") index3 = GPTListIndex([index1, index2]) response = index3.query("<query_str>", mode="recursive", query_configs=...)

I understand that in the example, when I do index3.query, it uses the summary of each subindex to select which one to use.
But what I need is just search across both indexes, and get the best choice based on similarity, as if it is just one unique index.
Am I doing something wrong?
L
G
4 comments
Since you have a list index, it will check each sub-index and get the closest matching node from each

So, it will end up sending two nodes to the LLM in total (unless you change the top_k).

Is this not working for you?
But I still need the summary for each subindex?
When using a list index at the top level, the summary can be anything (as it's not technically used as far as I know)
Ok, I'll check it out, thanks again!
Add a reply
Sign up and join the conversation on Discord