This project implements a Retrieval-Augmented Generation (RAG) system that enhances generative AI models with information retrieval capabilities. It allows users to upload documents, query the system, and receive responses based on both stored knowledge and real-time retrieval.
- Text Embedder: Embeds the user query into a vector representation. --->Retriever: Takes the query embedding, compares it with the stored document embeddings, and retrieves relevant documents.
- Retriever: Relevant documents retrieved ---> Prompt Builder: Uses the retrieved documents and the original query to create a structured prompt for the language model.
- Prompt Builder: sends structured prompt to the llm ---> LLM: Uses the generated prompt to generate a response based on the context provided by the retrieved documents.
- File Upload: Users can upload documents to populate the knowledge base.
- Chat Assistant: A conversational interface powered by RAG.
- Prompt Management: Save and manage prompts for better interactions.
- Backend API Integration: Uses a backend to handle file processing and retrieval.
- User-Friendly Interface: Simple and intuitive UI built with HTML, CSS, and JavaScript.
- Frontend: HTML, CSS, JavaScript
- Backend: Python (Flask)
- Database: InMemory
- AI Model: Mistral Instruct 7b v0.3 via HuggingFace
- Vector Search: sentence-transformers/all-MiniLM-L6-v2
📁 project-root
├── 📂 templates # Contains index.html
├── 📄 app.py # core python code wrapped in flask.
├── 📄 requirements.txt # Dependencies
├── 📄 README.md # Project Documentation
- Clone the repository:
git clone https://github.com/HarshNevse/RAG_Agent.git cd rag-project - Create a virtual environment and activate it:
python -m venv env source env/bin/activate # For macOS/Linux env\Scripts\activate # For Windows
- Install dependencies:
pip install -r requirements.txt
- Set your HuggingFace API key:
set HF_API_KEY=hf_your_api_key_here - Run the backend server:
python app.py # Flask example
- Upload Files: Click on the upload section to add documents.
- Ask Questions: Type queries in the chat interface.
- Retrieve Information: The AI model will fetch and generate responses based on the documents.
- 12/03/2025: Added support for multiple file types (PDF, CSV, Markdown etc.)
- Multi-user authentication & access control
- Cloud storage support (AWS S3 / Firebase)
- Advanced document parsing with NLP techniques
- Support for multiple languages
Author: Harsh Nevse
GitHub: HarshNevse
Email: harshnevse29@gmail.com


