# bhaskrr/information-retrieval architecture

> Architecture diagram of the GitHub repository bhaskrr/information-retrieval, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bhaskrr/information-retrieval
- Repository: https://github.com/bhaskrr/information-retrieval

## Overview

This repository is a **personal Information Retrieval learning workspace**, not a production application. Its architecture is centered on **documentation-first learning**, with a small amount of executable code used to demonstrate core IR algorithms.

1. **Top-level purpose**
   - The repo is organized as a structured knowledge base for IR concepts, progressing from basics to advanced topics.
   - The main “system” is the learning path itself: notes, examples, notebooks, and a progress log.

2. **Documentation layer**
   - `notes/` is the primary content layer.
   - It is split into curriculum phases: basics, text processing, indexing, ranking models, evaluation, neural IR, and advanced topics.
   - Each topic is decomposed into small markdown files, so the architecture is topic-centric rather than application-centric.

3. **Conceptual knowledge backbone**
   - `glossary.md` acts as a shared terminology reference across the repo.
   - `progress-log.md` tracks learning progress over time and functions as a lightweight project history.

4. **Executable examples**
   - The main code artifact visible in the tree is `notes/01-basics/03-retrieval-models/01-boolean-retrieval/boolean-retrieval.py`.
   - This suggests the repo includes small, topic-scoped implementations directly beside the explanation material, rather than a centralized library.

5. **Notebook / experimentation layer**
   - `code/notebooks/` contains Jupyter notebooks for hands-on exploration.
   - The notebooks are grouped by IR stage, especially text processing and indexing:
     - tokenization
     - normalization
     - stopword removal
     - stemming/lemmatization
     - inverted index construction
   - This layer is the interactive counterpart to the notes.

6. **Data access boundary**
   - `datasets/data_loader.py` appears to be a shared utility for loading example data used by notebooks or code snippets.
   - The repo does not show a full dataset management pipeline; instead, data access is centralized in a small helper module.

7. **Core IR pipeline represented in the repo**
   - The learning flow is consistent with a classic IR architecture:
     - raw text input
     - text preprocessing
     - index construction
     - retrieval model
     - ranking/evaluation
   - The notebooks and notes together model this pipeline from preprocessing through retrieval.

8. **Indexing subsystem**
   - `notes/03-indexing/` and the related notebook on inverted indexes show that indexing is treated as a major subsystem.
   - The inverted index is the key structural bridge between text processing and retrieval.

9. **Retrieval and ranking subsystem**
   - `notes/01-basics/03-retrieval-models/` covers boolean retrieval as the first implemented model.
   - `notes/04-ranking-models/` expands the architecture from exact-match retrieval to scored ranking approaches such as TF-IDF and BM25.

10. **Evaluation subsystem**
    - `notes/05-evaluation/` is a separate conceptual layer focused on measuring retrieval quality.
    - Metrics like precision, recall, MAP, MRR, and NDCG indicate that evaluation is treated as its own stage after retrieval/ranking.

11. **Neural and advanced research layers**
    - `notes/06-neural-ir/` and `notes/07-advanced/` are mostly conceptual research areas in this repo.
    - These sections extend the architecture from classical IR into dense retrieval, reranking, hybrid search, ColBERT, and RAG, but no corresponding implementation tree is visible here.

12. **Organizational pattern**
    - Most topics follow the same structure: markdown notes first, then optional notebook or code examples.
    - This makes the repo easy to diagram as a layered knowledge system: concepts at the top, experiments in the middle, and small implementation artifacts at the bottom.

13. **Important architectural boundary**
    - There is no evidence of a web server, API service, database, or production deployment.
    - The repo boundary is educational and research-oriented: documentation and experimentation, not runtime infrastructure.

14. **Best diagram framing**
    - Model this repository as three interacting zones:
      - **Knowledge/content**: `notes/`, `glossary.md`, `progress-log.md`
      - **Interactive experiments**: `code/notebooks/`
      - **Reusable helpers / sample implementations**: `datasets/data_loader.py`, `boolean-retrieval.py`
    - The main data flow is from conceptual notes into notebooks and small code examples, with datasets feeding the experiments.

Main entry points: [`notes/01-basics`](https://github.com/bhaskrr/information-retrieval/tree/main/notes/01-basics) (Basics), [`glossary.md`](https://github.com/bhaskrr/information-retrieval/blob/main/glossary.md) (Glossary), [`notes/04-ranking-models`](https://github.com/bhaskrr/information-retrieval/tree/main/notes/04-ranking-models) (Ranking models), [`code/notebooks`](https://github.com/bhaskrr/information-retrieval/tree/main/code/notebooks) (Notebooks)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_knowledge["Knowledge / content"]
  node_readme["README<br/>overview<br/>[README.md]"]
  node_glossary["Glossary<br/>terminology<br/>[glossary.md]"]
  node_progress["Progress log<br/>journal<br/>[progress-log.md]"]
  node_basics["Basics<br/>curriculum"]
  node_textnotes["Text processing<br/>curriculum"]
  node_indexnotes["Indexing<br/>curriculum"]
  node_ranknotes["Ranking models<br/>curriculum"]
  node_evalnotes["Evaluation<br/>curriculum"]
  node_neuralnotes["Neural IR<br/>curriculum"]
  node_advnotes["Advanced<br/>curriculum"]
end

subgraph group_experiments["Interactive experiments"]
  node_notebooks["Notebooks<br/>experiments"]
  node_nb_text["Text notebooks<br/>notebook set"]
  node_nb_index["Index notebook"]
end

subgraph group_helpers["Reusable helpers / examples"]
  node_datasets["Data loader<br/>helper<br/>[data_loader.py]"]
  node_boolean["Boolean retrieval<br/>example implementation"]
  node_boolean_readme["Boolean notes<br/>topic readme<br/>[README.md]"]
end

node_readme -->|"starts"| node_basics
node_readme -->|"references"| node_glossary
node_readme -->|"tracks"| node_progress
node_basics -->|"leads to"| node_textnotes
node_textnotes -->|"enables"| node_indexnotes
node_indexnotes -->|"supports"| node_ranknotes
node_ranknotes -->|"measured by"| node_evalnotes
node_ranknotes -->|"extends to"| node_neuralnotes
node_neuralnotes -->|"extends to"| node_advnotes
node_basics -->|"documents"| node_boolean_readme
node_boolean_readme -->|"describes"| node_boolean
node_textnotes -->|"explores"| node_notebooks
node_indexnotes -->|"explores"| node_notebooks
node_notebooks -->|"contains"| node_nb_text
node_notebooks -->|"contains"| node_nb_index
node_nb_text -->|"loads"| node_datasets
node_nb_index -->|"loads"| node_datasets
node_boolean -.->|"can use"| node_datasets
node_glossary -.->|"supports"| node_basics
node_glossary -.->|"supports"| node_ranknotes
node_glossary -.->|"supports"| node_evalnotes
node_progress -.->|"reflects"| node_basics

click node_readme "https://github.com/bhaskrr/information-retrieval/blob/main/README.md"
click node_glossary "https://github.com/bhaskrr/information-retrieval/blob/main/glossary.md"
click node_progress "https://github.com/bhaskrr/information-retrieval/blob/main/progress-log.md"
click node_basics "https://github.com/bhaskrr/information-retrieval/tree/main/notes/01-basics"
click node_textnotes "https://github.com/bhaskrr/information-retrieval/tree/main/notes/02-text-processing"
click node_indexnotes "https://github.com/bhaskrr/information-retrieval/tree/main/notes/03-indexing"
click node_ranknotes "https://github.com/bhaskrr/information-retrieval/tree/main/notes/04-ranking-models"
click node_evalnotes "https://github.com/bhaskrr/information-retrieval/tree/main/notes/05-evaluation"
click node_neuralnotes "https://github.com/bhaskrr/information-retrieval/tree/main/notes/06-neural-ir"
click node_advnotes "https://github.com/bhaskrr/information-retrieval/tree/main/notes/07-advanced"
click node_notebooks "https://github.com/bhaskrr/information-retrieval/tree/main/code/notebooks"
click node_nb_text "https://github.com/bhaskrr/information-retrieval/tree/main/code/notebooks/02-text-processing"
click node_nb_index "https://github.com/bhaskrr/information-retrieval/tree/main/code/notebooks/03-indexing"
click node_datasets "https://github.com/bhaskrr/information-retrieval/blob/main/datasets/data_loader.py"
click node_boolean "https://github.com/bhaskrr/information-retrieval/blob/main/notes/01-basics/03-retrieval-models/01-boolean-retrieval/boolean-retrieval.py"
click node_boolean_readme "https://github.com/bhaskrr/information-retrieval/blob/main/notes/01-basics/03-retrieval-models/01-boolean-retrieval/README.md"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_readme,node_glossary,node_progress,node_basics,node_textnotes,node_indexnotes,node_ranknotes,node_evalnotes,node_neuralnotes,node_advnotes toneBlue
class node_notebooks,node_nb_text,node_nb_index toneAmber
class node_datasets,node_boolean,node_boolean_readme toneMint
```

## Components

### Knowledge / content

Markdown-first curriculum, shared terminology, and learning history.

- [README](https://github.com/bhaskrr/information-retrieval/blob/main/README.md): overview · Top-level entry point for the learning workspace. · `README.md`
- [Glossary](https://github.com/bhaskrr/information-retrieval/blob/main/glossary.md): terminology · Shared IR vocabulary across the repo. · `glossary.md`
- [Progress log](https://github.com/bhaskrr/information-retrieval/blob/main/progress-log.md): journal · Lightweight history of learning progress. · `progress-log.md`
- [Basics](https://github.com/bhaskrr/information-retrieval/tree/main/notes/01-basics): curriculum · Foundations: what IR is, taxonomy, and first retrieval models. · `notes/01-basics`
- [Text processing](https://github.com/bhaskrr/information-retrieval/tree/main/notes/02-text-processing): curriculum · Tokenization, normalization, stopwords, stemming, and lemmatization. · `notes/02-text-processing`
- [Indexing](https://github.com/bhaskrr/information-retrieval/tree/main/notes/03-indexing): curriculum · Inverted index, construction, and compression. · `notes/03-indexing`
- [Ranking models](https://github.com/bhaskrr/information-retrieval/tree/main/notes/04-ranking-models): curriculum · Boolean, vector-space, TF-IDF, and BM25 ranking. · `notes/04-ranking-models`
- [Evaluation](https://github.com/bhaskrr/information-retrieval/tree/main/notes/05-evaluation): curriculum · Retrieval metrics and test collections. · `notes/05-evaluation`
- [Neural IR](https://github.com/bhaskrr/information-retrieval/tree/main/notes/06-neural-ir): curriculum · Dense retrieval, bi-encoders, cross-encoders, and SPLADE. · `notes/06-neural-ir`
- [Advanced](https://github.com/bhaskrr/information-retrieval/tree/main/notes/07-advanced): curriculum · Reranking, hybrid search, ColBERT, and RAG. · `notes/07-advanced`

### Interactive experiments

Jupyter notebooks used to explore IR stages hands-on.

- [Notebooks](https://github.com/bhaskrr/information-retrieval/tree/main/code/notebooks): experiments · Hands-on exploration of core IR stages. · `code/notebooks`
- [Text notebooks](https://github.com/bhaskrr/information-retrieval/tree/main/code/notebooks/02-text-processing): notebook set · Notebook exercises for tokenization and normalization steps. · `code/notebooks/02-text-processing`
- [Index notebook](https://github.com/bhaskrr/information-retrieval/tree/main/code/notebooks/03-indexing): notebook · Interactive inverted-index construction exercise. · `code/notebooks/03-indexing`

### Reusable helpers / examples

Small code artifacts and data-loading support used by the experiments.

- [Data loader](https://github.com/bhaskrr/information-retrieval/blob/main/datasets/data_loader.py): helper · Shared dataset access used by notebooks and examples. · `datasets/data_loader.py`
- [Boolean retrieval](https://github.com/bhaskrr/information-retrieval/blob/main/notes/01-basics/03-retrieval-models/01-boolean-retrieval/boolean-retrieval.py): example implementation · Topic-scoped retrieval implementation beside the notes. · `notes/01-basics/03-retrieval-models/01-boolean-retrieval/boolean-retrieval.py`
- [Boolean notes](https://github.com/bhaskrr/information-retrieval/blob/main/notes/01-basics/03-retrieval-models/01-boolean-retrieval/README.md): topic readme · Guidance for the boolean retrieval example. · `notes/01-basics/03-retrieval-models/01-boolean-retrieval/README.md`

## Connections

- README → Basics: starts · Introduces the learning path.
- README → Glossary: references · Shared terminology anchor.
- README → Progress log: tracks · Records learning progress.
- Basics → Text processing: leads to · Foundation moves into preprocessing.
- Text processing → Indexing: enables · Preprocessing feeds indexing.
- Indexing → Ranking models: supports · Index structure underpins retrieval models.
- Ranking models → Evaluation: measured by · Ranking quality is evaluated with metrics.
- Ranking models → Neural IR: extends to · Classical retrieval expands into neural methods.
- Neural IR → Advanced: extends to · Advanced research topics build on neural IR.
- Basics → Boolean notes: documents · Example-focused explanation for boolean retrieval.
- Boolean notes → Boolean retrieval: describes · The executable example lives beside the notes.
- Text processing → Notebooks: explores · Notebook experiments mirror the preprocessing curriculum.
- Indexing → Notebooks: explores · Notebook experiments mirror indexing concepts.
- Notebooks → Text notebooks: contains · Text-processing notebook set.
- Notebooks → Index notebook: contains · Indexing notebook set.
- Text notebooks → Data loader: loads · Notebooks use shared example data.
- Index notebook → Data loader: loads · Notebooks use shared example data.
- Boolean retrieval → Data loader: can use · Example code may share the same loader boundary.
- Glossary → Basics: supports · Terminology anchors the curriculum.
- Glossary → Ranking models: supports · Terminology anchors the curriculum.
- Glossary → Evaluation: supports · Terminology anchors the curriculum.
- Progress log → Basics: reflects · Learning history follows the curriculum.
