mem0ai/mem0 · critical · ImportError

The 'chromadb' library is required. Please install it using

Error message

The 'chromadb' library is required. Please install it using 'pip install chromadb'.

What it means

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.

Source

Thrown at mem0/vector_stores/chroma.py:10

import logging
from typing import Dict, List, Optional

from pydantic import BaseModel

try:
    import chromadb
    from chromadb.config import Settings
except ImportError:
    raise ImportError("The 'chromadb' library is required. Please install it using 'pip install chromadb'.")

from mem0.vector_stores.base import VectorStoreBase

logger = logging.getLogger(__name__)


class OutputData(BaseModel):
    id: Optional[str]  # memory id
    score: Optional[float]  # distance
    payload: Optional[Dict]  # metadata


class ChromaDB(VectorStoreBase):
    def __init__(
        self,
        collection_name: str,
        client: Optional[chromadb.Client] = None,
        host: Optional[str] = None,

View on GitHub (pinned to 001c235229)

Solutions

  1. Install it: pip install chromadb.
  2. Or switch to another already-installed vector store provider by changing the provider in your config.
  3. Verify in CI: python -c "import chromadb" as a preflight check.

Example fix

# before
from mem0.vector_stores.chroma import ChromaDB  # ImportError

# after
# pip install chromadb
from mem0.vector_stores.chroma import ChromaDB
Defensive patterns

Strategy: validation

Validate before calling

try:
    import chromadb  # noqa: F401
    CHROMA_OK = True
except ImportError:
    CHROMA_OK = False

if provider == "chroma" and not CHROMA_OK:
    raise SystemExit("chromadb missing: pip install chromadb")

Prevention

When it happens

Trigger: Importing mem0.vector_stores.chroma or configuring VectorStoreConfig(provider='chroma') in an environment without chromadb. Errors on the import line, before ChromaDB() client creation.

Common situations: 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.

Related errors


AI-assisted analysis of mem0ai/mem0@001c235229 (2026-08-15). Data as JSON: /api/errors/76d2fb824edd099d. Report an issue: GitHub.