Find answers from the community

Updated 6 months ago

Can I get node text by node ID in

At a glance

The community member is asking how to get the embedded vector of a node in a VectorStoreIndex, given the node's text and ID. Another community member responds that if the embeddings have been generated locally, the embeddings can be accessed through the index.vector_store._data.embedding_dict dictionary. However, there is no explicitly marked answer in the comments.

Can I get node text by node ID in VectorStoreIndex?
I create a index like this, I know text and ID of a node. How may I get embedded vector of this node?
Plain Text
index = VectorStoreIndex(
        nodes, embed_model=embed_model, show_progress=True
    )
W
1 comment
You can get the embedding like this if you have generated embeddings locally.

Plain Text
index = VectorStoreIndex.from_documents([Document(text="text")])

print(index.vector_store._data.embedding_dict)


it will give you a dict
Add a reply
Sign up and join the conversation on Discord