{"record":{"id":"76d2fb824edd099d","repo":"mem0ai/mem0","slug":"the-chromadb-library-is-required-please-install-76d2fb","errorCode":null,"errorMessage":"The 'chromadb' library is required. Please install it using 'pip install chromadb'.","messagePattern":"The 'chromadb' library is required\\. Please install it using 'pip install chromadb'\\.","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"critical","filePath":"mem0/vector_stores/chroma.py","lineNumber":10,"sourceCode":"import logging\nfrom typing import Dict, List, Optional\n\nfrom pydantic import BaseModel\n\ntry:\n    import chromadb\n    from chromadb.config import Settings\nexcept ImportError:\n    raise ImportError(\"The 'chromadb' library is required. Please install it using 'pip install chromadb'.\")\n\nfrom mem0.vector_stores.base import VectorStoreBase\n\nlogger = logging.getLogger(__name__)\n\n\nclass OutputData(BaseModel):\n    id: Optional[str]  # memory id\n    score: Optional[float]  # distance\n    payload: Optional[Dict]  # metadata\n\n\nclass ChromaDB(VectorStoreBase):\n    def __init__(\n        self,\n        collection_name: str,\n        client: Optional[chromadb.Client] = None,\n        host: Optional[str] = None,","sourceCodeStart":1,"sourceCodeEnd":28,"githubUrl":"https://github.com/mem0ai/mem0/blob/001c235229be8795e3834520467bd0d661ed8f34/mem0/vector_stores/chroma.py#L1-L28","documentation":"ImportError raised at module import time when 'chromadb' is not installed. chroma.py imports chromadb and chromadb.config.Settings in a try/except and re-raises with this message, so the Chroma vector store module is unusable without the package.","triggerScenarios":"Importing mem0.vector_stores.chroma or configuring VectorStoreConfig(provider='chroma') in an environment without chromadb. Errors on the import line, before ChromaDB() client creation.","commonSituations":"Quickstart examples defaulting to Chroma while the deployment image only has mem0ai core; local dev on a fresh virtualenv; CI dependency caching dropping optional extras.","solutions":["Install it: pip install chromadb.","Or switch to another already-installed vector store provider by changing the provider in your config.","Verify in CI: python -c \"import chromadb\" as a preflight check."],"exampleFix":"# before\nfrom mem0.vector_stores.chroma import ChromaDB  # ImportError\n\n# after\n# pip install chromadb\nfrom mem0.vector_stores.chroma import ChromaDB","handlingStrategy":"validation","validationCode":"try:\n    import chromadb  # noqa: F401\n    CHROMA_OK = True\nexcept ImportError:\n    CHROMA_OK = False\n\nif provider == \"chroma\" and not CHROMA_OK:\n    raise SystemExit(\"chromadb missing: pip install chromadb\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Add chromadb to requirements for any deployment that defaults to the Chroma provider.","Run a startup dependency check that imports every configured provider module.","Prefer a vector store already present in your image if you want zero extra deps."],"tags":["chroma","dependencies","import-error","vector-store"],"backgroundTag":null,"analyzedSha":"001c235229be8795e3834520467bd0d661ed8f34","analyzedAt":"2026-08-15T01:55:42.685Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}