Skip to content

A Retrieval-Augmented Generation (RAG) chatbot using LangChain, Gemini 1.5 Flash, Ollama embeddings, and ChromaDB to answer questions from a CSV-based FAQ dataset.

Notifications You must be signed in to change notification settings

BhagyeshPatil2004/RAG-chatbot-Gemini-API-ollama

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

RAG-chatbot-Gemini-API-ollama

---------------------------

βœ… 1) Clone your repo

---------------------------

echo "πŸ“₯ Cloning repo..." git clone https://github.com/BhagyeshPatil2004/RAG-chatbot-Gemini-API-ollama.git cd RAG-chatbot-Gemini-API-ollama

---------------------------

βœ… 2) Create .env placeholder

---------------------------

echo "πŸ”‘ Creating .env..." echo 'GEMINI_API_KEY="YOUR_GEMINI_API_KEY"' > .env

---------------------------

βœ… 3) Create .gitignore

---------------------------

"πŸ—‚οΈ Creating .gitignore..." cat < .gitignore

Python

pycache/ *.pyc .venv/

Env

.env

VSCode

.vscode/

Chroma DB

chroma_db/ EOL

---------------------------

βœ… 4) Write README.md

---------------------------

"πŸ“ Writing README.md..." cat < README.md

RAG-chatbot-Gemini-API-ollama πŸ€–

This is a simple Retrieval-Augmented Generation (RAG) chatbot built using:

It uses the original codebasics FAQ dataset from this video.
Note: I did some changes in the code only β€” the dataset remains the same.


βš™οΈ Features

βœ… Loads CSV data of FAQs
βœ… Creates embeddings with Ollama (`mxbai-embed-large`)
βœ… Stores embeddings locally in ChromaDB
βœ… Uses Gemini API (or your local LLM) to generate answers
βœ… Runs a simple CLI chat loop


πŸ“š Dataset

  • `codebasics_faqs.csv` is sourced from the codebasics YouTube channel
  • No modifications to dataset β€” only code improved to fit this RAG structure.

πŸš€ How to Run

1️⃣ Clone the Repo

``` git clone https://github.com/BhagyeshPatil2004/RAG-chatbot-Gemini-API-ollama.git cd RAG-chatbot-Gemini-API-ollama ```

2️⃣ Setup Python Environment

``` python -m venv .venv

Windows

.venv\Scripts\activate

Linux/Mac

source .venv/bin/activate

pip install -r requirements.txt ```

3️⃣ Add your Gemini API key

Edit `.env` and replace with your real API key.

4️⃣ Make sure Ollama is running

``` ollama pull mxbai-embed-large ```

5️⃣ Run the chatbot

``` python "AI Agent 1/agent.py" ```


βœ… Notes

  • Ollama must be running for embeddings.

  • Gemini API generates answers.

  • Easily swap a bigger dataset for your major project.


πŸ‘¨β€πŸ’» Author

😎 Bhagyesh Patil
πŸ“Œ Repo: RAG-chatbot-Gemini-API-ollama


EOL

---------------------------

βœ… 5) Create requirements.txt

---------------------------

"πŸ“¦ Creating requirements.txt..."

langchain

langchain_community

langchain_ollama

langchain_chroma

ollama

python-dotenv

EOL

---------------------------

βœ… 6) Setup Python venv + install

---------------------------

"🐍 Creating Python venv..."

python -m venv .venv

"🐍 Activating venv & installing..."

Detect OS to activate venv properly

if [[ "$OSTYPE" == "msys" || "$OSTYPE" == "win32" ]]; then .venv\Scripts\activate && pip install -r requirements.txt

else source .venv/bin/activate && pip install -r requirements.txt

---------------------------

βœ… 7) Pull Ollama embedding model

---------------------------

"🧠 Pulling Ollama embedding model..." ollama pull mxbai-embed-large

---------------------------

βœ… Done!

---------------------------

"" "1️⃣ Add your real Gemini API key in .env"

"2️⃣ Make sure Ollama is running"

"3️⃣ Run your bot: python "AI Agent 1/agent.py""

""

"πŸ”₯ Happy!"

About

A Retrieval-Augmented Generation (RAG) chatbot using LangChain, Gemini 1.5 Flash, Ollama embeddings, and ChromaDB to answer questions from a CSV-based FAQ dataset.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages