Skip to content

EternalBlue445/GenAI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GenAI

A simple Retrieval-Augmented Generation (RAG) API for asking questions about uploaded documents. Uses FastAPI, Google Gemini and Chroma vector database.

✨ Features

  • Upload multiple files (PDF, DOCX, TXT, JPG , PNG, CSV, DB)
  • Contexts are generated with overlap
  • Ask questions
  • Relevant context and question will be sent to the LLM(Gemini)
  • Get answers with exact source and context

❌ Cons

  • Once you reload the page , the messages are gone. No way to retrieve them back.
  • The Gemini free limit may cause a temporary intervention.

Installation

pip install -r requirements.txt

Quick Start/Run

For development(locally): fastapi dev main.py

How to use it?

  • Upload all the files at once at the very beginning.
  • Ask questions.

Enviroment Variables(Required)

GEMINI_API_KEY=your_gemini_api_key

This must be present in your environment variables.

API Documentation

1. ('/') -> returns index.html
2. ('/query') -> returns query.html
3. ('/api/query') -> makes a POST request to the backend with user's questions and 
                    gets the response in return

Sample Folders & Files

  1. 'files' directory contains the sample files.
  2. 'uploads' directory stores the uploaded documents.

Screenshots

Index page

Home

Query page

Query

About

GenAI: Upload docs, ask questions, get sourced answers. FastAPI + Gemini + Chroma.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •