run-llama/llama_index · error · NotImplementedError
Vector store integrations that store text in the vector stor
Error message
Vector store integrations that store text in the vector store are not supported by ref_doc_info yet.
What it means
VectorStoreIndex.ref_doc_info raises NotImplementedError when the index's vector store has stores_text=True. When text lives in the vector store, ref-doc metadata (node ids, metadata per source doc) is not mirrored into the local docstore, and the framework has not implemented fetching it from the store, so the property refuses rather than returning wrong/empty data. With stores_text=False the property works via self.docstore.get_ref_doc_info.
Source
Thrown at llama-index-core/llama_index/core/indices/vector_store/base.py:481
"""Retrieve a dict mapping of ingested documents and their nodes+metadata."""
if not self._vector_store.stores_text or self._store_nodes_override:
node_doc_ids = list(self.index_struct.nodes_dict.values())
nodes = self.docstore.get_nodes(node_doc_ids)
all_ref_doc_info = {}
for node in nodes:
ref_node = node.source_node
if not ref_node:
continue
ref_doc_info = self.docstore.get_ref_doc_info(ref_node.node_id)
if not ref_doc_info:
continue
all_ref_doc_info[ref_node.node_id] = ref_doc_info
return all_ref_doc_info
else:
raise NotImplementedError(
"Vector store integrations that store text in the vector store are "
"not supported by ref_doc_info yet."
)
GPTVectorStoreIndex = VectorStoreIndex
View on GitHub (pinned to afd0fef371)
Solutions
- Track source documents yourself at insert time (you receive node ids from index.insert/ref_doc_id) instead of querying ref_doc_info.
- If you need the property, use a stores_text=False configuration with a docstore (StorageContext with your own docstore) so ref-doc info lives locally.
- Guard access: check index.vector_store.stores_text before touching ref_doc_info.
Example fix
# before
info = index.ref_doc_info # NotImplementedError when stores_text=True
# after
if index.vector_store.stores_text:
info = {d.id_: d.metadata for d in my_tracked_docs} # tracked at insert time
else:
info = index.ref_doc_info Defensive patterns
Strategy: type-guard
Validate before calling
def ref_doc_info_safe(index):
if index.vector_store.stores_text:
return None # not supported for text-storing vector stores
return index.ref_doc_info Type guard
def supports_ref_doc_info(index) -> bool:
return not index.vector_store.stores_text Try / catch
try:
info = index.ref_doc_info
except NotImplementedError:
info = None # fall back to your own ingestion-time tracking Prevention
- Record source doc ids and metadata yourself at insert() time; do not rely on ref_doc_info for stores_text=True indexes.
- Branch on index.vector_store.stores_text in generic admin tooling.
- If ref_doc_info is essential, configure a docstore-backed (stores_text=False) deployment.
When it happens
Trigger: Reading index.ref_doc_info on an index backed by a stores_text=True store (default in-memory SimpleVectorStore path, most managed integrations); generic admin/dedup tooling that enumerates ingested docs via ref_doc_info across index types.
Common situations: Building a document-management dashboard that lists source docs; checking ingestion status after insert; code written against a docstore-backed index reused on a text-storing store.
Related errors
- ref_doc_info not implemented for BaseManagedIndex.
- Must provide either user_msg or chat_history
- No tool calls found, cannot aggregate results.
- Cannot insert into an empty index.
- Cannot delete from an empty index.
AI-assisted analysis of run-llama/llama_index@afd0fef371 (2026-08-15).
Data as JSON: /api/errors/43b98e2b0a2b64d8.
Report an issue: GitHub.