Skip to content

feat: SimpleRetriever (~50 LOC) matches the ~2,800 LOC stack — simplification validated#31

Open
Ven-Z8 wants to merge 9 commits into
mainfrom
feat/simple-retriever
Open

feat: SimpleRetriever (~50 LOC) matches the ~2,800 LOC stack — simplification validated#31
Ven-Z8 wants to merge 9 commits into
mainfrom
feat/simple-retriever

Conversation

@Ven-Z8

@Ven-Z8 Ven-Z8 commented Jun 15, 2026

Copy link
Copy Markdown
Owner

Summary

The rethink/un-complication pass. 4 layer workflows converged: the heavy retrieval stack is over-engineered. Adds SimpleRetriever (retrieval/simple.py, ~50 LOC: one FastEmbed dense embedder + one FastEmbed cross-encoder, proper query/passage prefixes), wired as --pipeline simple.

Head-to-head (same 4 docs, 25 Q, 0 empty)

Pipeline page-Recall@5 @10 Code
Simple (bge-base + bge-reranker-base) 0.795 0.872 ~50 LOC
Enterprise (SPLADE+ColBERT+RRF+adaptive+router) 0.808 0.888 ~2,800 LOC

Within noise → the 150-function stack buys ~nothing. Recommend: adopt simple, delete ~2,000 LOC.

Key findings (in docs/benchmarks-mmlongbench.md)

  • Extraction is NOT the bottleneck (3 engines ~0.67); ordering is (@5 0.67 vs @10 0.79) → cross-encoder, not ColPali.
  • Path to 0.85 = stronger embedder (bge-large/Qwen3 — OOM'd the local Mac; needs more RAM/GPU) + maybe visual retrieval. Not more architecture.

Status: NOT for merge yet — paused for regroup. Captures the validated simplification + a working simple pipeline.

Ven-Z8 and others added 6 commits June 15, 2026 13:15
…-encoder)

Per the 4-workflow simplification consensus: one strong dense embedder
(bge-large-en-v1.5, fastembed, with query/passage prefixes) + one cross-encoder
(bge-reranker-base) over top-N — the documented two-stage shape, ~50 LOC, zero
new deps. Targets the proven @5<->@10 ordering gap (0.668 vs 0.789). Wired as
--pipeline simple for ablation vs the 0.67 enterprise stack.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…load OOM'd)

The eval builds a fresh SimpleRetriever per doc, which reloaded bge-large (~1.3GB)
+ reranker every document -> OOM (EXIT=137) at doc 2. Share embed/rerank models
via a module cache; only the per-doc Qdrant index is fresh.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
… doc 4)

Each doc opened a local QdrantClient that was never closed -> handle/memory
accumulation -> OOM (EXIT=137). Add SimpleRetriever.close() and call it + gc.collect()
after each doc in the eval loop.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…OOM'd locally)

bge-large (1024d, ~1.3GB) repeatedly OOM'd the local Mac at doc 4 on the 10-doc
set. Switch to bge-base-en-v1.5 (768d, ~440MB) — still a major upgrade over the
33M bge-small, fastembed-native, fits memory; the cross-encoder is the main
ordering lever regardless.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Head-to-head (same 4 docs, 25 Q): simple two-stage (bge-base + cross-encoder, ~50
LOC) page-Recall@5=0.795 vs enterprise (SPLADE+ColBERT+RRF+adaptive+router, ~2,800
LOC)=0.808 — within noise. The heavy stack buys ~nothing. Adopt simple, delete
~2,000 LOC. Path to 0.85 = stronger embedder (OOMs locally) + maybe visual, not
more architecture.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ven-Z8 has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.

Ven-Z8 and others added 3 commits June 15, 2026 22:29
Each doc runs in a fresh subprocess so peak RAM is reclaimed between docs -
fixes the 16GB-local OOM that killed the simple pipeline at doc 5 (accumulation,
not single-doc). Adds --doc-index/--embed-model/--dim/--records-out and a
scripts/eval_mmlb_isolated.py wrapper that loops per-doc and aggregates
page-Recall + lift. Unblocks running a STRONGER embedder (bge-large) on the full
10-doc set. 1-doc bge-large: 0.667@5, no OOM.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
# Conflicts:
#	docs/benchmarks-mmlongbench.md
#	scripts/eval_mmlongbench.py
#	src/contextiq/evals/mmlongbench/runner.py
… comment)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant