Introduction-to-LLM-and-RAG

Lab: Setting Up a RAG (Retrieval-Augmented Generation) System for Technical Documentation

Objective
In this lab, you will build a Retrieval-Augmented Generation (RAG) pipeline to query technical documentation, such as this example. Sources may include:

The goal is to design a system that:

  1. Stores and indexes documents in a vector database.
  2. Enables users to ask questions and retrieve relevant passages.
  3. Generates precise answers using a generative AI model based on the retrieved passages.

General Guidelines

  1. Documentation Sources
    You may choose one or more of the following sources:
    • Online Python documentation.
    • PyTorch documentation available in the GitHub repository. Download it locally by cloning the repository:
      git clone https://github.com/pytorch/pytorch.git
      

      The documentation files are located in the docs/ directory.

  2. Lab Goal
    Build a pipeline that integrates:
    • Extraction: Collecting and preprocessing documentation files (e.g., converting .rst or .md files into plain text).
    • Indexing: Creating a vector database to search for relevant passages.
    • Retrieval and Generation: Using retrieved passages to generate precise answers with a generative AI model.
  3. Explore Freely
    You are encouraged to experiment with different tools, libraries, and techniques, such as re-ranking or using various vector databases.

Resources to Help You