microsoft/autogen · error · ValueError
Unsupported config type: {type(self._config)}
Error message
Unsupported config type: {type(self._config)} What it means
During lazy initialization, ChromaDBVectorMemory selects a chromadb client by isinstance-dispatch on its config: PersistentChromaDBVectorMemoryConfig gets a PersistentClient, HttpChromaDBVectorMemoryConfig gets an HttpClient, and anything else raises ValueError with the offending type. The wrapper also logs 'Failed to initialize ChromaDB client' and re-raises the original exception for genuine client-creation failures.
Source
Thrown at python/packages/autogen-ext/src/autogen_ext/memory/chromadb/_chromadb.py:264
if isinstance(self._config, PersistentChromaDBVectorMemoryConfig):
self._client = PersistentClient(
path=self._config.persistence_path,
settings=settings,
tenant=self._config.tenant,
database=self._config.database,
)
elif isinstance(self._config, HttpChromaDBVectorMemoryConfig):
self._client = HttpClient(
host=self._config.host,
port=self._config.port,
ssl=self._config.ssl,
headers=self._config.headers,
settings=settings,
tenant=self._config.tenant,
database=self._config.database,
)
else:
raise ValueError(f"Unsupported config type: {type(self._config)}")
except Exception as e:
logger.error(f"Failed to initialize ChromaDB client: {e}")
raise
if self._collection is None:
try:
# Create embedding function
embedding_function = self._create_embedding_function()
# Create or get collection with embedding function
self._collection = self._client.get_or_create_collection(
name=self._config.collection_name,
metadata={"distance_metric": self._config.distance_metric},
embedding_function=embedding_function,
)
except Exception as e:
logger.error(f"Failed to get/create collection: {e}")
raiseView on GitHub (pinned to 027ecf0a37)
Solutions
- Use PersistentChromaDBVectorMemoryConfig or HttpChromaDBVectorMemoryConfig from the same autogen_ext.memory.chromadb module.
- For a server setup, verify host/port/tenant/database are correct and the chroma server is reachable.
- For persistent setup, verify persistence_path is writable.
- Align autogen-ext versions across imports so isinstance dispatch matches.
Example fix
# before memory = ChromaDBVectorMemory(config=some_custom_config) # after from autogen_ext.memory.chromadb import PersistentChromaDBVectorMemoryConfig memory = ChromaDBVectorMemory(config=PersistentChromaDBVectorMemoryConfig(collection_name="docs", persistence_path="./chroma"))
Defensive patterns
Strategy: type-guard
Validate before calling
from autogen_ext.memory.chromadb import (
PersistentChromaDBVectorMemoryConfig,
HttpChromaDBVectorMemoryConfig,
)
assert isinstance(config, (PersistentChromaDBVectorMemoryConfig, HttpChromaDBVectorMemoryConfig)), (
f"unsupported config: {type(config).__name__}"
) Type guard
def is_supported_chromadb_config(cfg) -> bool:
return isinstance(cfg, (PersistentChromaDBVectorMemoryConfig, HttpChromaDBVectorMemoryConfig)) Try / catch
try:
memory = ChromaDBVectorMemory(config=config)
await memory.update_context(ctx) # triggers _ensure_initialized
except ValueError as e:
if "Unsupported config type" in str(e):
raise SystemExit("Use Persistent or Http ChromaDBVectorMemoryConfig") from e
raise
except Exception:
# genuine client init failure (network/path/tenant) is logged and re-raised as-is
raise Prevention
- Import config classes and ChromaDBVectorMemory from the same package version.
- For Http configs, health-check host/port before first use.
- For Persistent configs, verify persistence_path is writable.
When it happens
Trigger: Constructing ChromaDBVectorMemory with a config class other than the two supported ones (e.g. an in-memory config class from another module or a plain dict) and triggering the first query/update. Non-ValueError chromadb errors (bad path, unreachable host, bad tenant/database) surface from the same try block with the same log line.
Common situations: Version mismatch where the config classes were imported from a different autogen-ext version than the memory class; attempting an EphemeralClient-style config that this implementation does not support; HTTP configs pointing at a dead chroma server.
Related errors
- Unsupported embedding function config type: {type(config)}
- Failed to create custom embedding function. Error: {e}
- Please set OPENAI_API_KEY environment variable.
- Please set OPENAI_API_KEY environment variable.
- BING_API_KEY environment variable is not set
AI-assisted analysis of microsoft/autogen@027ecf0a37 (2026-08-15).
Data as JSON: /api/errors/65be31f5f7b5afdd.
Report an issue: GitHub.