Find answers from the community

Updated 10 months ago

AFAIK what is needed from that dict is a

AFAIK what is needed from that dict is a mapping from the Vector Store chunk retrieved id to a BaseNode concretely in the example, an IndexNode
L
j
s
15 comments
Yea thats right. Is the question just about how to persist that data? Or how to build that dict?
@Logan M yes, I might need to persist that. To be able to create that dict.
is there any construct currently in llama index or do I need to build it to persist ?
memory wise I think it can be a challenge. I imagine a callable connected to some persistance to be able to scale. am I missing something?
Not currently -- persistance is up to you
Yea thats a good point. I wonder if a class that implements __getitem__ that calls to like redis or something, instead of an actual dict, would work well?
yeah, AFAIK what needs to work is this line :

node = self._node_dict.get(query_id, None)
so it might need a get function. AFAIK __getitem__ will only make [] this work
"something" that implements protocol with a get will do it.
@Logan M is there any functionality to save nodes ?
AFAIK you can use VectorStoreIndex to save the nodes and persist them. Later you can use load_index_from_storage to load from the persist_dir and then get nodes and build the node dict required for the RecursiveRetriever. Here is a github example : https://github.com/run-llama/llama_index/discussions/8930
the docstore is made to save and hold nodes
The vector store holds nodes as well, but that kind of assumes you want them embedded
Add a reply
Sign up and join the conversation on Discord