Back to featured work
Information Retrieval · RAGComplete

Mini Search Engine with RAG Extension

Build a classical information retrieval system first, then extend it with grounded answer generation.

Mini Search Engine with RAG Extension presentation cover
Problem
RAG quality is hard to measure once an LLM hides the retrieval step.
What I built
A TF-IDF search engine evaluated on Cranfield, then extended with Gemini RAG.
My role
Project author: parsing, indexing, retrieval, evaluation, and the RAG layer.
Result
README-reported MAP of 0.2976 and NDCG@20 of 0.3988 on Cranfield.
Cranfield benchmarkTF-IDF retrievalCosine similarityInverted indexMAP / NDCG evaluationGemini RAG extension

Evidence

More recorded proof

Evaluation

Cranfield retrieval scores

The repository README reports these Cranfield ranking scores. They are shown as repository-reported values, not recomputed for this portfolio.

Condition: Cranfield document-ranking evaluation

MAP · full ranking
0.2976
NDCG@20
0.3988
NDCG@1,400
0.5186

These scores describe retrieval ranking only; they do not measure generated-answer quality or grounding. NDCG@1,400 covers the full ranked set recorded in the existing project notes.

Problem

What this project had to solve

RAG systems are easier to market than to evaluate. This project starts with a classical IR system on Cranfield, then adds a generation layer so retrieval quality stays measurable instead of disappearing behind an LLM response.

Role / contribution

What I owned in the system

Project author responsible for dataset parsing, indexing, retrieval, evaluation, and the RAG extension described in the repository.

Architecture flow

System flow from input to output

Step 01

Dataset parsing

What happens

Cranfield documents, queries, and relevance labels are extracted into a structured IR pipeline.

Why it matters

A structured benchmark pipeline is what makes retrieval evaluation possible from the start.

Related tools

Cranfield

Engineering decisions

Tradeoffs that shaped the build

  1. Decision 01

    Keep classical IR visible

    The project does not hide retrieval behind the generation layer; evaluation remains a first-class output.

  2. Decision 02

    Separate retrieval and generation concerns

    The RAG extension is layered on top of a measurable baseline rather than mixed into the core retrieval logic.

  3. Decision 03

    Use benchmark-driven reasoning

    Cranfield gives the project a concrete evaluation frame instead of anecdotal search results.

Technical implementation

How the system is built

The core engine parses Cranfield, preprocesses text, builds an inverted index, and constructs a sparse TF-IDF retrieval pipeline ranked with cosine similarity.

Evaluation is explicit through MAP and NDCG, which keeps retrieval behavior inspectable before generation is layered on top.

The RAG extension passes top retrieved documents into Gemini so answers stay connected to the retrieval output rather than free-form generation.

Stack

Core tools and system layers

PythonTF-IDFCosine SimilarityNLTKSciPyCranfieldGemini 2.5 Flash

Project explainer

Ask about this project

A case-study guide to the architecture and decisions behind Mini Search Engine with RAG Extension.