----------------------
Yes, you need to store your
IndexNodes
into Qdrant. The
VectorStoreIndex
class is used to create an index of your nodes, which are then stored in Qdrant. This is done by passing your nodes and the
StorageContext
(which includes your Qdrant client) to the
VectorStoreIndex
constructor, as you've done in your code.
However, the error message you're seeing suggests that the query id you're trying to retrieve is not found in either the
retriever_dict
or
query_engine_dict
. This could be because the
IndexNode
with that id was not included when you created your
VectorStoreIndex
, or it could be a problem with how you've set up your
RecursiveRetriever
.
In your
RecursiveRetriever
instantiation, you're passing a dictionary with the key "vector" and the value
vector_retriever_chunk
to the
retriever_dict
parameter. This means that when you try to retrieve a node, the
RecursiveRetriever
will look for a retriever with the id "vector" in the
retriever_dict
. If the id of the node you're trying to retrieve is not "vector", you'll get a
ValueError
.
To fix this, you need to make sure that the ids of the nodes you're trying to retrieve match the keys in your
retriever_dict
. For example, if you're trying to retrieve a node with the id "e7cec67d-e470-4ee7-a737-5f765c4fea27", you should have a retriever with that id in your
retriever_dict
.
Here's an example of how you might do this:
# Create a dictionary mapping node ids to retrievers
retriever_dict = {node.node_id: vector_retriever_chunk for node in all_nodes}
# Instantiate the RecursiveRetriever
recursive_retriever = RecursiveRetriever("vector", retriever_dict=retriever_dict)