{"record":{"id":"a165a0147464ac11","repo":"run-llama/llama_index","slug":"cannot-initialize-from-a-vector-store-that-does-no-a165a0","errorCode":null,"errorMessage":"Cannot initialize from a vector store that does not store text.","messagePattern":"Cannot initialize from a vector store that does not store text\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"llama-index-core/llama_index/core/indices/vector_store/base.py","lineNumber":94,"sourceCode":"            nodes=nodes,\n            index_struct=index_struct,\n            storage_context=storage_context,\n            show_progress=show_progress,\n            objects=objects,\n            callback_manager=callback_manager,\n            transformations=transformations,\n            **kwargs,\n        )\n\n    @classmethod\n    def from_vector_store(\n        cls,\n        vector_store: BasePydanticVectorStore,\n        embed_model: Optional[EmbedType] = None,\n        **kwargs: Any,\n    ) -> \"VectorStoreIndex\":\n        if not vector_store.stores_text:\n            raise ValueError(\n                \"Cannot initialize from a vector store that does not store text.\"\n            )\n\n        kwargs.pop(\"storage_context\", None)\n        storage_context = StorageContext.from_defaults(vector_store=vector_store)\n\n        return cls(\n            nodes=[],\n            embed_model=embed_model,\n            storage_context=storage_context,\n            **kwargs,\n        )\n\n    @property\n    def vector_store(self) -> BasePydanticVectorStore:\n        return self._vector_store\n\n    def as_retriever(self, **kwargs: Any) -> BaseRetriever:","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/run-llama/llama_index/blob/afd0fef371831f9bda13e5af7167cf4e981278ab/llama-index-core/llama_index/core/indices/vector_store/base.py#L76-L112","documentation":"VectorStoreIndex.from_vector_store raises ValueError('Cannot initialize from a vector store that does not store text.') when vector_store.stores_text is False. This classmethod builds an index purely from a vector store with empty nodes, which only works if the store can return full text nodes at query time; stores like Chroma in some modes, or metadata-only configurations, keep only embeddings+ids and rely on a local docstore, so they cannot back a from_vector_store round trip.","triggerScenarios":"VectorStoreIndex.from_vector_store(my_store) where my_store.stores_text is False — typical for some community integrations or custom stores; switching an integration version whose stores_text default flipped to False; constructing a fresh index object over a pre-populated id-only store.","commonSituations":"Pointing llama-index at an externally populated vector DB that never stored node text; upgrading integration packages where stores_text became accurate/False; custom BasePydanticVectorStore subclasses forgetting to set stores_text=True when they do store text.","solutions":["If the store actually holds node payloads, set stores_text=True on it (custom stores) or upgrade the integration that reported it wrong.","If text genuinely lives elsewhere, build the index with a docstore-backed flow: VectorStoreIndex(nodes, storage_context=StorageContext.from_defaults(vector_store=store, docstore=docstore)) instead of from_vector_store.","For a fresh start, ingest through llama-index so nodes are stored, then re-check stores_text."],"exampleFix":"# before\nindex = VectorStoreIndex.from_vector_store(store)  # store.stores_text == False\n\n# after\nfrom llama_index.core.storage.storage_context import StorageContext\nstorage = StorageContext.from_defaults(vector_store=store, docstore=docstore)\nindex = VectorStoreIndex(nodes=[], storage_context=storage)","handlingStrategy":"type-guard","validationCode":"def can_init_from_vector_store(store) -> bool:\n    return bool(getattr(store, \"stores_text\", False))","typeGuard":"from llama_index.core.vector_stores.types import BasePydanticVectorStore\n\ndef stores_text(store: BasePydanticVectorStore) -> bool:\n    return bool(store.stores_text)","tryCatchPattern":null,"preventionTips":["Check vector_store.stores_text before calling VectorStoreIndex.from_vector_store.","For id-only stores, build the index via StorageContext with an explicit docstore instead.","Custom store authors: set stores_text=True only if the store actually returns full text nodes."],"tags":["vector-store","storage","config","llama-index"],"backgroundTag":null,"analyzedSha":"afd0fef371831f9bda13e5af7167cf4e981278ab","analyzedAt":"2026-08-15T05:42:58.429Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}