{"record":{"id":"7710f60169a88c3e","repo":"run-llama/llama_index","slug":"struct-store-index-does-not-support-ref-doc-info","errorCode":null,"errorMessage":"Struct Store Index does not support ref_doc_info.","messagePattern":"Struct Store Index does not support ref_doc_info\\.","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"llama-index-core/llama_index/core/indices/struct_store/base.py","lineNumber":68,"sourceCode":"        \"\"\"Initialize params.\"\"\"\n        self.schema_extract_prompt = (\n            schema_extract_prompt or DEFAULT_SCHEMA_EXTRACT_PROMPT\n        )\n        self.output_parser = output_parser or default_output_parser\n        super().__init__(\n            nodes=nodes,\n            index_struct=index_struct,\n            **kwargs,\n        )\n\n    def _delete_node(self, node_id: str, **delete_kwargs: Any) -> None:\n        \"\"\"Delete a node.\"\"\"\n        raise NotImplementedError(\"Delete not implemented for Struct Store Index.\")\n\n    @property\n    def ref_doc_info(self) -> Dict[str, RefDocInfo]:\n        \"\"\"Retrieve a dict mapping of ingested documents and their nodes+metadata.\"\"\"\n        raise NotImplementedError(\"Struct Store Index does not support ref_doc_info.\")\n","sourceCodeStart":50,"sourceCodeEnd":69,"githubUrl":"https://github.com/run-llama/llama_index/blob/afd0fef371831f9bda13e5af7167cf4e981278ab/llama-index-core/llama_index/core/indices/struct_store/base.py#L50-L69","documentation":"StructStoreIndex does not track which nodes came from which source document — its index struct holds table containers built from a database/schema, not per-document node mappings — so the ref_doc_info property always raises NotImplementedError.","triggerScenarios":"Accessing index.ref_doc_info (or calling helpers like index.delete_ref_doc / document-tracking utilities that consult it) on GPTSQLStructStoreIndex, GPTJSONIndex, or other StructStoreIndex subclasses.","commonSituations":"Porting ingestion/audit dashboards from VectorStoreIndex that enumerate ref_doc_info; generic code that lists ingested documents across mixed indexes.","solutions":["Remove ref_doc_info usage for struct-store indexes; source-of-truth is the underlying SQL database or JSON document","Track ingested sources yourself (e.g. persist the list of tables/JSON docs you built the index from)","Use VectorStoreIndex when per-document provenance is required"],"exampleFix":"# before\ninfo = index.ref_doc_info  # raises on StructStoreIndex\n\n# after\ntables = index.sql_database.get_usable_table_names()  # introspect source instead","handlingStrategy":"type-guard","validationCode":"from llama_index.core.indices.struct_store.base import StructStoreIndex\nif isinstance(index, StructStoreIndex):\n    sources = index.sql_database.get_usable_table_names()\nelse:\n    info = index.ref_doc_info","typeGuard":"def has_ref_doc_info(index) -> bool:\n    from llama_index.core.indices.struct_store.base import StructStoreIndex\n    from llama_index.core.indices.property_graph import PropertyGraphIndex\n    return not isinstance(index, (StructStoreIndex, PropertyGraphIndex))","tryCatchPattern":"try:\n    info = index.ref_doc_info\nexcept NotImplementedError:\n    info = {}  # struct-store indexes track no per-doc info","preventionTips":["Do not assume a uniform ref_doc_info contract across index types","Keep your own ingestion ledger for provenance-critical applications"],"tags":["llama-index","struct-store","not-implemented","api-limitation"],"backgroundTag":null,"analyzedSha":"afd0fef371831f9bda13e5af7167cf4e981278ab","analyzedAt":"2026-08-15T05:42:58.429Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}