https://github.com/maheshsunuwar/rag_qa_system
Retrieval-Augmented Generation (RAG) QA System — An interactive system that retrieves relevant documents from a vector database and generates accurate answers using LLMs. Built with Streamlit, FAISS, and LangChain.
https://github.com/maheshsunuwar/rag_qa_system
faiss langchain llm mlops ollama openai question-answering rag retrieval-augmented-generation streamlit
Last synced: 4 months ago
JSON representation
Retrieval-Augmented Generation (RAG) QA System — An interactive system that retrieves relevant documents from a vector database and generates accurate answers using LLMs. Built with Streamlit, FAISS, and LangChain.
- Host: GitHub
- URL: https://github.com/maheshsunuwar/rag_qa_system
- Owner: maheshsunuwar
- License: mit
- Created: 2025-04-28T10:54:24.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2025-05-26T00:16:31.000Z (about 1 year ago)
- Last Synced: 2025-05-26T00:29:22.089Z (about 1 year ago)
- Topics: faiss, langchain, llm, mlops, ollama, openai, question-answering, rag, retrieval-augmented-generation, streamlit
- Language: Python
- Homepage: https://pdfchat.machinelearningdev.com
- Size: 340 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Retrieval-Augmented Generation (RAG) QA System
Welcome to my project! This is a lightweight Retrieval-Augmented Generation (RAG) system where users can ask questions, and the system retrieves the most relevant documents and generates accurate answers using a language model (LLM).
## Features
- Build a vector database (FAISS) from document corpus
- Retrieve top-k relevant contexts based on semantic similarity
- Answer user questions grounded on retrieved documents
- Streamlit Frontend for interactive querying
- Embedding and Inference from Ollama models
- Modular design for easy extensions and improvements
## Technologies Used
- Python 3.10+
- Streamlit
- FAISS
- LangChain
- Ollama/openai
## Project Structure
```
rag_qa_system/
├── README.md
├── data/
│ └── docs/
│ └── sample_docs.txt
├── app/
│ ├── main.py
│ ├── rag/
│ │ ├── vector_store.py
│ │ ├── retriever.py
│ │ └── qa_pipeline.py
│ └── config.py
├── requirements.txt
└── scripts/
└── initialize_embeddings.py
```
## Getting Started
### Clone the repository:
```
git clone https://github.com/yourusername/rag_qa_system.git
cd rag_qa_system
```
### Install dependencies:
```
pip install -r requirements.txt
```
### Set your OpenAI API key:
#### Create a .env file:
```
If you use openai instead of ollama
```
### Launch the app:
```
streamlit run app/main.py
```
## How It Works
- Ingest Documents → Split into smaller chunks
- Embed Documents → Using Ollama Embeddings
- Store Embeddings → In FAISS vector database
- Retrieve Relevant Chunks → Based on user question
- Generate Answer → Using llama3.2 based on retrieved context
## Future Enhancements
- Upload and ingest PDFs and Docs
- Fine-tune retrieval for domain-specific datasets
- Add evaluation metrics (e.g., retrieval precision, latency)
- Deploy live on HuggingFace Spaces/AWS/Azure/GCP/self deploy