{"record":{"id":"51d573521a0bc88b","repo":"zylon-ai/private-gpt","slug":"vector-store-for-collection-collection-does-not","errorCode":null,"errorMessage":"Vector store for collection {collection} does not support get_nodes","messagePattern":"Vector store for collection (.+?) does not support get_nodes","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"private_gpt/components/node_store/node_store_component.py","lineNumber":115,"sourceCode":"        return provider(self._settings, collection)\n\n    @property\n    def max_nodes(self) -> int | None:\n        return self._settings.data.max_num_nodes or None\n\n    def get_nodes(\n        self,\n        collection: str,\n        artifacts: list[str] | None = None,\n        node_ids: list[str] | None = None,\n        filters: MetadataFilters | None = None,\n        limit: int | None = None,\n    ) -> list[BaseNode]:\n        vector_store = self._vector_store_component.vector_store(collection)\n        if vector_store is None:\n            raise ValueError(f\"Vector store for collection {collection} not found\")\n        if not hasattr(vector_store, \"get_nodes\"):\n            raise ValueError(\n                f\"Vector store for collection {collection} does not support get_nodes\"\n            )\n\n        if artifacts:\n            artifact_filters = MetadataFilters(\n                filters=[\n                    MetadataFilter(key=MetadataKeys.ARTIFACT_ID.value, value=artifact)\n                    for artifact in artifacts\n                ],\n                condition=FilterCondition.OR,\n            )\n            filters = (\n                MetadataFilters(\n                    filters=[filters, artifact_filters],\n                    condition=FilterCondition.AND,\n                )\n                if filters\n                else artifact_filters","sourceCodeStart":97,"sourceCodeEnd":133,"githubUrl":"https://github.com/zylon-ai/private-gpt/blob/4a030776a31a901ad80b1bf4d7faa2c1a367efbb/private_gpt/components/node_store/node_store_component.py#L97-L133","documentation":"`get_nodes` requires the resolved vector store to expose a `get_nodes` method (an extension beyond llama-index's standard `BasePydanticVectorStore` interface, checked via `hasattr`). Stores that only implement standard query/delete lack it, so retrieval-by-nodes is unsupported and the component raises `ValueError` naming the collection.","triggerScenarios":"Configuring a vector store backend whose implementation lacks the `get_nodes` extension (only some custom/qdrant-derived stores implement it); calling `get_nodes`/artifact filtering paths against such a backend; upgrading a custom store that dropped the method.","commonSituations":"Switching vectorstore provider (e.g. to a vanilla llama-index store) while code paths call node retrieval; custom vector store wrappers not kept in sync with the project's extended interface.","solutions":["Use a vector store implementation that implements `get_nodes` (the project's qdrant-based factory stores do)","Add a `get_nodes(...)` method to the custom store class delegating to its backend's fetch-by-id/filter API","Avoid the `get_nodes` code path (node_ids/artifacts retrieval) for backends without support"],"exampleFix":"// before\nclass MyVectorStore(BasePydanticVectorStore):  # no get_nodes\n    ...\nnode_store.get_nodes(\"col\", node_ids=[...])  # ValueError\n\n// after\nclass MyVectorStore(BasePydanticVectorStore):\n    def get_nodes(self, node_ids=None, filters=None, limit=None):\n        return self._backend.fetch(node_ids=node_ids, filters=filters, limit=limit)","handlingStrategy":"type-guard","validationCode":"store = vector_store_component.vector_store(collection)\nif store is not None and not hasattr(store, \"get_nodes\"):\n    raise ValueError(f\"{type(store).__name__} cannot serve get_nodes; pick another backend\")","typeGuard":"def store_supports_get_nodes(store: Any) -> bool:\n    return hasattr(store, \"get_nodes\") and callable(store.get_nodes)","tryCatchPattern":"try:\n    nodes = node_store.get_nodes(collection, artifacts=[...])\nexcept ValueError as e:\n    if \"does not support get_nodes\" in str(e):\n        raise ConfigurationError(\"backend lacks node retrieval; switch store\") from e\n    raise","preventionTips":["Declare a minimal Protocol (get_nodes, delete_nodes) for stores and type-annotate factories against it","Run a capability matrix test per vector store backend in CI"],"tags":["vector-store","capability-check","retrieval","duck-typing"],"backgroundTag":null,"analyzedSha":"4a030776a31a901ad80b1bf4d7faa2c1a367efbb","analyzedAt":"2026-08-15T03:51:26.951Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}