----------------------
Yes, you can query from all of the indices and use information from all three indices to formulate an answer by composing a graph over your existing data. Specifically, you can compose a
GPTListIndex
over your subindices. A list index inherently combines information for each node, allowing it to synthesize information across your heterogeneous data sources.
Here's an example of how to compose a graph with a
GPTListIndex
over your subindices:
from llama_index import GPTSimpleVectorIndex, GPTListIndex
from llama_index.indices.composability import ComposableGraph
index1 = GPTSimpleVectorIndex.from_documents(notion_docs) # Replace with your List index
index2 = GPTSimpleVectorIndex.from_documents(slack_docs) # Replace with your Vector index
index3 = GPTSimpleKeywordTableIndex.from_documents(...) # Replace with your Keyword Table index
graph = ComposableGraph.from_indices(GPTListIndex, [index1, index2, index3], index_summaries=["summary1", "summary2", "summary3"])
response = graph.query("<query_str>", mode="recursive", query_configs=...)
For more information, refer to the
Synthesis over Heterogeneous Data (
https://gpt-index.readthedocs.io/en/latest/use_cases/queries.html#synthesis-over-heterogeneous-data) section in the documentation.
----------------------
Note: you can ask me a follow up question by @ mentioning me again
:speech_balloon:
----------------------