Skip to content

VIBETTER

MCP server that answers questions about your repo and checks every file:line citation

Situation
AI coding tools ship code faster than people can read it.
Task
I wanted repo answers that come from the source, with citations anyone can check.
Action
I built an MCP server that retrieves line-numbered code and checks each citation against what the model saw.
Result
Developers can check a cited line: 82.7% of 375 citations point to code the model was shown.
RoleCreator and maintainer
Timeline2026 – Present
StackPython, FastMCP, BM25 and RRF retrieval, Vue Flow, OpenTelemetry
Links
vibetter ask, on ky v2.2.0
Terminal output of vibetter ask: an answer about how ky detects network errors with file and line citations inline, then citations: 2 found, 2 verified, and wall time 9.1 s.
One uncut run: vibetter ask on ky v2.2.0, answered by qwen2.5-coder:7b in local Ollama. Both citations checked, in 9.1 s.

82.7%of cited lines match code the model was shown (375 citations, local 7B model, 3 runs)

Impact

A developer can check each answer against the lines it cites, with no second model call.

How I built it

  1. Split the repo into line-numbered chunks of about 60 lines, cut at definition and brace boundaries.

  2. Retrieve with three ranked lists fused by reciprocal rank fusion: BM25 over a code-aware tokenizer, a symbol and path index, and an optional dense arm.

  3. Check every citation with no second model call. The file must be indexed, the lines must exist, and the lines must be in the context the model was shown. Strict mode removes any sentence whose citation fails.

  4. Build the dependency graph from static imports instead of a model, with a layout that gives the same picture for the same files.

  5. Add two tools that need no key and no model, search_code and verify_citations, and log every tool call locally, with optional OpenTelemetry spans.

Why these choices

Lookups over an LLM judge

A lookup costs no tokens, gives the same verdict on every run, and cannot be argued out of it.

BM25 and a symbol index over embeddings

The dense arm did not help at the budget v2 uses, and it costs a model download, so it is opt-in.

Numbered lines in the context

A model cites lines reliably only when it sees them numbered. The recorded spans let the checker tell real lines from lines the model was shown.

Static imports over a model-drawn graph

v1 asked the model for edges and positions, which it could invent. Static analysis gives the same graph for the same files.

How it was measured
v1v2
Gold lines in the context, no file, at v2's 24k-character budget66 questions, 3 pinned repos
Same, at v1's 60k-character budget66 questions
Citations whose lines the model was shown198 answers per arm, local 7B, 3 runs
Scale 0 to 100%. Bars are 95% bootstrap intervals. One small local model, and labels from one pass with no held-out set. v1's no-file context held no source code, so its zero on citations is not a like-for-like baseline.Eval README at 8c2f864
  • Gold lines in the context, no file given: 79.8% (95% CI 70.6 to 88.4%) at 60k characters, v1's budget, and 54.2% (95% CI 42.9 to 65.7%) at 24k, v2's own budget, against 0% for v1, on 66 hand-labeled questions over three pinned open-source repos (Oct 23, 2026).
  • Citations to lines the model was shown: 82.7% (95% CI 76.7 to 88.2%). qwen2.5-coder:7b on local Ollama, 3 runs, 198 answers per arm (answers sampled Oct 23, scored Oct 26, 2026). v1's no-file context held no source code, so its 0% here is not a like-for-like baseline.
  • Cited answers: v1 cited in 9% of answers, v2 in 81%.
  • The dense arm did not help at the 24k budget and lowered recall at 60k, on the same 66 questions. It downloads a model of about 64 MB.

Failures and limits

  • Ollama keeps a small default context window and drops the start of a longer prompt without an error. The start is where the retrieved code sits, so a local model answered without most of it. Requests now size the window to the prompt.
  • Python's str.splitlines() also breaks on form feeds and U+2028, which shifts every later line number in a citation. The chunker now numbers lines the way git and editors do.
  • Small local models drop instructions that come before a long context. The citation rule is now repeated after the context.
  • A checked citation proves the lines exist and were shown to the model. It does not prove the sentence around it is true.

Check the work