{"record":{"id":"a688781bf3a1c1dc","repo":"microsoft/autogen","slug":"to-use-the-chromadbvectormemory-the-chromadb-extra","errorCode":null,"errorMessage":"To use the ChromaDBVectorMemory the chromadb extra must be installed. Run `pip install autogen-ext[chromadb]`","messagePattern":"To use the ChromaDBVectorMemory the chromadb extra must be installed\\. Run `pip install autogen-ext\\[chromadb\\]`","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"critical","filePath":"python/packages/autogen-ext/src/autogen_ext/memory/chromadb/_chromadb.py","lineNumber":30,"sourceCode":"from typing_extensions import Self\n\nfrom ._chroma_configs import (\n    ChromaDBVectorMemoryConfig,\n    CustomEmbeddingFunctionConfig,\n    DefaultEmbeddingFunctionConfig,\n    HttpChromaDBVectorMemoryConfig,\n    OpenAIEmbeddingFunctionConfig,\n    PersistentChromaDBVectorMemoryConfig,\n    SentenceTransformerEmbeddingFunctionConfig,\n)\n\nlogger = logging.getLogger(__name__)\n\n\ntry:\n    from chromadb.api import ClientAPI\nexcept ImportError as e:\n    raise ImportError(\n        \"To use the ChromaDBVectorMemory the chromadb extra must be installed. Run `pip install autogen-ext[chromadb]`\"\n    ) from e\n\n\nclass ChromaDBVectorMemory(Memory, Component[ChromaDBVectorMemoryConfig]):\n    \"\"\"\n    Store and retrieve memory using vector similarity search powered by ChromaDB.\n\n    `ChromaDBVectorMemory` provides a vector-based memory implementation that uses ChromaDB for\n    storing and retrieving content based on semantic similarity. It enhances agents with the ability\n    to recall contextually relevant information during conversations by leveraging vector embeddings\n    to find similar content.\n\n    This implementation serves as a reference for more complex memory systems using vector embeddings.\n    For advanced use cases requiring specialized formatting of retrieved content, users should extend\n    this class and override the `update_context()` method.\n\n    This implementation requires the ChromaDB extra to be installed. Install with:","sourceCodeStart":12,"sourceCodeEnd":48,"githubUrl":"https://github.com/microsoft/autogen/blob/027ecf0a379bcc1d09956d46d12d44a3ad9cee14/python/packages/autogen-ext/src/autogen_ext/memory/chromadb/_chromadb.py#L12-L48","documentation":"Importing autogen_ext.memory.chromadb requires the chromadb package; it is an optional extra, so the module guards the import and raises with explicit install instructions (pip install autogen-ext[chromadb]) chained to the original ImportError.","triggerScenarios":"from autogen_ext.memory.chromadb import ChromaDBVectorMemory in an environment where chromadb is not installed.","commonSituations":"Installing plain autogen-core/autogen-ext without extras; deploying to slim Docker images; a dependency resolver dropping chromadb.","solutions":["Install the extra: pip install \"autogen-ext[chromadb]\".","Alternatively install chromadb directly: pip install chromadb.","Pin the extra in requirements.txt/pyproject so deployments include it."],"exampleFix":"# shell\n# before: import raises ImportError\npip install \"autogen-ext[chromadb]\"\n# after: import succeeds","handlingStrategy":"validation","validationCode":"try:\n    import chromadb  # noqa: F401\nexcept ImportError:\n    raise SystemExit(\"Install with: pip install 'autogen-ext[chromadb]'\")","typeGuard":null,"tryCatchPattern":"try:\n    from autogen_ext.memory.chromadb import ChromaDBVectorMemory\nexcept ImportError as e:\n    if \"chromadb extra\" in str(e):\n        print(\"Run: pip install 'autogen-ext[chromadb]'\")\n    raise","preventionTips":["Install extras at setup time: pip install 'autogen-ext[chromadb]'.","Pin extras in requirements.txt/pyproject so CI and Docker images include them."],"tags":["autogen","chromadb","dependencies","import-error"],"backgroundTag":null,"analyzedSha":"027ecf0a379bcc1d09956d46d12d44a3ad9cee14","analyzedAt":"2026-08-15T03:38:00.719Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}