Find answers from the community

Updated last month

Retrieving Nodes From Vector Store

Hi! I'm trying to get a list of nodes given a bunch of node ids from a given vector store. In testing, however, it seems that the default vector store does not let me do this. I need a cross-store compatible way to do this, but don't know how to accomplish this.
L
s
8 comments
there is a vector_store.get_nodes() method that is slowly being implemented across vector stores (funny enough, the way the default vector store works, this can't really be implemented there)
ah, that's fun. Is there any way to work around this? We're mostly using in memory vector stores for the time being until we get a vector database
At the end of the day it's mostly because I need to update the metadata on a NodeWithScore and push it to update and there doesn't seem to be a way to do that
I'll try adding the missing get_doc_id function to each node and seeing if thatg helps
you could use the docstore (which should be populated, if you are using the default vector store)

all_nodes = index.docstore.docs
one_node = all_nodes['node_id']
Would that work across all vector stores?
Also, thanks for your help
yessss assuming you
  1. set store_nodes_override=True in the constructor
  2. persist and load the docstore somewhere
Add a reply
Sign up and join the conversation on Discord