sofzcc commited on
Commit
10c7860
Β·
verified Β·
1 Parent(s): 456f6e2

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +127 -12
README.md CHANGED
@@ -1,12 +1,127 @@
1
- ---
2
- title: Full RAG Assistant
3
- emoji: πŸ’»
4
- colorFrom: purple
5
- colorTo: gray
6
- sdk: gradio
7
- sdk_version: 6.0.1
8
- app_file: app.py
9
- pinned: false
10
- ---
11
-
12
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ πŸ“š RAG AI Assistant β€” Document-Aware Chatbot Powered by Retrieval-Augmented Generation
2
+
3
+ Welcome to the RAG AI Assistant, a lightweight, open-source document question-answering system that lets you chat with your own knowledge base.
4
+
5
+ Upload documents β†’ Rebuild the index β†’ Ask questions β†’ Get grounded, explainable answers sourced from your files.
6
+
7
+ Built with:
8
+
9
+ FAISS for fast vector search
10
+
11
+ Sentence Transformers for embeddings
12
+
13
+ Transformers QA pipeline for extraction
14
+
15
+ Gradio Blocks UI for clean chat + KB management
16
+
17
+ πŸš€ Features
18
+ 🧠 Retrieval-Augmented Generation (RAG)
19
+
20
+ The assistant retrieves relevant document chunks and uses a QA model to produce accurate, grounded answers.
21
+
22
+ πŸ“‚ Knowledge Base Uploads
23
+
24
+ You can upload your own documents directly inside the Space:
25
+
26
+ Supported formats:
27
+
28
+ txt, md, pdf, docx, doc
29
+
30
+ βš™οΈ Rebuildable FAISS Index
31
+
32
+ After uploading files, click Rebuild index to update the vector store instantly β€” no need to restart the Space.
33
+
34
+ πŸ’¬ Interactive Chat
35
+
36
+ Ask free-form questions about your uploaded documents.
37
+
38
+ The model will:
39
+
40
+ Retrieve relevant context
41
+
42
+ Extract answers
43
+
44
+ Show confidence scores
45
+
46
+ Cite the source document
47
+
48
+ πŸ” Full Transparency
49
+
50
+ If no answer is found, you’ll receive helpful suggestions and context previews.
51
+
52
+ πŸ› οΈ How It Works
53
+ 1. Chunking
54
+
55
+ Documents are split into overlapping chunks:
56
+
57
+ Size: 500 characters
58
+
59
+ Overlap: 50 characters
60
+
61
+ 2. Embedding
62
+
63
+ Each chunk is embedded with:
64
+
65
+ sentence-transformers/all-MiniLM-L6-v2
66
+
67
+ 3. Vector Search
68
+
69
+ FAISS (IndexFlatIP) finds the closest matches using cosine similarity.
70
+
71
+ 4. Answer Extraction
72
+
73
+ A QA model extracts precise answers:
74
+
75
+ deepset/roberta-base-squad2
76
+
77
+ πŸ§ͺ Usage Instructions
78
+ 1. Upload Your Documents
79
+
80
+ Go to the Knowledge Base tab and upload as many files as you want.
81
+
82
+ 2. Rebuild the Index
83
+
84
+ Click Rebuild index to process the files and generate embeddings.
85
+
86
+ 3. Start Asking Questions
87
+
88
+ Switch to the Chat tab and ask questions like:
89
+
90
+ What is the main topic of the report?
91
+ Summarize the key findings.
92
+ What does section 3 say about metrics?
93
+
94
+ πŸ“ Project Structure
95
+ β”œβ”€β”€ app.py # Main application logic
96
+ β”œβ”€β”€ config.yaml # Optional configuration file
97
+ β”œβ”€β”€ knowledge_base/ # User-uploaded documents
98
+ β”œβ”€β”€ index/ # Saved FAISS index + metadata
99
+ └── README.md # This file
100
+
101
+ 🧩 Tech Stack
102
+
103
+ Python 3.10
104
+
105
+ Gradio
106
+
107
+ FAISS
108
+
109
+ Sentence Transformers
110
+
111
+ Transformers (HuggingFace)
112
+
113
+ PyPDF2 / python-docx
114
+
115
+ 🧱 Roadmap (Upcoming Enhancements)
116
+
117
+ πŸ”„ Streaming responses (LLM-style typing)
118
+
119
+ πŸ“Š Document preview inside the chat
120
+
121
+ πŸ“ Source highlighting of extracted spans
122
+
123
+ 🎨 Theming + cleaner chat UI
124
+
125
+ ⚑ Optional lightweight QA model for faster inference
126
+
127
+ Feel free to suggest improvements or contribute!