{"record":{"id":"3c6479d5dbbe0b4e","repo":"run-llama/llama_index","slug":"build-index-from-nodes-not-implemented-for-basema","errorCode":null,"errorMessage":"_build_index_from_nodes not implemented for BaseManagedIndex.","messagePattern":"_build_index_from_nodes not implemented for BaseManagedIndex\\.","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"llama-index-core/llama_index/core/indices/managed/base.py","lineNumber":72,"sourceCode":"    @abstractmethod\n    def delete_ref_doc(\n        self, ref_doc_id: str, delete_from_docstore: bool = False, **delete_kwargs: Any\n    ) -> None:\n        \"\"\"Delete a document and it's nodes by using ref_doc_id.\"\"\"\n\n    @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,","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/run-llama/llama_index/blob/afd0fef371831f9bda13e5af7167cf4e981278ab/llama-index-core/llama_index/core/indices/managed/base.py#L54-L90","documentation":"BaseManagedIndex delegates the actual indexing to an external service (e.g. a managed vector platform), so building the index locally from nodes is not part of its contract. The class explicitly stubs _build_index_from_nodes with NotImplementedError so that any code path trying to construct index structures locally (e.g. base insert()/refit flows that call _build_index_from_nodes) fails loudly instead of silently creating an empty local index.","triggerScenarios":"Calling insert()/insert_nodes() or any BaseIndex machinery on a managed index subclass that funnels into _build_index_from_nodes; invoking a generic indexing utility that assumes local node-based construction; subclassing BaseManagedIndex without delegating all ingestion to the remote service.","commonSituations":"Mixing local index APIs with managed index implementations; migrating code from VectorStoreIndex to a managed index and keeping insert() calls; authors of new managed-index integrations forgetting the base stubs.","solutions":["Use the managed index's own ingestion API — from_documents()/insert via the service client, or update_ref_doc for document updates — instead of local build/insert paths.","Check the concrete subclass (e.g. a managed vector-store integration) for supported operations; not all base-class methods apply.","If local construction is required, switch to VectorStoreIndex or SummaryIndex."],"exampleFix":"# before\nmanaged_index.insert_nodes(nodes)  # reaches _build_index_from_nodes -> NotImplementedError\n\n# after\nmanaged_index.update_ref_doc(document)  # managed-index ingestion path","handlingStrategy":"type-guard","validationCode":"from llama_index.core.indices.managed import BaseManagedIndex\n\nassert not isinstance(index, BaseManagedIndex), \"managed indices do not support local node building\"","typeGuard":"from llama_index.core.indices.managed import BaseManagedIndex\n\ndef is_managed_index(index: object) -> bool:\n    return isinstance(index, BaseManagedIndex)","tryCatchPattern":"try:\n    index.insert(doc)\nexcept NotImplementedError as e:\n    if \"BaseManagedIndex\" in str(e):\n        index.update_ref_doc(doc)  # managed ingestion path\n    else:\n        raise","preventionTips":["Route ingestion for managed indices only through their documented service APIs.","Centralize index capability checks in one helper used by all pipelines.","When writing a managed-index integration, override the local-build stubs to raise clearer errors."],"tags":["llama-index","managed-index","not-implemented","insert"],"backgroundTag":null,"analyzedSha":"afd0fef371831f9bda13e5af7167cf4e981278ab","analyzedAt":"2026-08-15T05:42:58.429Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}