Skip to content

IamRavanan/mistral-basic-rag

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MISTRAL : RAG from scratch

This project guides you through building a basic Retrieval-Augmented Generation (RAG) system. It aims to help you understand RAG’s internal workings and provide the essential skills to create a RAG with minimal dependencies.

Table of Contents

Installation

Clone the repository

git clone https://github.com/IamRavanan/mistral-basic-rag.git

Navigate to the project directory

cd mistral-basic-rag

Create virtual environment

python -m venv .venv

Activate your virtual environment

Windows

.venv\Scripts\activate.bat\

MacOs

source .venv/bin/activate

Install dependencies

python -m pip install --upgrade pip && pip install -r requirements.txt

Usage

Invoke the script

python .\invoke.py "What were the two main things the author worked on before college?"

Example Output

PS D:\GitHub\mistral-rag> python .\invoke.py "What were the two main things the author worked on before college?"
 - Creating Mistral Client ...
 - Loading data ...
 - Transforming data into chunks ...
 - Converting chunks to vector embeddings ...
 - Loading Vector DB ...
 - Converting user prompt to embedding ...
 - Loading Vector DB ...
 - Converting user prompt to embedding ...
 - Converting user prompt to embedding ...
 - Retrieving matching chunks from vector DB ...
 - Formulating prompt ...
 - Augumenting response with Mistral's mistral-medium-latest model...
 - Printing response ...

 Response : The two main things the author worked on before college were writing and programming. They wrote short stories, which they described as having hardly any plot and mostly focusing on characters with strong feelings. In terms of programming, they tried writing programs on an IBM 1401 in 9th grade using an early version of Fortran. They typed programs on punch cards, which were then loaded into memory and run on the machine. However, they couldn't remember any specific programs they wrote as they didn't have any data stored on punched cards and didn't know enough math to do anything interesting without input. With the advent of microcomputers, they found that programming became much more accessible and interesting.

License

MIT License

Contact