contexel GitHub

Benchmarks

Measured, not asserted — and deliberately without a headline "X% reduction" number, because reduction is a property of your data and your budget, not of the library. Two reproducible suites; full tables live in the repo (benchmarks/RESULTS.md, benchmarks/COMPARISON.md).

Suite 1 — contexel's own claims

python -m benchmarks (needs the accurate extra). Highlights:

Suite 2 — against the prior art, on real data

python -m benchmarks.competitors (needs the benchmarks extra; first run downloads the CodeSearchNet python/test split, ~30 MB). The full split — 22,176 real functions — is reconstructed into 28,047 search-tool records with genuine duplicates, plus 100 ground-truth episodes where the record the agent needed is known and guaranteed present in the raw hits, so recall isolates shaping loss, not retrieval loss. Budget: 1,500 tokens.

ImplementationNative opsms @28kms/episode Recall (strong/weak)ComplianceFillUseful Import msDeps
contexel6/66915.5 100% / 100%100%0.95× 100%190
hand-written glue0/6271.6 93% / 32%100%0.95×100%
toolz2/6456.8 100% / 100%0%91.6×100%140
langchain-core1/61477.1 30% / 30%100%0.52×89.8%9625
llama-index-core0/618920.8 100% / 100%0%129×74.2%1,20960

How to read it

Limits, stated plainly

Recall@budget has a ceiling no shaper escapes: when a query legitimately describes more records than the budget holds, some valid record is cut — semantic or not. The 100% here means the ambiguity clusters resolved once exact-word evidence was used; vaguer queries, a different corpus, or a tighter budget can put it back under 100, and that is the data's property, not the policy's.

rescore is lexical: a query saying parsing scores zero against a document saying parse; synonyms and paraphrase belong to semantic rerankers (LLMLingua, ColBERT, cross-encoders), which contexel deliberately does not compete with.

And shaping is not an injection defense: rescore ranks textual relevance — a hostile record that matches the query well ranks well, including one that says "ignore all previous instructions". contexel ships two deterministic boundary controls — allowlist (a provenance gate, the strong control) and quarantine (a pattern tripwire for the loud, literal cases; paraphrase passes it) — both traced and audited. Content authentication still belongs upstream of the contract; treat every shaped record as data, never as instructions.