Spaces:
Sleeping
A newer version of the Gradio SDK is available:
6.5.1
title: Full RAG Assistant
emoji: π»
colorFrom: purple
colorTo: gray
sdk: gradio
sdk_version: 6.0.1
app_file: app.py
pinned: false
π RAG AI Assistant β Document-Aware Chatbot Powered by Retrieval-Augmented Generation
Welcome to the RAG AI Assistant, a lightweight, open-source document question-answering system that lets you chat with your own knowledge base.
Upload documents β Rebuild the index β Ask questions β Get grounded, explainable answers sourced from your files.
Built with:
FAISS for fast vector search
Sentence Transformers for embeddings
Transformers QA pipeline for extraction
Gradio Blocks UI for clean chat + KB management
π Features π§ Retrieval-Augmented Generation (RAG)
The assistant retrieves relevant document chunks and uses a QA model to produce accurate, grounded answers.
π Knowledge Base Uploads
You can upload your own documents directly inside the Space:
Supported formats:
txt, md, pdf, docx, doc
βοΈ Rebuildable FAISS Index
After uploading files, click Rebuild index to update the vector store instantly β no need to restart the Space.
π¬ Interactive Chat
Ask free-form questions about your uploaded documents.
The model will:
Retrieve relevant context
Extract answers
Show confidence scores
Cite the source document
π Full Transparency
If no answer is found, youβll receive helpful suggestions and context previews.
π οΈ How It Works
- Chunking
Documents are split into overlapping chunks:
Size: 500 characters
Overlap: 50 characters
- Embedding
Each chunk is embedded with:
sentence-transformers/all-MiniLM-L6-v2
- Vector Search
FAISS (IndexFlatIP) finds the closest matches using cosine similarity.
- Answer Extraction
A QA model extracts precise answers:
deepset/roberta-base-squad2
π§ͺ Usage Instructions
- Upload Your Documents
Go to the Knowledge Base tab and upload as many files as you want.
- Rebuild the Index
Click Rebuild index to process the files and generate embeddings.
- Start Asking Questions
Switch to the Chat tab and ask questions like:
What is the main topic of the report? Summarize the key findings. What does section 3 say about metrics?
π Project Structure βββ app.py # Main application logic βββ config.yaml # Optional configuration file βββ knowledge_base/ # User-uploaded documents βββ index/ # Saved FAISS index + metadata βββ README.md # This file
π§© Tech Stack
Python 3.10
Gradio
FAISS
Sentence Transformers
Transformers (HuggingFace)
PyPDF2 / python-docx
π§± Roadmap (Upcoming Enhancements)
π Streaming responses (LLM-style typing)
π Document preview inside the chat
π Source highlighting of extracted spans
π¨ Theming + cleaner chat UI
β‘ Optional lightweight QA model for faster inference
Feel free to suggest improvements or contribute!