Table of Contents
Retrieval-Augmented Generation (RAG) is a technique/process which enhances the capabilities of large language models (LLMs), which access knowledge base outside of its training data before response. It can generate more accurate, up-to-date relevant responses, all without the need to retrain the model and best part is, its time and cost-efficient.
RAG's efficient approach includes Indexing, Vectorization, Chunking etc.
Lets see an example by Building an AI chatbot in Python that lets you chat with uploaded simple pdf file
-
Download / Clone code from
https://github.com/eshwargirigowda/RAG_Chat_Application
and open in your IDE, I am using VSCode
-
Set virtual environment
For windows systems, open Terminal and run the cmd (command) as shown below
c:\>python -m venv venv
c:\>venv\Scripts\activate
-
create/Update file
.env
with your openai api key
OPENAI_API_KEY="your API Key"
-
Install all the requirement packages by running pip cmd
c:\>pip install -r .\requrements.txt
-
Make sure you have Docker Desktop installed and its running
-
Now run cmd as shown below
c:\>docker-compose up
Make sure file "docker-compose.yml" is at the prompt.
in above e.g. its c:\
c:\>streamlit run main.py
You can now view your Streamlit app in your browser.
Local URL: http://localhost:8501
Network URL: http://192.168.2.102:8501
Note:- IP and Port number will be displayed based on your system.