Skip to content

Sashwat23/RAG-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RAG Backend

This project is a backend system built using FastAPI that demonstrates a complete Retrieval-Augmented Generation (RAG) pipeline. It allows users to upload documents, ask questions based on those documents, and book interview slots using natural language.


Features

  • Upload PDF or TXT documents
  • Text extraction and chunking
  • Embedding generation
  • Vector storage and retrieval
  • Conversational question answering (RAG)
  • Multi-turn chat using Redis
  • Natural language interview booking

What this project does

  1. User uploads a CV (PDF/TXT)

  2. The system:

    • Extracts text
    • Splits it into chunks
    • Generates embeddings
    • Stores them in Qdrant
  3. User asks a question

  4. Relevant chunks are retrieved

  5. LLM generates an answer using context

The system also supports booking interviews like:

"My name is Sashwat, email sashwataryala@outlook.com, book interview tomorrow at 4pm"


Tech Stack

  • Python
  • FastAPI
  • Sentence Transformers (embeddings)
  • Qdrant (vector database)
  • Groq API (LLM)
  • SQLite (booking storage)
  • Redis (Docker container for chat memory)

Project Dependencies

All required libraries are listed in requirements.txt. These include:

  • fastapi
  • uvicorn
  • sentence-transformers
  • qdrant-client
  • redis
  • groq
  • sqlalchemy
  • pypdf

How to run locally

  1. Create virtual environment

python -m venv .venv.venv\Scripts\activate

  1. Install dependencies

pip install -r requirements.txt

  1. Run Redis using Docker

docker run -d -p 6379:6379 redis

  1. Start backend server

uvicorn app.main:app --reload

Open in browser:

http://127.0.0.1:8000/docs


API Endpoints

Document Ingestion POST /ingest Upload a PDF or TXT file.

Chat (RAG) POST /chat Ask questions based on the uploaded document.

Interview Booking POST /book Book interview using natural language.

Example input: My name is Sashwat, email sashwataryala@outlook.com, book interview tomorrow at 4pm


Example Use Case

User uploads CV, then asks:

What skills are mentioned in my CV?

System retrieves relevant chunks and generates an answer using LLM.


Why this project

This project demonstrates:

  • Custom RAG implementation
  • Vector search using Qdrant
  • Redis-based chat memory
  • Real-world backend API design
  • LLM-powered natural language booking system

Notes

  • Redis is containerized using Docker
  • Backend runs locally using FastAPI
  • Vector database is handled using Qdrant local storage

About

FastAPI-based RAG backend

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages