microsoft/autogen · critical · ImportError
To use the ChromaDBVectorMemory the chromadb extra must be i
Error message
To use the ChromaDBVectorMemory the chromadb extra must be installed. Run `pip install autogen-ext[chromadb]`
What it means
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.
Source
Thrown at python/packages/autogen-ext/src/autogen_ext/memory/chromadb/_chromadb.py:30
from typing_extensions import Self
from ._chroma_configs import (
ChromaDBVectorMemoryConfig,
CustomEmbeddingFunctionConfig,
DefaultEmbeddingFunctionConfig,
HttpChromaDBVectorMemoryConfig,
OpenAIEmbeddingFunctionConfig,
PersistentChromaDBVectorMemoryConfig,
SentenceTransformerEmbeddingFunctionConfig,
)
logger = logging.getLogger(__name__)
try:
from chromadb.api import ClientAPI
except ImportError as e:
raise ImportError(
"To use the ChromaDBVectorMemory the chromadb extra must be installed. Run `pip install autogen-ext[chromadb]`"
) from e
class ChromaDBVectorMemory(Memory, Component[ChromaDBVectorMemoryConfig]):
"""
Store and retrieve memory using vector similarity search powered by ChromaDB.
`ChromaDBVectorMemory` provides a vector-based memory implementation that uses ChromaDB for
storing and retrieving content based on semantic similarity. It enhances agents with the ability
to recall contextually relevant information during conversations by leveraging vector embeddings
to find similar content.
This implementation serves as a reference for more complex memory systems using vector embeddings.
For advanced use cases requiring specialized formatting of retrieved content, users should extend
this class and override the `update_context()` method.
This implementation requires the ChromaDB extra to be installed. Install with:View on GitHub (pinned to 027ecf0a37)
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.
Example fix
# shell # before: import raises ImportError pip install "autogen-ext[chromadb]" # after: import succeeds
Defensive patterns
Strategy: validation
Validate before calling
try:
import chromadb # noqa: F401
except ImportError:
raise SystemExit("Install with: pip install 'autogen-ext[chromadb]'") Try / catch
try:
from autogen_ext.memory.chromadb import ChromaDBVectorMemory
except ImportError as e:
if "chromadb extra" in str(e):
print("Run: pip install 'autogen-ext[chromadb]'")
raise Prevention
- Install extras at setup time: pip install 'autogen-ext[chromadb]'.
- Pin extras in requirements.txt/pyproject so CI and Docker images include them.
When it happens
Trigger: from autogen_ext.memory.chromadb import ChromaDBVectorMemory in an environment where chromadb is not installed.
Common situations: Installing plain autogen-core/autogen-ext without extras; deploying to slim Docker images; a dependency resolver dropping chromadb.
Related errors
- ChromaDB embedding functions not available. Ensure chromadb
- The 'unidiff' package is required for patch application. Ins
- Dependencies for MagenticOneCoderAgent not found. Please ins
- Missing dependecies for DockerCommandLineCodeExecutor. Pleas
- Failed to create SentenceTransformer embedding function with
AI-assisted analysis of microsoft/autogen@027ecf0a37 (2026-08-15).
Data as JSON: /api/errors/a688781bf3a1c1dc.
Report an issue: GitHub.