{"record":{"id":"d667643da6f14417","repo":"MemPalace/mempalace","slug":"embedding-model-mismatch-reading-palace-at-palace","errorCode":null,"errorMessage":"Embedding model mismatch reading palace at {palace_path!r}.\n  Underlying ChromaDB error: {msg}\n  Current MEMPALACE_EMBEDDING_MODEL={current_model!r}.\n  The palace was built with a different embedding model. Either:\n    (a) revert the model: unset MEMPALACE_EMBEDDING_MODEL (or set the previous value), or\n    (b) re-embed in place: `{rebuild_cmd}` (writes new vectors with the current model).","messagePattern":"Embedding model mismatch reading palace at (.+?)\\.\n  Underlying ChromaDB error: (.+?)\n  Current MEMPALACE_EMBEDDING_MODEL=(.+?)\\.\n  The palace was built with a different embedding model\\. Either:\n    \\(a\\) revert the model: unset MEMPALACE_EMBEDDING_MODEL \\(or set the previous value\\), or\n    \\(b\\) re-embed in place: `(.+?)` \\(writes new vectors with the current model\\)\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"mempalace/backends/chroma.py","lineNumber":2466,"sourceCode":"\n        client = self._client(palace_path)\n\n        ef = self._resolve_embedding_function()\n        ef_kwargs = {\"embedding_function\": ef} if ef is not None else {}\n\n        if create:\n            try:\n                collection = client.get_collection(collection_name, **ef_kwargs)\n            except _ChromaNotFoundError:\n                collection = client.create_collection(\n                    collection_name,\n                    metadata=_hnsw_creation_metadata(options),\n                    **ef_kwargs,\n                )\n            except ValueError as e:\n                explanation = self._explain_ef_mismatch(e, palace_path)\n                if explanation:\n                    raise ValueError(explanation) from e\n                raise\n        else:\n            try:\n                collection = client.get_collection(collection_name, **ef_kwargs)\n            except _ChromaNotFoundError as e:\n                raise CollectionNotInitializedError(palace_path) from e\n            except ValueError as e:\n                explanation = self._explain_ef_mismatch(e, palace_path)\n                if explanation:\n                    raise ValueError(explanation) from e\n                raise\n        _pin_hnsw_threads(collection)\n        return ChromaCollection(collection, palace_path=palace_path)\n\n    def close_palace(self, palace) -> None:\n        \"\"\"Drop cached handles for ``palace`` and release its SQLite file lock.\n\n        Accepts ``PalaceRef`` or legacy path str. chromadb's rust-side file","sourceCodeStart":2448,"sourceCodeEnd":2484,"githubUrl":"https://github.com/MemPalace/mempalace/blob/06cb6987f02610784fefbad4b2bd5d026d164ba6/mempalace/backends/chroma.py#L2448-L2484","documentation":"A KeyError (with message) from get_transformation: the requested transformation name is neither one of the RESERVED_TRANSFORMATIONS nor resolvable here. The docstring notes that adapter-namespaced references (<adapter>_<transform>) should be resolved by getattr on the transforms module first — this helper only covers reserved names, so passing an adapter-prefixed name to it is a misuse, not a missing feature.","triggerScenarios":"Calling get_transformation('strip') when 'strip' is not reserved; passing an adapter-namespaced reference like 'convo_normalize' to this helper instead of resolving it via getattr on the module.","commonSituations":"Code written before the reserved/adapter-namespaced split; typos in transformation names; expecting an adapter-provided transformation to be globally registered.","solutions":["Check sorted(RESERVED_TRANSFORMATIONS) (listed in the message) and use an exact reserved name.","For adapter-namespaced references, resolve via getattr on the transforms module / the adapter itself instead of this helper.","Register the transformation under the adapter's namespace if you are authoring one."],"exampleFix":"# before\nget_transformation('convo_normalize')  # KeyError\n\n# after\nimport mempalace.sources.transforms as T\nfn = getattr(T, 'convo_normalize', None) or get_transformation('normalize')","handlingStrategy":"validation","validationCode":"from mempalace.sources.transforms import RESERVED_TRANSFORMATIONS\nif name not in RESERVED_TRANSFORMATIONS:\n    import mempalace.sources.transforms as T\n    if not hasattr(T, name):\n        raise SystemExit(f'no transformation {name!r} (reserved: {sorted(RESERVED_TRANSFORMATIONS)})')","typeGuard":"def transformation_resolvable(name: str) -> bool:\n    from mempalace.sources.transforms import RESERVED_TRANSFORMATIONS\n    import mempalace.sources.transforms as T\n    return name in RESERVED_TRANSFORMATIONS or hasattr(T, name)","tryCatchPattern":null,"preventionTips":["Use reserved names from RESERVED_TRANSFORMATIONS for built-ins; getattr on the module for adapter-namespaced ones.","Don't route adapter-prefixed references through get_transformation — it only knows reserved names."],"tags":["transforms","registry","api-misuse","validation"],"backgroundTag":null,"analyzedSha":"06cb6987f02610784fefbad4b2bd5d026d164ba6","analyzedAt":"2026-08-15T03:03:36.213Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}