Find answers from the community

Updated 9 months ago

Hi folks, a quick question I'm

Hi folks, a quick question I'm struggling to answer through my own research and attempts at reading the docs. I have some code (please forgive the lack of formatting, I'm on my phone)...

def get_query_engine(docs):
index=VectorStoreIndex.from_documents(docs, show_progress=True)
return index.as_query_engine(similarity_top_k=5, response_mode='compact')
It works just fine, but I would like to retrieve/get the arrays/lists of embeddings from the index variable.
The doc is chunked up and there are embeddings in there but I can't seem to find the syntax to access them.
I can run the embeddings myself no problem but I'm using LlamaIndex now and can't seem to access them.
Thanks in advance.
W
J
L
6 comments
You want to retrieve the embeddings of the retrived source_nodes?
Ideally yes, I have some code that plots them. I can easily do this if I manage my own embeddings but can't seem to find out how to retrieve the embeddings through the VectorStoreIndex.
I don't think there is a way, at least with the default vector store. The em embeddings are never reattached to the nodes
You'd have to access the underlying data structure
index.vector_store._data.embedding_dict[node.id_]
Add a reply
Sign up and join the conversation on Discord