The Dataset Viewer has been disabled on this dataset.

scrydb-eval

Prebuilt scrydb indices, TREC-formatted qrels, and the retrieval runs behind the evaluation of SQLite is Enough. Lexical, Semantic, and Hybrid Search with scrydb, covering eight BEIR datasets.

Each .db file is a single, self-contained SQLite database holding everything a retrieval experiment needs: the raw document and query text, an FTS5 lexical index, and every embedding at three precisions — binary (1 bit/dim), int8 (1 byte/dim), and float32 — as sqlite-vec vec0 tables. No separate corpus dump, no vector store, no index-building step: download one file and run all thirteen retrieval configurations against it.

What's in here

indices/                      # 8 scrydb SQLite databases (~27 GB total)
  arguana.db  fiqa.db  nfcorpus.db  quora.db
  scidocs.db  scifact.db  trec-covid.db  webis-touche2020.db

qrels/                        # BEIR qrels converted to TREC format
  arguana/test.trec
  fiqa/{train,dev,test}.trec
  nfcorpus/{train,dev,test}.trec
  quora/{dev,test}.trec
  scidocs/test.trec
  scifact/{train,test}.trec
  trec-covid/test.trec
  webis-touche2020/test.trec

runs/                         # 8 datasets x 13 methods = 104 TREC run files (~16 GB total)
  <dataset>-<method>.txt

Datasets

Dataset Index file Documents Queries indexed Test queries Test qrels Index size
ArguAna arguana.db 8,674 1,406 1,406 1,406 263 MB
FiQA-2018 fiqa.db 57,600 6,648 648 1,706 1.4 GB
NFCorpus nfcorpus.db 3,633 3,237 323 12,334 183 MB
Quora quora.db 522,931 15,000 10,000 15,675 11 GB
SciDocs scidocs.db 25,657 1,000 1,000 29,928 656 MB
SciFact scifact.db 5,183 1,109 300 339 189 MB
TREC-COVID trec-covid.db 171,331 50 50 66,336 4.0 GB
Touché-2020 webis-touche2020.db 382,545 49 49 2,214 9.4 GB

"Queries indexed" is every query stored in the database — for datasets where BEIR ships multiple splits, that includes the train/dev queries too. The run files cover all of them; evaluation is restricted to the query ids present in the qrels you evaluate against.

Quick start

Fetch a single index (they are large — download only what you need):

pip install -U scrydb huggingface_hub
hf download breuert/scrydb-eval --repo-type dataset \
  --include "indices/nfcorpus.db" "qrels/nfcorpus/*" "runs/nfcorpus-*" \
  --local-dir scrydb-eval

or from Python:

from huggingface_hub import hf_hub_download

db = hf_hub_download("breuert/scrydb-eval", "indices/nfcorpus.db", repo_type="dataset")

Search the index interactively with BM25:

import scrydb

idx = scrydb.Index.open(db)

idx.search("vitamin B12", mode="lexical") # BM25 as implemented by FTS5

Regenerate a full run file. Because the query embeddings are stored alongside the documents, batch_search reuses them rather than re-encoding the query text. No embedding models or GPUs are required at this point:

run = idx.batch_search(mode="semantic", 
                       precision="binary", 
                       rerank="int8",
                       rerank_depth=1000, 
                       top_k=1000)

run.write_trec("nfcorpus-hamming-cosine_int8.txt")

Evaluate it:

trec_eval -m map -m recip_rank -m P.10 -m ndcg_cut.10 \
  qrels/nfcorpus/test.trec runs/nfcorpus-hamming-cosine_int8.txt

The index files

Every .db is an ordinary SQLite database. scrydb is a convenience layer over it, not a custom format — any SQLite client can read it, and with the sqlite-vec extension loaded, query it.

Table Contents
documents (id TEXT PRIMARY KEY, payload TEXT) — payload is the JSON row {"docid": ..., "text": ...}
queries same shape, payload {"qid": ..., "text": ...}
documents_fts FTS5 virtual table over the document text, tokenize='porter'
vec_documents_binary vec0(embedding bit[4096]) — Hamming distance
vec_documents_int8 vec0(embedding int8[4096] distance_metric=cosine)
vec_documents_float vec0(embedding float[4096] distance_metric=cosine)
vec_queries_{binary,int8,float} the same three precisions for the query side

How the embeddings were produced

Document and query embeddings were computed once, ahead of time, with Qwen3-Embedding-8B served over a remote embedding API, and stored in the index as float32. Documents are embedded as "<title>\n\n<text>", using BEIR's title and text fields; documents without a title use the text alone. Queries are embedded from their query text. The same concatenated string is what is stored in documents.payload and indexed by FTS5, so the lexical and semantic sides of an index see identical text.

The int8 and binary representations are derived inside SQLite by sqlite-vec at index time (vec_quantize_int8(vec_normalize(...), 'unit') and vec_quantize_binary(...)), never in NumPy — so the stored quantization is exactly what a re-index of the same float vectors would produce. A 4096-dim vector occupies 16 KB at float32, 4 KB at int8, and 512 bytes binarized.

Note that these are independently recomputed embeddings, not the ones behind the MTEB leaderboard entry for the same model. The two are compared in the paper but do not come from the same pipeline.

The qrels

BEIR ships qrels as a TSV with a query-id / corpus-id / score header. Each file here is the TREC-format conversion produced by scripts/datasets/beir/convert_qrels_to_trec.py, which inserts the constant iteration column TREC tools expect:

query-id <TAB> 0 <TAB> corpus-id <TAB> relevance

Relevance grades are unchanged from BEIR (binary for most datasets; graded 0–2 for NFCorpus, TREC-COVID, and Touché). Only the test split is used in the paper; the train/dev splits that BEIR provides for FiQA, NFCorpus, SciFact, and Quora are included for convenience.

The runs

104 TREC run files, runs/<dataset>-<method>.txt, six whitespace-separated columns:

qid  Q0  docid  rank  score  run

Each holds up to 1000 documents per query. BM25-first runs can be shorter than 1000 for a given query, since FTS5 only returns documents that actually match a query term.

Methods

The thirteen configurations map one-to-one onto scrydb's mode= / precision= / rerank= vocabulary. All were generated with top_k=1000, rerank_depth=1000, candidate_limit=1000, and RRF's default rrf_k=60.

Run suffix Method batch_search(...)
-bm25 BM25 mode="lexical"
-bm25-hamming BM25 + Hamming mode="lexical", rerank="binary"
-bm25-cosine_int8 BM25 + cosint8 mode="lexical", rerank="int8"
-bm25-cosine_float BM25 + cosfloat mode="lexical", rerank="float"
-hamming Hamming mode="semantic", precision="binary"
-hamming-cosine_int8 Hamming + cosint8 mode="semantic", precision="binary", rerank="int8"
-hamming-cosine_float Hamming + cosfloat mode="semantic", precision="binary", rerank="float"
-cosine_int8 cosint8 mode="semantic", precision="int8"
-cosine_int8-cosine_float cosint8 + cosfloat mode="semantic", precision="int8", rerank="float"
-cosine_float cosfloat mode="semantic", precision="float"
-rrf-hamming RRF(Hamming) mode="hybrid", precision="binary"
-rrf-cosine_int8 RRF(cosint8) mode="hybrid", precision="int8"
-rrf-cosine_float RRF(cosfloat) mode="hybrid", precision="float"

The score column

Every ranker reports higher-is-better, but the quantity differs by method — worth knowing if you compare scores across runs rather than just ranks:

Method family Score column holds
BM25 negated FTS5 bm25()
Hamming negative Hamming distance (e.g. -1005)
cosint8, cosfloat cosine similarity in [-1, 1]
any + rerank the rerank stage's score, not the first stage's
RRF the fused reciprocal-rank score (≤ 2/(60+1))

Self-matches

To reproduce the published numbers, self-matches must be removed from the runs first. It changes ArguAna substantially (0.514 → 0.724 nDCG@10 for cosfloat) and is otherwise near-inconsequential.

BEIR draws some datasets' queries from the corpus itself, so a query's own document can be retrieved for it. BEIR's reference implementation never scores that document, and the MTEB baseline inherits that exclusion. The run files here are unfiltered — they contain the self-match — and effectiveness.py strips it at evaluation time. Of the eight datasets only ArguAna is materially affected (the self-match takes rank 1 for 91% of its queries; excluding it raises cosfloat from 0.514 to 0.724 nDCG@10), with a further 9 incidental id collisions on FiQA and none elsewhere. Filtering is a one-liner if you evaluate outside the provided code:

lines = (l for l in open(run) if l.split()[0] != l.split()[2])

Reproducing the evaluation

The full protocol lives in scrydb-eval, which also carries the resulting CSVs, LaTeX/Markdown tables, and plots:

git clone https://github.com/breuert/scrydb-eval && cd scrydb-eval

python scripts/evaluation/effectiveness.py                              # AP, RR, P@10, nDCG@10 vs. the MTEB baseline
python scripts/evaluation/efficiency.py --n-queries 10 --n-reps 10      # query latency

Effectiveness is computed from runs/ + qrels/ alone, so it reproduces without downloading the 27 GB of indices. Efficiency re-times queries against the indices and therefore needs them.

Results

Retrieval effectiveness (nDCG@10). Best score per row in bold, second-best italicised; tied methods share the mark, with ties determined by the unrounded scores.

Dataset Measure BM25 BM25 + Hamming BM25 + cosint8 BM25 + cosfloat Hamming Hamming + cosint8 Hamming + cosfloat cosint8 cosint8 + cosfloat cosfloat RRF(Hamming) RRF(cosint8) RRF(cosfloat) MTEB (Qwen3-8B)
ArguAna nDCG@10 0.486 0.717 0.723 0.724 0.717 0.723 0.724 0.723 0.724 0.724 0.627 0.629 0.630 0.769
FiQA nDCG@10 0.247 0.592 0.600 0.598 0.635 0.649 0.645 0.649 0.645 0.645 0.446 0.454 0.453 0.646
NFCorpus nDCG@10 0.323 0.388 0.384 0.386 0.406 0.406 0.410 0.406 0.410 0.410 0.389 0.391 0.389 0.414
Quora nDCG@10 0.801 0.891 0.892 0.892 0.889 0.890 0.890 0.890 0.890 0.890 0.878 0.878 0.878 0.889
SciDocs nDCG@10 0.157 0.300 0.308 0.308 0.309 0.320 0.320 0.320 0.320 0.320 0.238 0.241 0.239 0.327
SciFact nDCG@10 0.681 0.782 0.786 0.787 0.783 0.786 0.787 0.786 0.787 0.787 0.754 0.760 0.759 0.785
Touché nDCG@10 0.322 0.333 0.362 0.361 0.329 0.360 0.360 0.360 0.360 0.360 0.394 0.407 0.414 0.359
TREC-COVID nDCG@10 0.605 0.879 0.884 0.879 0.876 0.895 0.885 0.895 0.885 0.885 0.847 0.853 0.850 0.950

Mean query latency (ms), with corpus size and mean query length (words, over the queries timed for that row). Fastest method per row in bold, second-fastest italicised.

Dataset Size Query Length BM25 BM25 + Hamming BM25 + cosint8 BM25 + cosfloat Hamming Hamming + cosint8 Hamming + cosfloat cosint8 cosint8 + cosfloat cosfloat RRF(Hamming) RRF(cosint8) RRF(cosfloat)
ArguAna 8.67K 181.4 566.8 573.6 584.5 612.3 1.9 10.4 38.7 40.0 91.3 71.7 574.7 626.9 712.7
FiQA 57K 11.0 53.1 70.7 112.6 310.7 9.8 58.5 261.3 304.9 547.8 484.1 74.7 360.3 543.6
NFCorpus 3.6K 3.9 1.4 5.2 10.3 21.4 2.3 6.9 20.3 22.2 39.6 34.3 4.2 24.0 37.2
Quora 523K 9.9 228.7 324.7 670.9 5293.5 81.5 560.6 6034.1 2971.0 9073.1 7294.8 397.4 3160.0 7669.6
SciDocs 25K 10.0 38.0 48.7 76.5 167.7 6.7 35.4 135.6 156.1 264.3 231.2 42.7 185.1 264.7
SciFact 5K 12.6 8.2 12.8 20.1 40.8 3.0 9.4 30.0 31.9 59.1 51.3 13.1 42.2 60.8
Touché 382K 6.3 436.5 538.2 933.9 3635.6 53.7 449.8 4532.4 2097.8 9138.4 6259.0 423.5 2225.4 5325.8
TREC-COVID 171K 9.5 211.6 253.4 392.2 1020.3 24.4 184.6 812.7 955.8 1748.2 1558.4 273.2 1172.8 2174.9
Mean -- -- 193.0 228.4 350.1 1387.8 22.9 164.5 1483.1 822.5 2620.2 1998.1 225.4 974.6 2098.7

Latencies were measured on a single consumer machine: an Apple MacBook Air (Mac14,15), M2 SoC (4 performance + 4 efficiency cores, ARM64), 24 GB unified memory, macOS 26.5.2, no GPU involved. Each timed call goes through a stored query id, so it reuses the precomputed query embedding and measures database-side retrieval cost only, excluding model inference. One untimed warm-up call precedes each query's timed repetitions; queries, not repetitions, are the sampling unit for all reported statistics.

Limitations and intended use

  • Not a corpus release. These are derived artifacts. The BEIR corpora themselves are distributed by their original authors; use BEIR or the BeIR collections if you need the raw text under its own terms. The artifacts in this repository are derived from the BEIR benchmark, and the underlying corpora remain under their original per-dataset licenses and terms of use, which are listed in the BEIR repository and in each dataset's source publication. The scrydb library itself is MIT-licensed.
  • Embeddings are model- and pipeline-specific. Every semantic result here is conditional on Qwen3-Embedding-8B and on the prompt formatting described above. Numbers are not directly comparable to leaderboard entries computed with a different pipeline, even for the same model.
  • Exhaustive, not approximate. scrydb scans the whole collection; there is no ANN index. Latency scales linearly with corpus size, which is practical up to a few million documents on commodity hardware and impractical well beyond that.

Citation

@misc{scrydb2026,
      title={SQLite is Enough. Lexical, Semantic, and Hybrid Search with scrydb}, 
      author={Timo Breuer},
      year={2026},
      eprint={2608.24060},
      archivePrefix={arXiv},
      primaryClass={cs.IR},
      url={https://arxiv.org/abs/2608.24060} 
}

Please also cite BEIR, the individual test collections, and the Qwen3 Embedding article if you use any of the resources.

Downloads last month
164

Paper for breuert/scrydb-eval