Skip to content

Prasanth0520/Rag-Bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fiserv RAG Engine + Gemini AI

This repository contains a state-of-the-art Retrieval-Augmented Generation (RAG) chatbot interface designed around the Fiserv aesthetic, fully backed by Google's latest Gemini AI models in Python.

Quick Start (Local Office PC)

  1. Pull the Repository.
  2. Install Python Dependencies: Navigate into the repository and install the required AI / parsing libraries.
    pip install -r backend/requirements.txt
  3. Configure your API Key:
    • Create a file named .env in the root of the project (you can duplicate .env.example).
    • Add your Gemini API Key: GEMINI_API_KEY=AIzaSy...
    • (Alternatively, you can just click the Settings Icon in the UI when you run the app and paste the key directly there!).
  4. Run the Server: Start the FastAPI server.
    python backend/main.py
  5. Open the interface: Visit http://localhost:8000 in your web browser.

Technical Questions

1. Where are the uploaded files stored?

Nowhere. For maximum security and enterprise confidentiality, the Python backend (backend/main.py) never writes the uploaded files to disk.

  • It uses await file.read() to stream the file directly into your computer's temporary Random Access Memory (RAM).
  • It extracts the text (from PDF, Word, Excel, CSV) in real-time.
  • As soon as the AI generates its response, the file is automatically purged and destroyed from memory. No database, no local caching.

2. Pushing to Production

If you want to host this permanently (for example, internally in your office or on a cloud provider like AWS/Render/Heroku), you should not use uvicorn.run(...) directly.

Here is the standard production workflow:

  1. Host Provider: Use Render, Google Cloud Run, or an internal enterprise server.
  2. Gunicorn Server: In production, run the app using gunicorn with uvicorn workers to handle multiple concurrent chats. Command: gunicorn backend.main:app -k uvicorn.workers.UvicornWorker -w 4
  3. Set Environment Variables securely: In your production provider's dashboard, paste your GEMINI_API_KEY. DO NOT commit the .env file to Github! (It is currently hidden in .gitignore).

3. Using Higher / Custom Models

The Python backend currently routes all prompts to Google's highly efficient gemini-flash-latest model. If you want to use a massive context window or a more analytical model (like gemini-pro-latest or gemini-2.5-pro), simply open backend/main.py and change line 75:

# Change this:
model = genai.GenerativeModel('gemini-flash-latest')

# To this:
model = genai.GenerativeModel('gemini-pro-latest')

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors