Open ErikVogelLUH opened 7 hours ago
@ErikVogelLUH that is expected. This is a shortcut to connect to a vector index you already created with llama-index
Hey @ErikVogelLUH! 👋 I'm here to help you with any bugs, questions, or contributions.
I found a similar unsolved discussion that might be related to your issue: VectorStoreIndex has empty index because its vectorstore stores_text attribute is true, which was last updated on July 16, 2024 [1].
Regarding your issue, when using the VectorStoreIndex.from_vector_store
method, it is expected that the index is initialized from the existing vector store, provided that the vector store stores text. However, it seems that the method does not automatically build the index from the nodes in the vector store, and you need to manually call build_index_from_nodes
to complete the process [2].
To continue talking to Dosu, mention @dosu.
90% of vector stores store the nodes in the vector store, so that's all you need to "rebuild" the index
How do I properly build the index from the StorageContext?
Bug Description
When a VectorStoreIndex is created, it builds an index from the nodes which are supplied in the constructor. When I want to create a VectorStoreIndex from a VectorStore via VectorStoreIndex.from_vector_store, the node argument of the constructor for the VectorStoreIndex is set to []. Instead the VectorStore is put in a StorageContext which is give to the Index, but the index does not use the Context to build its Index. You have to manually call build_index_from_nodes even though the nodes are already there
Version
0.11.20
Steps to Reproduce
vector_store=SimpleVectorStore() vector_store.add(nodes) index=VectorStoreIndex.from_vector_store(vector_store)
Relevant Logs/Tracbacks
No response