Skip to content

fix(core): feature-aware embedder default in open() + open_with_backend constructor - #1167

Merged
ajianaz merged 2 commits into
developfrom
fix/open-embedder-feature-aware
Aug 31, 2026
Merged

ajianaz merged 2 commits into
developfrom
fix/open-embedder-feature-aware

Conversation

@ajianaz

@ajianaz ajianaz commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

What

  • Uteke::open() no longer hardcodes the "onnx" embedder backend. The default is now feature-aware: "onnx" when the onnx feature is compiled in, "" (no embedder) otherwise.
  • New pub constructor Uteke::open_with_backend(path, Option<&str>) — None opens the store without an embedder for hosts that inject embeddings externally (mobile/FFI).
  • Dimension resolution ladder when no embedder is configured: UTEKE_EMBEDDING_DIMS → inferred from persisted embeddings (Store::infer_embedding_dims) → canonical 768 with a warning. Fixes the underlying dims=0 panic (working_dim must be in 1..=0) that a naive backend switch would have hit.
  • remember() without an embedder stores rows FTS5-only (vector index insert skipped) instead of failing; uteke repair remains the backfill path.

Why

Testing

  • vecq-only build (cargo test -p uteke-core --no-default-features --features vecq --lib): 526 passed, 0 failed — including the previously failing open path
  • default build (cargo test -p uteke-core --lib): 531 passed, 0 failed — no regression
  • cargo build for cli/server/mcp with vecq features: green
  • New tests: feature-aware default assertion, open_with_backend(None) FTS5 write+search round-trip (serial), invalid backend rejection, custom-backend behavior on non-onnx builds

…backend (#1166)

- open() no longer hardcodes the 'onnx' embedder backend. On builds
  compiled without the onnx feature (e.g. pure vecq mobile profile)
  the default is now '' (no embedder configured), so the open path
  no longer fails with a misleading 'onnx disabled' error.
- Add Uteke::open_with_backend(path, Option<&str>): explicit backend
  selection; None opens the store without an embedder for hosts that
  inject embeddings externally (FFI/mobile pipelines).
- Dimension resolution ladder when no embedder is configured:
  UTEKE_EMBEDDING_DIMS > inferred from persisted embeddings >
  canonical 768 (DEFAULT_EMBEDDING_DIMS) with a warning. Previously
  dims 0 reached VecqIndex::new and panicked ('working_dim must be
  in 1..=0').
- remember() with no embedder stores the row FTS5-only (skips the
  vector index insert) instead of failing; vector backfill remains
  possible via uteke repair.
- Store::infer_embedding_dims() reads the first persisted embedding
  length (length(blob)/4).
- Tests: open/open_with_backend feature-aware matrix, FTS5
  write+search without embedder (serial, UTEKE_EMBEDDING_DIMS),
  invalid-backend rejection, custom-backend behavior on non-onnx
  builds.

Verified:
- vecq-only (--no-default-features --features vecq): 526 passed, 0 failed
- default (onnx+usearch): 531 passed, 0 failed
- cli/server/mcp vecq build green, fmt clean
@github-actions

Copy link
Copy Markdown

🔍 Cora AI Code Review

✅ No issues found. Code looks good!


Review powered by cora-code · BYOK · MIT

Cora review follow-up: remember_embed passed the empty (no-embedder)
embedding into check_duplicate, and remember_precomputed passed it to
auto_link_cosine. Both are cosine-based and meaningless without a
vector — guard them on non-empty embeddings.

vecq-only: 526 passed; default: 531 passed.
@ajianaz
ajianaz merged commit 10ddcc4 into develop Aug 31, 2026
15 checks passed
@ajianaz
ajianaz deleted the fix/open-embedder-feature-aware branch August 31, 2026 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

core: Uteke::open() hardcodes the "onnx" embedder backend — vecq-only builds fail on the open path

1 participant