You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
refactor(code-intel): retire the hashing and pretrained embeddings; the code model is the only vector signal #751
Three embedding backends exist: hashing (256-d bag-of-tokens), pretrained (768-d static nomic vocabulary, behind the pretrained-embed feature, 31 MB of vendored data in the repository) and, since the code model landed, potion-code-16M-v2. Measured on 1,639 retrieval queries (this repository, 8 Rust crates, the Python standard library), the first two are neutral on this repository and harmful elsewhere when fused with keyword search (down to -0.09 MRR@10 at half weight; still -0.04 at a quarter of a vote on Python). The code model beats keyword search alone by +0.07 to +0.12 everywhere.
Keeping them costs a second and third code path, dimension-mismatch handling for 256 versus 768, a feature flag that default builds do not enable, 31 MB in the working tree, and a fallback that is worse than having no vector signal.
Proposed solution
The code model is the only embedding. brain.embedding becomes auto (default, same as potion) or off. The old values hashing and pretrained are accepted for one release with a warning and mean auto.
When the model is not available (offline first run, blocked network, CORA_EMBED_OFFLINE=1 without a model), the vector signal is switched off: brain returns keyword and graph results, the output says so once and how to get the model. No weak substitute.
Delete src/embed/tokens.rs (the hashing tokenizer; nothing else in cora uses it), src/embed/token_vocab.rs, the pretrained-embed feature, vendored/nomic/ and scripts/extract_code_tokens.py, and the weights table in brain_search_report (one vector signal, one weight).
Keep a small test model fixture so tests need no network.
Update docs, CHANGELOG, THIRD_PARTY.md (the nomic notice goes away).
Alternatives considered
Keep hashing as an offline fallback at a quarter weight: measured at about zero to slightly negative, so it only adds code. Keep pretrained for people who built it: it needs a custom build, and the code model is better and smaller.
Before submitting
Depends on the per-project vecq storage issue for the vector files; can land before or after it.
Activity