Skip to content

feat(code-intel): evaluate local code embedding backends and the RRF weights for brain on a fixed question set #746

Closed

Description

@ajianaz

Correction

The first version of this issue said the evaluation needs a provider and an API key. That was wrong: cora's embeddings are local. brain.embedding is auto, hashing (256d hashing trick, default, no dependency) or pretrained (768d static token vectors distilled from nomic-embed-code, compiled in behind the pretrained-embed feature). No network or key is involved, and the vector signal is optional: keyword and graph signals work without it.

What problem does this solve?

Split out of #717 (item 3). cora brain now reduces a question to its content words, returns results in rank order and reports which signals answered, but the quality of the vector signal was never measured. With the default hashing embedding the vector hits are weak, and the signal is only halved in the fusion as a stopgap.

Proposed solution

  1. Build a fixed question set with the expected answer symbols, from this repository and from real tasks on a multi-crate workspace (the questions in cora code intelligence on tole (0.20.0): measured accuracy, noise and what to optimise tole#669), kept as a regression fixture with a scoring script (top-k hit rate and rank of the expected symbol). Runs offline.
  2. Compare on that set, all CPU-only:
    • hashing (current default) and pretrained (current static nomic vocabulary);
    • a Model2Vec static code model, minishlab/potion-code-16M-v2 (16.2M parameters, 256 dimensions, MIT, distilled from CodeRankEmbed), loaded with the model2vec-rs crate, which can load from bytes and quantize to int8. Its published training corpus has six languages and no Rust, so the Rust result must be measured, not assumed;
    • optionally a transformer code model through ONNX (jinaai/jina-embeddings-v2-base-code, 161M parameters, 30 languages including Rust, supported by fastembed-rs) as an opt-in heavy backend, to see what the extra cost buys.
  3. Tune the RRF constant and the per-signal weights (keyword, vector, graph) on the set and decide whether the half weight for the hashing embedding stays.
  4. Record model, dimensions, index time, binary or download size and hit rate in the docs.

Alternatives considered

Keep hashing and the fixed half weight. That is the current state; it is cheap but unmeasured.

Before submitting

Activity

  1. added
    enhancement
    scope:code-intel
    epic:code-intelligence
    on Nov 16, 2026
  2. changed the title [-]feat(code-intel): evaluate a code embedding model and the RRF weights for `brain` on a fixed question set[/-] [+]feat(code-intel): evaluate local code embedding backends and the RRF weights for `brain` on a fixed question set[/+] on Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementepic:code-intelligencepriority:mediumscope:code-intel

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions