chroma-core/chroma · error · ValueError

Unknown HNSW parameter

Error message

Unknown HNSW parameter: {param}

What it means

Raised by HNSW Params._validate when segment metadata contains an hnsw:* parameter that is not in the known validator set — e.g. a typo like 'hnsw:Ef_constrution' or a parameter the installed HNSW build does not accept.

Solutions

  1. Use valid hnsw: parameters such as hnsw:space, hnsw:construction_ef, hnsw:search_ef, hnsw:M, hnsw:num_threads, hnsw:resize_factor, hnsw:sync_threshold, hnsw:batch_size
  2. Check the parameter name spelling after the hnsw: prefix
  3. Remove the parameter if it is not supported by this Chroma version
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at chromadb/segment/impl/vector/hnsw_params.py:41 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of chroma-core/chroma@aecdd12c8a (2026-08-16). Data as JSON: /api/errors/328507a7d0c34745. Report an issue: GitHub.

Appendix: source

Thrown at chromadb/segment/impl/vector/hnsw_params.py:41

}


class Params:
    @staticmethod
    def _select(metadata: Metadata) -> Dict[str, Any]:
        segment_metadata = {}
        for param, value in metadata.items():
            if param.startswith("hnsw:"):
                segment_metadata[param] = value
        return segment_metadata

    @staticmethod
    def _validate(metadata: Dict[str, Any], validators: Dict[str, Validator]) -> None:
        """Validates the metadata"""
        # Validate it
        for param, value in metadata.items():
            if param not in validators:
                raise ValueError(f"Unknown HNSW parameter: {param}")
            if not validators[param](value):
                raise ValueError(f"Invalid value for HNSW parameter: {param} = {value}")


class HnswParams(Params):
    space: str
    construction_ef: int
    search_ef: int
    M: int
    num_threads: int
    resize_factor: float

    def __init__(self, metadata: Metadata):
        metadata = metadata or {}
        self.space = str(metadata.get("hnsw:space", "l2"))
        self.construction_ef = int(metadata.get("hnsw:construction_ef", 100))
        self.search_ef = int(metadata.get("hnsw:search_ef", 100))
        self.M = int(metadata.get("hnsw:M", 16))

View on GitHub (pinned to aecdd12c8a)