zylon-ai/private-gpt · error · ValueError

Vector store for collection {collection} not found

Error message

Vector store for collection {collection} not found

What it means

`NodeStoreComponent.get_nodes(collection, ...)` asks `VectorStoreComponent.vector_store(collection)` for the store and raises `ValueError` when it returns None — i.e. no vector store instance exists for that collection name. The factory layer returns None rather than raising for unknown collections, and this component converts that into an explicit error naming the collection.

Source

Thrown at private_gpt/components/node_store/node_store_component.py:113

                f"Available: {available}"
            )
        return provider(self._settings, collection)

    @property
    def max_nodes(self) -> int | None:
        return self._settings.data.max_num_nodes or None

    def get_nodes(
        self,
        collection: str,
        artifacts: list[str] | None = None,
        node_ids: list[str] | None = None,
        filters: MetadataFilters | None = None,
        limit: int | None = None,
    ) -> list[BaseNode]:
        vector_store = self._vector_store_component.vector_store(collection)
        if vector_store is None:
            raise ValueError(f"Vector store for collection {collection} not found")
        if not hasattr(vector_store, "get_nodes"):
            raise ValueError(
                f"Vector store for collection {collection} does not support get_nodes"
            )

        if artifacts:
            artifact_filters = MetadataFilters(
                filters=[
                    MetadataFilter(key=MetadataKeys.ARTIFACT_ID.value, value=artifact)
                    for artifact in artifacts
                ],
                condition=FilterCondition.OR,
            )
            filters = (
                MetadataFilters(
                    filters=[filters, artifact_filters],
                    condition=FilterCondition.AND,
                )

View on GitHub (pinned to 4a030776a3)

Solutions

  1. Verify the collection exists (list collections on the vector store backend) and correct the name
  2. Ingest documents into the collection first so the store is created
  3. Guard callers: check `vector_store_component.vector_store(collection) is not None` before calling `get_nodes` and return an empty result if appropriate

Example fix

// before
nodes = node_store.get_nodes(collection="typo-collection")

// after
store = vector_store_component.vector_store(collection)
if store is None:
    return []  # or create/ingest the collection first
nodes = node_store.get_nodes(collection=collection)
Defensive patterns

Strategy: validation

Validate before calling

if vector_store_component.vector_store(collection) is None:
    raise KeyError(f"collection {collection!r} has no vector store; ingest first")

Type guard

def collection_has_store(vsc: Any, collection: str) -> bool:
    return vsc.vector_store(collection) is not None

Try / catch

try:
    nodes = node_store.get_nodes(collection, ...)
except ValueError as e:
    if "not found" in str(e):
        return []  # unknown collection -> empty result for read paths
    raise

Prevention

When it happens

Trigger: Calling `get_nodes` with a collection name that was never created/registered (typo, not yet ingested); querying a collection before any ingestion created it; multitenancy setups where the collection key is namespaced differently than expected.

Common situations: Querying a per-user or per-tenant collection before the tenant has ingested anything; typos in collection names from request parameters; environments where collections are created lazily on first ingest.

Related errors


AI-assisted analysis of zylon-ai/private-gpt@4a030776a3 (2026-08-15). Data as JSON: /api/errors/cd8eca44a27d8f81. Report an issue: GitHub.