ContextVault: what the benchmarks actually say
ContextVault is an engineering-memory service: store technical material with product, version, document type, and lifecycle metadata; retrieve evidence for a question; only then decide whether an answer is safe to generate.
This is a benchmark note, not a victory lap. The project has one completed public retrieval result, two smaller answer-path diagnostics, and one important gap: BGE-base has not yet completed a fair run on this host. I would rather leave that blank than decorate it with a score it did not earn.
The short version
| Area | What is measured | What it says |
|---|---|---|
| Public retrieval | ContextVault FTS on BEIR SciFact | A fast, credible lexical baseline |
| Answer safety | Direct RAG vs Jev-gated RAG on 16 cases | The gate removed observed unsupported answers, but reduced answer coverage |
| Recovery control flow | 30-case offline diagnostic | The gated recovery path is wired safely; this corpus did not need it to improve coverage |
| Dense retrieval | BGE-base-en-v1.5 | Planned comparator, not yet a completed result |
The current system is not “an FTS model” competing directly with BGE-base. FTS is the measured retrieval baseline. BGE-base is the next local dense-retrieval component to evaluate, then combine with FTS in a hybrid pipeline.
1. A real public retrieval benchmark
The most useful external result so far comes from BEIR SciFact, a public scientific-claim retrieval benchmark. ContextVault indexed 5,183 scientific abstracts and evaluated 300 test queries with relevance judgements. This measures document retrieval, not final answer quality or scientific fact verification.
| ContextVault FTS, top 10 | Result |
|---|---|
| nDCG@10 | 65.06% |
| MRR@10 | 62.23% |
| Recall@1 | 51.50% |
| Recall@5 | 72.71% |
| Recall@10 | 76.40% |
| Query latency, p50 | 15.4 ms |
| Query latency, p95 | 25.7 ms |
| Query latency, p99 | 30.1 ms |
| Evaluation errors | 0 |
That is a useful starting point: the baseline can retrieve exact scientific language quickly and consistently. It is not evidence that ContextVault has beaten modern dense retrieval. It is evidence that the project has a public number worth trying to beat.
Where BGE-base fits
BAAI/bge-base-en-v1.5 is a 109M-parameter English embedding model. Instead of matching words through an FTS index, it maps queries and chunks into 768-dimensional vectors and looks for semantic proximity. That tends to help with paraphrases and conceptually similar wording that do not share the same terms.
| Current ContextVault FTS | Candidate: BGE-base | |
|---|---|---|
| Retrieval approach | Lexical / exact-term matching | Dense semantic embeddings |
| Best at | Names, IDs, error codes, exact technical terms | Paraphrases and semantic matches |
| External SciFact score | Measured: nDCG@10 65.06% | Not measured here yet |
| Query cost | Low; p95 25.7 ms in this run | Requires persisted vectors and an ANN index for scale |
| Local footprint | SQLite FTS index | Roughly 0.4–0.6 GB model download; 768-dimension vectors |
The correct comparison is not “FTS or BGE.” It is eventually FTS + dense retrieval, followed by a reranker over only the strongest candidates. Before that, the dense implementation needs to persist embeddings and use approximate nearest-neighbour search. The first full BGE-small run repeatedly exceeded the CPU benchmark window because it recomputed too much work; those incomplete files are deliberately excluded from the results above.
2. Does the Jev gate make answers safer?
The answer path retrieves passages and can call a separate semantic decision provider, Jev, before it lets a generator write. Generation is allowed only if the decision is trusted, non-degraded, answerable, and non-conflicting. The generator receives only a server-built evidence manifest, and every generated claim must cite manifest evidence.
For the first live diagnostic, direct RAG and Jev-gated RAG received the same FTS candidates and used the same answer model. The corpus had 16 labelled cases. That controls the retrieval and generation input; it isolates the decision gate.
| 16-case live diagnostic | Direct RAG | Jev-gated RAG |
|---|---|---|
| Action correctness | 43.75% | 68.75% |
| Unsupported-answer rate | 25.00% | 0.00% |
| Generated answers | 7 | 3 |
| Abstentions | 9 | 13 |
| Provider / format failures | 7 | 4 |
| Total cost | $0.0006318 | $0.0006225 |
| Total latency, p50 | 0.84 ms | 314.14 ms |
| Total latency, p95 | 2,158.56 ms | 2,942.35 ms |
The honest reading is mixed but encouraging. Jev stopped the unsupported answers observed in this small run, and it slightly reduced failures. It also answered fewer questions and added decision latency. That is a safety/coverage trade-off, not proof of better final answer writing. The generator calls were also flaky enough that this must be repeated on a larger held-out set.
3. What the recovery loop has proved — and what it has not
A gate should not just say “no” and walk away when a missing fact might be elsewhere in the knowledge base. ContextVault’s recovery endpoint builds focused searches from the rejected question, retrieves new chunks under the same metadata filters, merges only new evidence, and asks the gate again. The loop is bounded and stays fail-closed.
An offline 30-case diagnostic verifies the control flow with deterministic providers:
| 30-case offline diagnostic | Direct RAG | Jev-gated | Jev-gated + recovery |
|---|---|---|---|
| Action correctness | 70.0% | 100.0% | 100.0% |
| Answers | 28 | 19 | 19 |
| Abstentions | 2 | 11 | 11 |
This result is intentionally modest. The initial top-5 FTS retrieval already found the expected files in this particular corpus, so recovery did not raise coverage. It demonstrates safe wiring: shared candidates, gate enforcement, evidence merging, citation validation, and round-by-round telemetry. It does not prove that recovery improves production answer quality. A separate multi-hop test verifies that recovery can add a missing second document and then gain approval; a larger held-out benchmark is still needed.
How the system is constrained
The design is deliberately conservative where it matters:
- Evidence is treated as data, not as instructions.
- Jev does not generate the answer and does not grade its own answers.
- Rules fallbacks are marked degraded and cannot authorise generation.
- Citations use server-created evidence IDs and file-level hashes.
- Unknown citations, malformed answers, provider failures, unavailable providers, degraded decisions, and conflicts all return a structured abstention.
- The public upload response does not disclose the server’s internal storage path, and uploads have a default size limit.
That does not make the project production-complete. Authentication, tenant isolation, background ingestion, durable answer storage, persistent dense-vector indexing, claim-level entailment checks, and a dependency security upgrade remain open work.
The next benchmark that matters
The next honest comparison will use the same BEIR SciFact corpus, the same 300 judged queries, and the same top_k=10 for three retrieval arms:
- ContextVault FTS — the measured lexical baseline.
- BGE-base dense retrieval with persisted embeddings and ANN search.
- Hybrid FTS + BGE-base, optionally reranked over the top candidates.
It should report nDCG@10, MRR@10, Recall@1/5/10, index-build time, index size, RAM, p50/p95/p99 latency, error count, exact model version, and corpus checksum. Only then will there be a fair answer to “is dense retrieval better here?”
The raw benchmark JSON stays local under an ignored benchmark-results/ directory because it can contain query text, source snippets, provider telemetry, local paths, and cost data. This post keeps the reviewed conclusions public without turning diagnostic artefacts into accidental published data.
For the implementation, API boundaries, and reproducible commands, see the ContextVault repository, its BEIR SciFact evaluation guide, and the end-to-end evaluation guide.