# langchain-ai/rag-from-scratch architecture

> Architecture diagram of the GitHub repository langchain-ai/rag-from-scratch, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/langchain-ai/rag-from-scratch
- Repository: https://github.com/langchain-ai/rag-from-scratch

## Overview

This repository is an educational notebook series introducing retrieval-augmented generation (RAG), rather than a packaged runtime application. The README identifies indexing, retrieval, and generation as foundational topics, but no notebook contents were provided, so the graph shows only the documented learner-to-notebook relationship and does not infer internal calls or lesson-to-lesson dependencies.

Main entry points: [`rag_from_scratch_1_to_4.ipynb`](https://github.com/langchain-ai/rag-from-scratch/blob/main/rag_from_scratch_1_to_4.ipynb) (Lessons 1–4), [`rag_from_scratch_5_to_9.ipynb`](https://github.com/langchain-ai/rag-from-scratch/blob/main/rag_from_scratch_5_to_9.ipynb) (Lessons 5–9), [`rag_from_scratch_10_and_11.ipynb`](https://github.com/langchain-ai/rag-from-scratch/blob/main/rag_from_scratch_10_and_11.ipynb) (Lessons 10–11), [`rag_from_scratch_12_to_14.ipynb`](https://github.com/langchain-ai/rag-from-scratch/blob/main/rag_from_scratch_12_to_14.ipynb) (Lessons 12–14)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_lessons["RAG lessons"]
  node_notebooks_1_4["Lessons 1–4"]
  node_notebooks_5_9["Lessons 5–9"]
  node_notebooks_10_11["Lessons 10–11"]
  node_notebooks_12_14["Lessons 12–14"]
  node_notebooks_15_18["Lessons 15–18"]
end

node_learner(("Learner"))

node_learner -->|"studies"| node_notebooks_1_4
node_learner -->|"studies"| node_notebooks_5_9
node_learner -->|"studies"| node_notebooks_10_11
node_learner -->|"studies"| node_notebooks_12_14
node_learner -->|"studies"| node_notebooks_15_18

click node_notebooks_1_4 "https://github.com/langchain-ai/rag-from-scratch/blob/main/rag_from_scratch_1_to_4.ipynb"
click node_notebooks_5_9 "https://github.com/langchain-ai/rag-from-scratch/blob/main/rag_from_scratch_5_to_9.ipynb"
click node_notebooks_10_11 "https://github.com/langchain-ai/rag-from-scratch/blob/main/rag_from_scratch_10_and_11.ipynb"
click node_notebooks_12_14 "https://github.com/langchain-ai/rag-from-scratch/blob/main/rag_from_scratch_12_to_14.ipynb"
click node_notebooks_15_18 "https://github.com/langchain-ai/rag-from-scratch/blob/main/rag_from_scratch_15_to_18.ipynb"

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_notebooks_1_4,node_notebooks_5_9,node_notebooks_10_11,node_notebooks_12_14,node_notebooks_15_18 toneBlue
class node_learner toneIndigo
```

## Components

### RAG lessons

- [Lessons 1–4](https://github.com/langchain-ai/rag-from-scratch/blob/main/rag_from_scratch_1_to_4.ipynb): `rag_from_scratch_1_to_4.ipynb`
- [Lessons 5–9](https://github.com/langchain-ai/rag-from-scratch/blob/main/rag_from_scratch_5_to_9.ipynb): `rag_from_scratch_5_to_9.ipynb`
- [Lessons 10–11](https://github.com/langchain-ai/rag-from-scratch/blob/main/rag_from_scratch_10_and_11.ipynb): `rag_from_scratch_10_and_11.ipynb`
- [Lessons 12–14](https://github.com/langchain-ai/rag-from-scratch/blob/main/rag_from_scratch_12_to_14.ipynb): `rag_from_scratch_12_to_14.ipynb`
- [Lessons 15–18](https://github.com/langchain-ai/rag-from-scratch/blob/main/rag_from_scratch_15_to_18.ipynb): `rag_from_scratch_15_to_18.ipynb`

### Other components

- **Learner**

## Connections

- Learner → Lessons 1–4: studies (evidence: `README.md`)
- Learner → Lessons 5–9: studies (evidence: `README.md`)
- Learner → Lessons 10–11: studies (evidence: `README.md`)
- Learner → Lessons 12–14: studies (evidence: `README.md`)
- Learner → Lessons 15–18: studies (evidence: `README.md`)
