How mosh98/rag_with_models works
Main components
• Notebooks organized by functional areas:
• Advanced RAG: Contains demos that showcase more complex RAG pipelines (e.g., using GPT-4o and Self-Querying methods).
• Simple RAG: Demonstrates straightforward RAG implementations with various LLMs and integration with tools like Langchain or Ollama. Notice a “chroma_db” folder that incarnates the vector store used for retrieving embeddings.
• Embeddings: Dedicated notebooks for extracting embeddings from different LLMs (Falcon2, Gemma2, Llama3/3.1, Mistral, Phi-3, Qwen2).
• Fine-Tune: Demonstrates fine-tuning approaches on models and their embeddings.
• Experiments: Some data formatting and preprocessing steps.
• Evaluation: Contains notebooks that test and generate test sets for evaluating the RAG pipelines.
• Underlying external components:
• LLMs: The various large language models are central actors.
• Vector Database: With the “chroma_db” folder, it’s clear that a vector storage mechanism (like Chroma) is used to store embeddings.
• Possibly libraries or frameworks (implied in notebook names) such as Langchain or Ollama for creating and managing RAG pipelines.
Relationships and data flows
• Data Preparation & Experimentation: Notebooks in the “Experiments” folder process and format data, setting the stage for subsequent models.
• Embeddings Extraction: Notebooks under “Embeddings” process input data through various LLMs to generate vector representations.
• Fine-Tuning: The “Fine-Tune” notebooks modify LLM parameters and possibly the embeddings space to better adapt the models for specific tasks.
• RAG Pipelines: Both “Simple RAG” and “Advanced RAG” notebooks act as orchestrators that combine query inputs, embeddings extraction, and retrieval from the vector database. They then integrate the responses from the LLMs.
• Evaluation: The “evaluation” notebooks test and validate the performance of the RAG pipelines, indicating a feedback loop to iteratively improve the system.
Architectural patterns and design principles
• Modular design: Each functional area is separated into its own folder, suggesting that components are designed to work independently before integration.
• Pipeline flow: Indicate that the data flows from processing/formatting, through embeddings generation, to fine-tuning (if applicable), and then into the RAG pipeline – with evaluation as an external validation loop.
Technologies, frameworks, and key libraries
• LLM Models: LLama 3, Mistral, Phi-3, Qwen2 and others.
• RAG orchestration possibly via Langchain or similar orchestration frameworks (as hinted by names such as Lanchain and Ollama).
• Vector stores: Chroma is used to store and quickly retrieve embeddings.
• Notebooks (Jupyter) serve as the interface for each component’s demonstration.
Be very detailed
• Don’t oversimplify – break down the system into every logical component based on the directory structure.
• Explicitly mention the interactions between fine-tuning, embeddings, and retrieval components.