Skip to content

Full-stack RAG system for document Q&A with citations, powered by Gemini 2.5 Flash and evaluated with Ragas. Built with LangChain, FastAPI.

Notifications You must be signed in to change notification settings

Sanjay-n-k/RAG-Pipeline

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

RAG-Pipeline

Full-stack RAG system for document Q&A with citations, powered by Gemini 2.5 Flash and evaluated with Ragas. Built with LangChain, FastAPI.

Overview

This project implements a complete Retrieval-Augmented Generation (RAG) pipeline that allows users to:

  • Upload PDF documents and create a knowledge base
  • Query documents using natural language questions
  • Get AI-powered answers with citations powered by Google's Gemini 2.5 Flash
  • Use both command-line interface and web-based Streamlit interface

πŸ—οΈ Architecture

The system follows a modular architecture with the following components:

  • Document Ingestion: PDF loading and text chunking using LangChain
  • Vector Store: ChromaDB for storing document embeddings
  • Retrieval: Semantic search using HuggingFace embeddings
  • Generation: Google Gemini 2.5 Flash for answer generation
  • Interface: Streamlit web application for user interaction

πŸ“ Project Structure

RAG-Pipeline/
β”œβ”€β”€ app/
β”‚   └── streamlit_app.py       # Streamlit web interface
β”œβ”€β”€ core/
β”‚   β”œβ”€β”€ ingestion.py           # Document loading and splitting
β”‚   β”œβ”€β”€ vectorstore.py         # ChromaDB operations
β”‚   └── rag_chain.py          # RAG pipeline setup
β”œβ”€β”€ data/                      # Document storage (gitignored)
β”œβ”€β”€ main.py                    # Command-line interface
β”œβ”€β”€ requirements.txt           # Python dependencies
β”œβ”€β”€ .gitignore                # Git ignore rules
└── README.md                 # Project documentation

πŸš€ Features

  • PDF Document Processing: Upload and process PDF documents
  • Intelligent Text Chunking: Recursive character text splitting for optimal retrieval
  • Semantic Search: Vector-based similarity search using HuggingFace embeddings
  • Citation Support: AI responses include numbered citations referencing source documents
  • Persistent Vector Store: ChromaDB for storing and retrieving document embeddings
  • Web Interface: User-friendly Streamlit application
  • Modular Design: Clean separation of concerns for easy maintenance and extension

πŸ› οΈ Major Tools Used

  • LangChain: RAG pipeline framework and document processing
  • Google Gemini 2.5 Flash: Large language model for answer generation
  • ChromaDB: Vector database for document embeddings storage
  • Streamlit: Web application framework for user interface
  • HuggingFace Transformers: Text embedding models (all-MiniLM-L6-v2)
  • PyPDF: PDF document processing and text extraction

About

Full-stack RAG system for document Q&A with citations, powered by Gemini 2.5 Flash and evaluated with Ragas. Built with LangChain, FastAPI.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published