diff --git a/backend/open_webui/retrieval/vector/dbs/chroma.py b/backend/open_webui/retrieval/vector/dbs/chroma.py index cd0a59eeaf..408a02111f 100755 --- a/backend/open_webui/retrieval/vector/dbs/chroma.py +++ b/backend/open_webui/retrieval/vector/dbs/chroma.py @@ -57,7 +57,11 @@ class ChromaClient(VectorDBBase): def has_collection(self, collection_name: str) -> bool: # Check if the collection exists based on the collection name. - collection_names = self.client.list_collections() + # chromadb's list_collections() returns Collection objects (1.x), so a + # bare `name in collections` membership test is always False — compare + # against the names. (hasattr guard tolerates versions that yield names.) + collections = self.client.list_collections() + collection_names = [c.name if hasattr(c, 'name') else c for c in collections] return collection_name in collection_names def delete_collection(self, collection_name: str):