run-llama/llama_index · error · NotImplementedError

_delete_node not implemented for BaseManagedIndex.

Error message

_delete_node not implemented for BaseManagedIndex.

What it means

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.

Source

Thrown at llama-index-core/llama_index/core/indices/managed/base.py:78

    @abstractmethod
    def update_ref_doc(self, document: Document, **update_kwargs: Any) -> None:
        """Update a document and it's corresponding nodes."""

    @abstractmethod
    def as_retriever(self, **kwargs: Any) -> BaseRetriever:
        """Return a Retriever for this managed index."""

    def _build_index_from_nodes(
        self, nodes: Sequence[BaseNode], **build_kwargs: Any
    ) -> IndexDict:
        """Build the index from nodes."""
        raise NotImplementedError(
            "_build_index_from_nodes not implemented for BaseManagedIndex."
        )

    def _delete_node(self, node_id: str, **delete_kwargs: Any) -> None:
        """Delete a node."""
        raise NotImplementedError("_delete_node not implemented for BaseManagedIndex.")

    @property
    def ref_doc_info(self) -> Dict[str, RefDocInfo]:
        """Retrieve a dict mapping of ingested documents and their nodes+metadata."""
        raise NotImplementedError("ref_doc_info not implemented for BaseManagedIndex.")

    @classmethod
    def from_documents(
        cls: Type[IndexType],
        documents: Sequence[Document],
        storage_context: Optional[StorageContext] = None,
        show_progress: bool = False,
        callback_manager: Optional[CallbackManager] = None,
        transformations: Optional[List[TransformComponent]] = None,
        **kwargs: Any,
    ) -> IndexType:
        """Build an index from a sequence of documents."""
        raise NotImplementedError(

View on GitHub (pinned to afd0fef371)

Solutions

  1. Delete documents through the external service's API (the backing vector store / platform) rather than the llama-index delete methods.
  2. Check the concrete managed subclass for an override; if absent, rebuild or re-sync the managed index from your source of truth.
  3. Guard generic delete flows with try/except NotImplementedError or capability checks.

Example fix

# before
managed_index.delete_ref_doc(doc_id)  # NotImplementedError

# after
managed_index.vector_store.delete(doc_id)  # operate on the backing service directly
Defensive patterns

Strategy: type-guard

Validate before calling

from llama_index.core.indices.managed import BaseManagedIndex

if not isinstance(index, BaseManagedIndex):
    index.delete_ref_doc(doc_id)
else:
    index.vector_store.delete(doc_id)  # delete via the backing service

Type guard

from llama_index.core.indices.managed import BaseManagedIndex

def supports_local_delete(index: object) -> bool:
    return not isinstance(index, BaseManagedIndex)

Try / catch

try:
    index.delete_nodes(ids)
except NotImplementedError as e:
    if "BaseManagedIndex" in str(e):
        index.vector_store.delete(ids[0])  # or service-specific delete API
    else:
        raise

Prevention

When it happens

Trigger: 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.

Common situations: Porting sync/delete jobs from local indices to a managed offering; managed integrations that simply never implemented removal; cleanup scripts generic over index registries.

Related errors


AI-assisted analysis of run-llama/llama_index@afd0fef371 (2026-08-15). Data as JSON: /api/errors/914bfcb7b80f613e. Report an issue: GitHub.