Bug Description
Hi,
I have created multiple indexes, each covering different set of nodes. I am then using one of the indexes to retrieve nodes based on a query. However, it seems that the retriever is trying to process nodes that are out of the context of the specific index that I have provided, causing a KeyError exception in this line in llama_index/indices/vector_store/retrievers/retriever.py:
self._index.index_struct.nodes_dict[idx] for idx in query_result.ids
I noticed that it is possible to send list of node_ids to retrieve in order to constraint it. Haven't tried it yet and I guess that it will work. However, I believe that it is better if the retrieve function itself verifies that only nodes that are covered by the provided index are processed.
Thanks!
Guy
Version
0.8.5.post2
Steps to Reproduce
- Create doc store with X nodes (e.g. 100)
- Create index that covers only part of the nodes (e.g. 10)
- Use the created index to create a Retriever: retriever = VectorIndexRetriever(my_index)
- Call retrieve with a question: nodes = retriever.retrieve("This is my question")
If the query returns nodes that are excluded from the provided index, KeyError exception occurs
Relevant Logs/Tracbacks
No response
Bug Description
Hi,
I have created multiple indexes, each covering different set of nodes. I am then using one of the indexes to retrieve nodes based on a query. However, it seems that the retriever is trying to process nodes that are out of the context of the specific index that I have provided, causing a KeyError exception in this line in llama_index/indices/vector_store/retrievers/retriever.py:
self._index.index_struct.nodes_dict[idx] for idx in query_result.ids
I noticed that it is possible to send list of node_ids to retrieve in order to constraint it. Haven't tried it yet and I guess that it will work. However, I believe that it is better if the retrieve function itself verifies that only nodes that are covered by the provided index are processed.
Thanks!
Guy
Version
0.8.5.post2
Steps to Reproduce
If the query returns nodes that are excluded from the provided index, KeyError exception occurs
Relevant Logs/Tracbacks
No response