From b0bd89c11e4cae6f3c84d4c502898a7318d9ccbc Mon Sep 17 00:00:00 2001 From: Abhiram Natarajan Date: Sat, 12 Apr 2025 20:43:07 -0700 Subject: [PATCH] More details in the README --- README.md | 16 +++++++++++++++- main.py | 2 +- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 931ce41b..fb0df69d 100644 --- a/README.md +++ b/README.md @@ -1 +1,15 @@ -# LocalAIAgentWithRAG \ No newline at end of file +# LocalAIAgentWithRAG +Find the video [here](https://www.youtube.com/watch?v=E4l91XKQSgw&ab_channel=TechWithTim) + +# Steps at a high level +1. Create virtual env - `python3 -m venv ./venv` +2. Activate venv - `source venv/bin/activate` on MacOS +3. Install [Ollama](https://ollama.com/) then get the following models: + * ollama pull llama3.2 + * ollama pull mxbai-embed-large + We need both a language model and an embedding model. +4. Look at main.py - This describes the Llama model and a prompt for it. The line `reviews = retriever.invoke(question)` makes a call to the vector DB in vector.py and gets a response. +5. Look at vector.py - This uses ChromaDB to perform vector searching. We load the `mxbai-embed-large` model to use with the dataframe created from the CSV provided. +6. Chroma DB is stored on disk as a file, we provide the path to this as `./chrome_langchain_db`. Every time a retrival request is made the top 5 matching reviews are returned based on a similarity sesarch metric. + + diff --git a/main.py b/main.py index 9a7d0ae3..e2de1c86 100644 --- a/main.py +++ b/main.py @@ -5,7 +5,7 @@ model = OllamaLLM(model="llama3.2") template = """ -You are an exeprt in answering questions about a pizza restaurant +You are an expert in answering questions about a pizza restaurant Here are some relevant reviews: {reviews}