|
| 1 | +# Apollo 11 RAG & Distilled Model Evaluation |
| 2 | + |
| 3 | +This notebook demonstrates a **Retrieval-Augmented Generation (RAG)** system |
| 4 | +using data from the **Apollo 11 mission**. |
| 5 | +It uses **LangChain**, **HuggingFace**, and **ChromaDB** to load, embed, and |
| 6 | +query textual data, then evaluates responses using a set of pre-defined prompts |
| 7 | +from a JSON file. |
| 8 | + |
| 9 | +--- |
| 10 | + |
| 11 | +## Project Description |
| 12 | + |
| 13 | +The notebook `Apollo11_rag&distilled.ipynb` contains a structured RAG pipeline |
| 14 | +with four main parts: |
| 15 | + |
| 16 | +1. **Data Loading** β Reads Apollo 11 mission text data from a JSON file. |
| 17 | +2. **Database Creation** β Builds a local ChromaDB vector store for semantic |
| 18 | +search. |
| 19 | + > This step should be run **only once**, as it creates and saves the |
| 20 | +database locally. |
| 21 | +3. **Query & Generation** β Retrieves relevant context for a given question and |
| 22 | +uses a model to generate an answer. |
| 23 | +4. **Evaluation** β Tests the modelβs responses using predefined data from the |
| 24 | +JSON file. |
| 25 | + |
| 26 | +--- |
| 27 | + |
| 28 | +## Folder Structure |
| 29 | + |
| 30 | +```text |
| 31 | + Rag + Distilled Model/ |
| 32 | +βββ Apollo11_rag&distilled.ipynb β Main Jupyter Notebook |
| 33 | +βββ README.md β Project documentation |
| 34 | +βββ data/ |
| 35 | + βββ apollo11_docs.json β Apollo 11 text dataset and evaluation prompts |
| 36 | + βββ chroma_db/ β Auto-created vector database folder |
| 37 | + (It will appear after you run it) |
| 38 | +``` |
| 39 | + |
| 40 | +--- |
| 41 | + |
| 42 | +## Models Used |
| 43 | + |
| 44 | +* **LaMini-Flan-T5-248M**: It is a Local LLM and it is a distilled version of |
| 45 | +Google's Flan-T5, optimized for lightweight text generation tasks. |
| 46 | +Used here for reasoning, summarization, and RAG response generation. |
| 47 | +* **all-MiniLM-L6-v2**: It as an Embedding model and it is a compact sentence-transformer |
| 48 | +model used to convert text chunks into numerical vector embeddings for |
| 49 | +semantic search and retrieval. |
| 50 | + |
| 51 | +These two models make the project lightweight, fully local, and suitable for GPU |
| 52 | +or CPU execution. |
| 53 | + |
| 54 | +--- |
| 55 | + |
| 56 | +## Notes |
| 57 | + |
| 58 | +* The ChromaDB folder (data/chroma_db/) is automatically generated when you first |
| 59 | +run the document loader. |
| 60 | +* You can safely delete it to rebuild embeddings later. |
| 61 | +* The notebook does not require an external .txt file β all content is inside |
| 62 | +the JSON. |
| 63 | +* The model automatically detects whether to use GPU (torch.cuda.is_available()). |
0 commit comments