Repository navigation
feat(nav): selectable embedding model + dynamic dimension - #99
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #98.
Summary
navigation.embedding_modelconfig (config.toml /RPG_EMBED_MODEL/ default) selects the semantic-search embedder, resolved byresolve_embedding_model→ (fastembed model, canonical name, dimension).bge-small-en(default, 384),jina-code(768, code-specialized),bge-base-en(768),bge-large-en(1024); unknown → default.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 warningscargo +stable fmt --all -- --checkcargo +stable test --workspace(all pass; new tests: registry mapping, dimension-mismatch rejection, binary roundtrip at default dim)RPG_EMBED_MODEL=jina-coderebuild + search on a real repo (downloads the 768d model; not in CI)