ajinkya45/SIMPLE-RAG-PDF
๐ง RAG-based PDF QA App
This is a simple Retrieval-Augmented Generation (RAG) application that allows you to upload a PDF, retrieve the most relevant content using semantic similarity, and generate answers using a lightweight LLM. It's built using Sentence Transformers, Qdrant vector store, and a Streamlit UI.
๐ What is RAG?
Retrieval-Augmented Generation (RAG) is an architecture that combines information retrieval and natural language generation. Instead of generating answers purely from a model's training data, RAG retrieves relevant documents from a knowledge base and feeds them into the language model to ground the answer in actual facts.
๐งฉ What is an Embedding?
An embedding is a numerical representation of data (like text) in a high-dimensional vector space. Similar meanings result in similar vectors. This is crucial for finding semantically relevant documents using distance-based search.
๐๏ธ What is a Vector Store / Vector Database?
A vector database stores these high-dimensional embeddings and allows for efficient similarity searches using methods like cosine similarity or Euclidean distance. It's the backbone of retrieval in RAG systems.
๐ ๏ธ What We Used
๐ผ๏ธ Example Result
Here is an example of how the result looks after querying the PDF:
๐ How to Run Locally
1. Clone the repository
git clone https://huggingface.co/spaces/ajinkya45/SIMPLE-RAG-PDF
cd SIMPLE-RAG-PDF2. Create and activate a virtual environment
python -m venv rag_env
source rag_env/bin/activate # On Windows use: rag_env\Scripts\activate3. Install required dependencies
pip install -r requirements.txt4. Start the Streamlit app
streamlit run app.py