run-llama/llama_index · error · NotImplementedError

from_documents not implemented for BaseManagedIndex.

Error message

from_documents not implemented for BaseManagedIndex.

What it means

BaseManagedIndex overrides the from_documents classmethod with an explicit NotImplementedError: constructing from a local document sequence is intentionally unsupported because ingestion must go through the managed service's own flow (each integration provides its own constructor/from_documents variant at the subclass level, or a client-based ingest API).

Source

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

        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(
            "from_documents not implemented for BaseManagedIndex."
        )

View on GitHub (pinned to afd0fef371)

Solutions

  1. Use the concrete managed subclass's documented construction path — most provide their own from_documents or require initializing a service client first; consult that integration's docs.
  2. If you control the subclass, override from_documents to push documents to the external service and return the index instance.
  3. For local document ingestion, use VectorStoreIndex or SummaryIndex.

Example fix

# before
index = MyManagedIndex.from_documents(docs)  # base stub raises

# after
client = ManagedServiceClient(api_key=...)
index = MyManagedIndex(client=client)  # then ingest via the service API/client
Defensive patterns

Strategy: type-guard

Validate before calling

from llama_index.core.indices.managed import BaseManagedIndex

assert not (isinstance(IndexCls, type) and issubclass(IndexCls, BaseManagedIndex) and IndexCls.from_documents is BaseManagedIndex.from_documents), \
    "this managed index does not override from_documents; use its service API"

Type guard

from llama_index.core.indices.managed import BaseManagedIndex

def managed_from_documents_supported(cls: type) -> bool:
    return not (issubclass(cls, BaseManagedIndex) and cls.from_documents is BaseManagedIndex.from_documents)

Try / catch

try:
    index = MyManagedIndex.from_documents(docs)
except NotImplementedError:
    client = make_service_client()
    index = MyManagedIndex(client=client)
    client.ingest_documents(docs)

Prevention

When it happens

Trigger: Calling SomeManagedIndex.from_documents(docs) where the subclass inherits the base implementation without overriding it; generic factory code that builds every index via BaseIndex.from_documents; new managed-index integrations that forgot to override the classmethod.

Common situations: See trigger scenarios.

Related errors


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