{"record":{"id":"914bfcb7b80f613e","repo":"run-llama/llama_index","slug":"delete-node-not-implemented-for-basemanagedindex","errorCode":null,"errorMessage":"_delete_node not implemented for BaseManagedIndex.","messagePattern":"_delete_node not implemented for BaseManagedIndex\\.","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"llama-index-core/llama_index/core/indices/managed/base.py","lineNumber":78,"sourceCode":"    @abstractmethod\n    def update_ref_doc(self, document: Document, **update_kwargs: Any) -> None:\n        \"\"\"Update a document and it's corresponding nodes.\"\"\"\n\n    @abstractmethod\n    def as_retriever(self, **kwargs: Any) -> BaseRetriever:\n        \"\"\"Return a Retriever for this managed index.\"\"\"\n\n    def _build_index_from_nodes(\n        self, nodes: Sequence[BaseNode], **build_kwargs: Any\n    ) -> IndexDict:\n        \"\"\"Build the index from nodes.\"\"\"\n        raise NotImplementedError(\n            \"_build_index_from_nodes not implemented for BaseManagedIndex.\"\n        )\n\n    def _delete_node(self, node_id: str, **delete_kwargs: Any) -> None:\n        \"\"\"Delete a node.\"\"\"\n        raise NotImplementedError(\"_delete_node not implemented for BaseManagedIndex.\")\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(\"ref_doc_info not implemented for BaseManagedIndex.\")\n\n    @classmethod\n    def from_documents(\n        cls: Type[IndexType],\n        documents: Sequence[Document],\n        storage_context: Optional[StorageContext] = None,\n        show_progress: bool = False,\n        callback_manager: Optional[CallbackManager] = None,\n        transformations: Optional[List[TransformComponent]] = None,\n        **kwargs: Any,\n    ) -> IndexType:\n        \"\"\"Build an index from a sequence of documents.\"\"\"\n        raise NotImplementedError(","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/run-llama/llama_index/blob/afd0fef371831f9bda13e5af7167cf4e981278ab/llama-index-core/llama_index/core/indices/managed/base.py#L60-L96","documentation":"BaseManagedIndex represents indices whose data lives in an external service, so local node deletion is not implemented: _delete_node raises NotImplementedError. Any base-class delete flow (delete_ref_doc, delete_nodes) that dispatches to this hook on a managed index aborts with this message.","triggerScenarios":"Calling managed_index.delete_ref_doc(doc_id) or delete_nodes(node_ids) on a BaseManagedIndex subclass that does not override deletion; generic document-lifecycle code run against a managed index.","commonSituations":"Porting sync/delete jobs from local indices to a managed offering; managed integrations that simply never implemented removal; cleanup scripts generic over index registries.","solutions":["Delete documents through the external service's API (the backing vector store / platform) rather than the llama-index delete methods.","Check the concrete managed subclass for an override; if absent, rebuild or re-sync the managed index from your source of truth.","Guard generic delete flows with try/except NotImplementedError or capability checks."],"exampleFix":"# before\nmanaged_index.delete_ref_doc(doc_id)  # NotImplementedError\n\n# after\nmanaged_index.vector_store.delete(doc_id)  # operate on the backing service directly","handlingStrategy":"type-guard","validationCode":"from llama_index.core.indices.managed import BaseManagedIndex\n\nif not isinstance(index, BaseManagedIndex):\n    index.delete_ref_doc(doc_id)\nelse:\n    index.vector_store.delete(doc_id)  # delete via the backing service","typeGuard":"from llama_index.core.indices.managed import BaseManagedIndex\n\ndef supports_local_delete(index: object) -> bool:\n    return not isinstance(index, BaseManagedIndex)","tryCatchPattern":"try:\n    index.delete_nodes(ids)\nexcept NotImplementedError as e:\n    if \"BaseManagedIndex\" in str(e):\n        index.vector_store.delete(ids[0])  # or service-specific delete API\n    else:\n        raise","preventionTips":["For managed indices, perform deletes on the external service directly.","Wrap generic delete jobs with capability checks for managed index types.","Keep an index-type -> supported-ops map in your codebase."],"tags":["llama-index","managed-index","not-implemented","delete"],"backgroundTag":null,"analyzedSha":"afd0fef371831f9bda13e5af7167cf4e981278ab","analyzedAt":"2026-08-15T05:42:58.429Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}