projects/multi-domain-search-engine.mdx·2026-04·Solo — Research & Engineering
Multi-Domain Search Engine
A hybrid semantic search engine and RAG system over a ~9,000-document AI/ML corpus — my final-year dissertation, lifting nDCG@10 from 0.355 to 0.828.
// highlights
- Hybrid retrieval combining FAISS dense vector search, BM25 lexical search, and cross-encoder reranking
- Local RAG pipeline (Qwen3-0.6B) producing grounded answers from retrieved sources
- Ranking quality lifted from nDCG@10 of 0.355 (BM25 baseline) to 0.828 with full reranking
- Interactive Streamlit interface for query input, result exploration, and domain filtering
- Validated with a 258-test automated suite, a full dissertation, and a conference-style poster
Background
This was my final-year dissertation at Brunel: design and build a search engine that understands natural-language queries over a ~9,000-document AI/ML corpus, and answer questions grounded in what it retrieves. The system was completed in April 2026 and documented in a full dissertation and a conference-style poster.
Problem
Keyword-based search breaks down the moment a user expresses a query differently from how a document was written. Two sentences can mean the same thing and share zero words in common — token matching fails on intent. But pure semantic search has the opposite weakness: it can miss exact-term lookups that keyword search handles trivially. The goal was a system that gets both right, and then goes a step further by answering rather than just ranking.
Approach
Retrieval is a three-stage hybrid pipeline:
- BM25 lexical search — a classic keyword-frequency ranker that excels at exact-term queries and serves as the evaluation baseline
- FAISS dense retrieval — documents embedded into a vector space; queries retrieved by similarity, catching semantic matches that share no vocabulary
- Cross-encoder reranking — a model that scores each candidate (query, document) pair jointly, reordering the merged candidate set with far more precision than either retriever alone
On top of retrieval sits a Retrieval-Augmented Generation (RAG) pipeline running a local Qwen3-0.6B model — retrieved passages are fed to the model to produce a coherent answer grounded in the sources, rather than leaving the user to read raw chunks. Domain filtering scopes queries to a specific slice of the corpus.
Results
Evaluated with standard IR metrics, the pipeline more than doubled ranking quality over the lexical baseline:
| Configuration | nDCG@10 | | --- | --- | | BM25 baseline | 0.355 | | Full hybrid + cross-encoder reranking | 0.828 |
The system is exercised through an interactive Streamlit interface — query input, ranked result exploration, and domain filtering — and validated by a 258-test automated suite covering the retrieval stages, the RAG layer, and the evaluation tooling.
Learnings
Building a search engine reveals how much nuance lives inside the word "relevance." Dense retrieval is powerful but can surface semantically adjacent documents that are contextually wrong; BM25 is literal but dependable. The cross-encoder is where the quality actually comes from — and also where the latency goes, which is the trade-off the whole architecture negotiates. Rigorous evaluation (nDCG against a fixed baseline) turned tuning from guesswork into engineering, and the test suite mattered because retrieval bugs are subtle: they surface on edge-case queries, never on happy-path demos.