Skip to content

feat(nav): selectable embedding model + dynamic dimension - #99

Merged
userFRM merged 2 commits into
mainfrom
feat/selectable-embedding-model
May 29, 2026
Merged

userFRM merged 2 commits into
mainfrom
feat/selectable-embedding-model

Conversation

@userFRM

@userFRM userFRM commented May 29, 2026

Copy link
Copy Markdown
Owner

Closes #98.

Summary

  • navigation.embedding_model config (config.toml / RPG_EMBED_MODEL / default) selects the semantic-search embedder, resolved by resolve_embedding_model → (fastembed model, canonical name, dimension).
  • Known: bge-small-en (default, 384), jina-code (768, code-specialized), bge-base-en (768), bge-large-en (1024); unknown → default.
  • Dimension is now carried on the index + binary header (was a const); a model/dim change in the meta forces a clean rebuild.

Why

The embedder was hardcoded to BGE-small-en-v1.5 — general English text, not code. This adds a code-specialized option (jina-code) and the seam to evaluate embedders. Zero-config default unchanged.

Test plan

  • cargo +stable clippy --workspace --all-targets -- -D warnings
  • cargo +stable fmt --all -- --check
  • cargo +stable test --workspace (all pass; new tests: registry mapping, dimension-mismatch rejection, binary roundtrip at default dim)
  • Manual: RPG_EMBED_MODEL=jina-code rebuild + search on a real repo (downloads the 768d model; not in CI)

userFRM added 2 commits May 29, 2026 19:55
The embedding model was hardcoded to BGE-small-en-v1.5 (384d, general English
text — not code-specialized). Make it configurable via
navigation.embedding_model (config.toml / RPG_EMBED_MODEL), resolved to a
fastembed model + dimension by resolve_embedding_model. Known: bge-small-en
(default, 384), jina-code (768, code-specialized), bge-base-en (768),
bge-large-en (1024); unknown falls back to default.

Dimension is now carried on the index + binary header (no longer a const), so
switching models rebuilds the index (model/dimension mismatch in meta forces a
fresh embed). Zero-config default unchanged; no API key required.
@userFRM
userFRM merged commit 37dfad2 into main May 29, 2026
6 checks passed
@userFRM
userFRM deleted the feat/selectable-embedding-model branch May 29, 2026 18:03
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.

Embedding model is hardcoded to non-code BGE-small-en; make it selectable (add code-specialized option)

1 participant