Skip to content

savish28/ai-rag-chatbot

Repository files navigation

RAG AI assistant

This project provides an full stack application with a UI chatbot and RAG pipeline using google drive data to give contextual answers.

Screen.Recording.2025-06-29.at.3.mp4

Table of Contents

Prerequisites

  • Docker Engine & Docker Compose: These will be installed via your Linux distribution's package manager.

🔧 Tech Stack Used

Layer Technology Why
Frontend React (with Tailwind UI) Responsive, easy integration with chatbot UI
Backend FastAPI (Python) Lightweight, async, perfect for ML workloads
Embedding Model Google's models/embedding-001 Efficient and high-quality embeddings
LLM for RAG Gemini via LangChain Versatile, works well with RAG pipelines
Vector Store FAISS Fast similarity search for embeddings
File Parsing unstructured, PyMuPDF, docx, pdfplumber Handles various file formats
Google Drive Integration Google Drive API + Google Auth Authenticated, scoped access to user files
Orchestration LangChain Makes RAG pipeline setup easier
Deployment Docker + Azure Scalable, production-grade setup

Project Structure

.
├── backend/
│   ├── main.py
│   ├── requirements.txt
│   ├── credentials.json      # Google Service Account JSON (user added)
│   └── .env                  # GOOGLE_API_KEY (user added)
│   └── ...
├── ai-assistant-ui/
│   ├── package.json
│   ├── src/
│   ├── public/
│   ├── nginx.conf            # Nginx config for UI
│   └── ...
├── Dockerfile.backend        # Backend Dockerfile
├── Dockerfile.ai-assistant-ui  # UI Dockerfile
└── docker-compose.yml        # Docker Compose config

Backend Setup (Credentials & Environment Variables)

For security, credentials.json and .env are not committed to version control.

  1. credentials.json:
    • Obtain: From Google Cloud Console > IAM & Admin > Service Accounts > Create new key (JSON).
    • Place: backend/credentials.json
  2. .env file:
    • Create: backend/.env
    • Content: GOOGLE_API_KEY=YOUR_GOOGLE_API_KEY_HERE (Obtain from Google AI Studio).

How to Install Docker

Install Docker Engine and Docker Compose for your Linux distribution.

  • For Debian/Ubuntu:
    sudo apt-get update
    sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
    sudo usermod -aG docker $USER # Add user to docker group
    # Log out and log back in for changes to take effect

  • For other Linux distributions: Refer to the official Docker documentation:

Verify installation and user permissions:

docker --version
docker compose version
docker run hello-world # Should run without permission errors

Running the Application with Docker Compose

  1. Navigate: Go to the project root where docker-compose.yml is located.
    cd /path/to/your/project/root

  2. Build & Run:
    docker compose up --build

    This builds images and starts both services. Logs will appear in the terminal.

  3. Access:

  4. Stop:

    • Stop containers: docker compose stop
    • Stop & remove: docker compose down
    • Stop, remove containers & images: docker compose down --rmi all

Troubleshooting

  • Container issues: Check logs with docker compose logs <service_name>.

  • Permissions (Docker Daemon): If you get "permission denied", ensure your user is in the docker group and you've logged out/in.
    sudo usermod -aG docker $USER
    # Log out and back in

  • AI Assistant UI: Verify npm run build completed, check browser console.

  • Backend: Check main.py entry point, GOOGLE_API_KEY in .env.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published