Context
The bundled OSS HashingEmbedder emits 256 dims (adapters/outbound/intelligence/local_embedder.py:38 — _DEFAULT_DIMENSIONS = 256), but every vector-index creator defaults to 1536 (OpenAI text-embedding-3-small) via getattr(self._embedder, "dimensions", 1536):
adapters/outbound/graph/neo4j_writer.py:80
adapters/outbound/graph/falkordb_writer.py:233 (plus _ensure_indexes_sync(..., embedding_dim: int = 1536) at :238)
adapters/outbound/graph/cypher.py:759 — ensure_canonical_indexes(driver, *, embedding_dim: int = 1536) (comment at :770 cites text-embedding-3-small)
This is consistent when an embedder is wired (the getattr reads .dimensions == 256). The hazard is the fallback path: the writers/backends accept embedder=None:
adapters/outbound/graph/neo4j_writer.py:42
adapters/outbound/graph/falkordb_writer.py:194
adapters/outbound/graph/backends/embedded_backend.py:44
If ensure_indexes runs with no embedder it creates a 1536-dim index, while embedding writes (once an embedder is wired) emit 256-dim vectors — the index width mismatches the stored data and semantic reads silently degrade to lexical fallback. Swapping in sentence-transformers (the embeddings extra in pyproject.toml) introduces a third width (384/768/…), compounding the drift.
Acceptance criteria
Provenance
Carry-forward from the cg-05 backends PR (folds the original PR-12 embedding-claim-query + PR-13 FalkorDB backend). Deferred deliberately; tracked here rather than blocking the PR.
Context
The bundled OSS
HashingEmbedderemits 256 dims (adapters/outbound/intelligence/local_embedder.py:38—_DEFAULT_DIMENSIONS = 256), but every vector-index creator defaults to 1536 (OpenAItext-embedding-3-small) viagetattr(self._embedder, "dimensions", 1536):adapters/outbound/graph/neo4j_writer.py:80adapters/outbound/graph/falkordb_writer.py:233(plus_ensure_indexes_sync(..., embedding_dim: int = 1536)at:238)adapters/outbound/graph/cypher.py:759—ensure_canonical_indexes(driver, *, embedding_dim: int = 1536)(comment at:770citestext-embedding-3-small)This is consistent when an embedder is wired (the
getattrreads.dimensions == 256). The hazard is the fallback path: the writers/backends acceptembedder=None:adapters/outbound/graph/neo4j_writer.py:42adapters/outbound/graph/falkordb_writer.py:194adapters/outbound/graph/backends/embedded_backend.py:44If
ensure_indexesruns with no embedder it creates a 1536-dim index, while embedding writes (once an embedder is wired) emit 256-dim vectors — the index width mismatches the stored data and semantic reads silently degrade to lexical fallback. Swapping insentence-transformers(theembeddingsextra inpyproject.toml) introduces a third width (384/768/…), compounding the drift.Acceptance criteria
1536magic default is removed — derive the width from the configured embedder, or fail closed when no embedder is wired (rather than guessing 1536)..dimensionsacross the embedded / FalkorDB / sentence-transformers paths.Provenance
Carry-forward from the cg-05 backends PR (folds the original PR-12 embedding-claim-query + PR-13 FalkorDB backend). Deferred deliberately; tracked here rather than blocking the PR.