Skip to content

This project demonstrates a simple implementation of a Retrieval-Augmented Generation (RAG) system using Python. It includes cosine similarity calculations to find the most relevant document from a corpus based on a user query and integrates with a local LLM (e.g., LLAMA2) for generating responses

Notifications You must be signed in to change notification settings

Unitedstuff/Intro_to_Rag

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Intro_to_Rag

Retrieval-Augmented Generation (RAG) from Scratch

This project demonstrates a simple implementation of a Retrieval-Augmented Generation (RAG) system using Python. It includes cosine similarity calculations to find the most relevant document from a corpus based on a user query and integrates with a local LLM (e.g., LLAMA2) for generating responses.


Table of Contents


Overview

This project implements a basic RAG pipeline:

  1. A corpus of documents is stored.
  2. A user query is compared with the corpus using cosine similarity.
  3. The most relevant document is retrieved.
  4. The retrieved document and user query are passed to a local LLM for generating a response.

Features

  • Cosine Similarity: Calculates the similarity between the user query and documents in the corpus.
  • Document Retrieval: Identifies the most relevant document from the corpus.
  • LLM Integration: Uses a local LLM (e.g., LLAMA2) to generate responses based on the retrieved document.
  • Customizable Corpus: Easily update the corpus with new documents.

Installation

  1. Clone the repository:
    git clone https://github.com/your-username/rag-from-scratch.git
    cd rag-from-scratch

About

This project demonstrates a simple implementation of a Retrieval-Augmented Generation (RAG) system using Python. It includes cosine similarity calculations to find the most relevant document from a corpus based on a user query and integrates with a local LLM (e.g., LLAMA2) for generating responses

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published