OGX RAG Benchmarks: Open-Source Retrieval That Outperforms OpenAI
We benchmarked OGX's RAG pipeline against OpenAI's file search across four BEIR retrieval datasets, MultiHOP RAG, and Doc2Dial. The results: OGX hybrid search beats OpenAI on 3 of 4 BEIR datasets, with up to 29.6% higher nDCG@10 on argument retrieval. With contextual chunking (gpt-4.1-mini), OGX now wins on all 4 datasets — closing the fiqa gap with a +65% improvement. Pair it with Gemma 31B and you get end-to-end RAG that exceeds GPT-4.1 by 81% on multi-hop reasoning, all running on your own infrastructure.
This isn't a synthetic demo. These are standard academic benchmarks, measured end-to-end through the same OpenAI-compatible APIs you'd use in production.
Why We Built This Benchmark Suite
RAG quality is hard to evaluate. Most teams ship a retrieval pipeline, eyeball a few queries, and hope for the best. We wanted something more rigorous: a reproducible benchmark suite that tests OGX's full API stack (Files, Vector Stores, Search, and Responses) against OpenAI under identical conditions.
The benchmark suite evaluates two dimensions:
- Retrieval quality (BEIR) -- can the system find the right documents?
- End-to-end RAG (MultiHOP, Doc2Dial) -- can it retrieve and generate correct answers?
Every test runs through the same OpenAI-compatible API surface, so the comparison is apples-to-apples.
The Setup
OGX configuration:
| Component | Choice |
|---|---|
| Embedding model | nomic-ai/nomic-embed-text-v1.5 (sentence-transformers) |
| Reranker | Qwen/Qwen3-Reranker-0.6B (transformers) |
| Vector database | Milvus (standalone) |
| Chunk size | 512 tokens |
| Chunk overlap | 128 tokens |
| Hybrid search | RRF fusion (impact factor 60.0) + reranker |
Search modes compared:
- OpenAI -- OpenAI's hosted file search (black box)
- OGX Vector -- pure semantic search with Nomic embeddings
- OGX Hybrid -- semantic + keyword search, fused with RRF and reranked
- OGX Hybrid + Contextual -- hybrid search with contextual chunking (gpt-4.1-mini prepends document-level context to each chunk before embedding)
For end-to-end RAG, we also tested Gemma 31B (google/gemma-4-31B-it via vLLM) as an alternative to GPT-4.1.
Retrieval Results: BEIR
BEIR is the standard benchmark for information retrieval. We evaluated on four diverse datasets spanning biomedical literature, scientific fact-checking, argument mining, and financial QA.
nDCG@10
| Dataset | OpenAI | OGX Vector | OGX Hybrid | OGX Hybrid + Contextual | Best Delta vs OpenAI |
|---|---|---|---|---|---|
| nfcorpus | 0.3156 | 0.3106 | 0.3350 | 0.3316 | +6.1% |
| scifact | 0.7165 | 0.6943 | 0.7137 | 0.7086 | -0.4% |
| arguana | 0.2960 | 0.3765 | 0.3835 | 0.3936 | +33.0% |
| fiqa | 0.2862 | 0.2399 | 0.2170 | 0.3586 | +25.3% |
Recall@10
| Dataset | OpenAI | OGX Vector | OGX Hybrid | OGX Hybrid + Contextual | Best Delta vs OpenAI |
|---|---|---|---|---|---|
| nfcorpus | 0.1469 | 0.1482 | 0.1646 | 0.1653 | +12.5% |
| scifact | 0.8067 | 0.8369 | 0.8362 | 0.8284 | +3.7% |
| arguana | 0.6764 | 0.7610 | 0.7781 | 0.7902 | +16.8% |
| fiqa | 0.3117 | 0.2843 | 0.2681 | 0.4358 | +39.8% |
With contextual chunking, OGX now wins on all 4 datasets in both nDCG@10 and Recall@10. The fiqa result is the standout: contextual chunking transforms OGX from 24% behind OpenAI to 25% ahead, a +65% improvement over standard hybrid. On arguana, contextual chunking pushes the lead from 29.6% to 33.0%.
End-to-End RAG: MultiHOP and Doc2Dial
Retrieval is only half the story. End-to-end RAG tests whether the system can retrieve relevant context and produce correct answers. We used GPT-4.1 as the generation model for both OpenAI and OGX pipelines, plus Gemma 31B as an open-source alternative.
MultiHOP RAG (F1 Score)
MultiHOP tests multi-hop reasoning over 609 news articles with 2,556 queries that require synthesizing information across documents.
| Configuration | F1 | ROUGE-L | vs OpenAI |
|---|---|---|---|
| OpenAI | 0.0114 | 0.0116 | -- |
| OGX Vector + GPT-4.1 | 0.0141 | 0.0147 | +23.7% |
| OGX Hybrid + GPT-4.1 | 0.0141 | 0.0147 | +23.7% |
| OGX Hybrid + Contextual + GPT-4.1 | 0.0136 | 0.0134 | +19.3% |
| OGX Hybrid + Gemma 31B | 0.0207 | 0.0203 | +81.6% |
The headline number: OGX with Gemma 31B scores 81.6% higher F1 than OpenAI with GPT-4.1 on multi-hop reasoning. Even with GPT-4.1 on both sides, OGX's retrieval pipeline delivers 23.7% better end-to-end accuracy. Contextual chunking delivers strong retrieval metrics (nDCG@10 = 0.62, Recall@10 = 0.70), confirming the retrieval layer works well even when generation scores remain low.
Doc2Dial (F1 Score)
Doc2Dial evaluates document-grounded dialogue: 488 documents, 200 conversations, 1,203 turns.
| Configuration | F1 | ROUGE-L |
|---|---|---|
| OpenAI | 0.1337 | 0.1136 |
| OGX Vector + GPT-4.1 | 0.0962 | 0.0790 |
| OGX Hybrid + GPT-4.1 | 0.0966 | 0.0794 |
| OGX Hybrid + Contextual + GPT-4.1 | 0.1101 | 0.0902 |
| OGX Hybrid + Gemma 31B | 0.0634 | 0.0513 |
OpenAI still leads, but contextual chunking narrows the gap from 39% to 18% on F1 (0.1101 vs 0.1337). Doc2Dial's conversational format benefits from OpenAI's retrieval handling of conversational context, but contextual chunking helps OGX by providing better chunk-level context for dialogue grounding. Gemma 31B's lower score is partly explained by its verbosity (~2,500 characters average vs ~95 character ground truths), which penalizes token-level F1 even when the answer content is correct. Notably, Gemma produced zero empty responses across all 1,203 queries.
What This Means
Three takeaways from these benchmarks:
1. Hybrid search + contextual chunking is the strongest configuration. With contextual chunking, OGX now wins on all 4 BEIR datasets — including fiqa, where standard hybrid search lagged behind OpenAI. The +65% improvement on fiqa shows that domain-specific text benefits enormously from LLM-generated chunk context.
2. Open-source models can win at end-to-end RAG. Gemma 31B with OGX retrieval outperformed GPT-4.1 with OpenAI retrieval on multi-hop reasoning by a wide margin. The retrieval pipeline matters as much as the generation model.
3. The configurability pays off. OpenAI still leads on conversational grounding (Doc2Dial), but contextual chunking cuts the gap from 39% to 18%. OGX leads on biomedical, scientific, argumentative, and financial retrieval, plus multi-hop reasoning. The ability to tune chunking strategy, embedding model, and search mode per-domain is a concrete advantage.
Reproduce It Yourself
The full benchmark suite is open source and reproducible. See the RAG Benchmarks documentation for setup instructions, dataset details, and methodology.
All benchmarks run through the standard OpenAI-compatible API, so you can swap in your own embedding models, rerankers, or vector databases and measure the impact directly.
What's Next
We're expanding the benchmark suite with additional datasets and retrieval configurations. Areas we're investigating:
- Embedding model comparisons -- testing newer embedding models against Nomic
- Conversational retrieval -- improving Doc2Dial performance with conversation-aware search
- Larger-scale benchmarks -- datasets with 100K+ documents to test scaling behavior
Update (July 2026): We've completed contextual chunking benchmarks across all 6 datasets. Contextual chunking with gpt-4.1-mini closes the fiqa gap entirely (+65% nDCG@10) and narrows the Doc2Dial gap from 39% to 18%. Results have been added to the tables above.
If you're running RAG workloads in production and want to see how OGX compares on your data, get started with OGX or join the conversation on GitHub.
