Spaces:
Sleeping
Sleeping
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,19 +1,73 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
-
sdk:
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
- streamlit
|
| 10 |
pinned: false
|
| 11 |
-
|
| 12 |
---
|
| 13 |
|
| 14 |
-
#
|
| 15 |
|
| 16 |
-
|
| 17 |
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: RAG Chatbot
|
| 3 |
+
emoji: π€
|
| 4 |
+
colorFrom: blue
|
| 5 |
+
colorTo: purple
|
| 6 |
+
sdk: streamlit
|
| 7 |
+
sdk_version: 1.28.0
|
| 8 |
+
app_file: app.py
|
|
|
|
| 9 |
pinned: false
|
| 10 |
+
license: apache-2.0
|
| 11 |
---
|
| 12 |
|
| 13 |
+
# π€ RAG Chatbot
|
| 14 |
|
| 15 |
+
An intelligent chatbot powered by Retrieval Augmented Generation (RAG) that answers questions based on your custom knowledge base.
|
| 16 |
|
| 17 |
+
## β¨ Features
|
| 18 |
+
|
| 19 |
+
- π **Custom Knowledge Base**: Upload your own documents (.txt files)
|
| 20 |
+
- π **Smart Retrieval**: Uses FAISS for efficient similarity search
|
| 21 |
+
- π€ **Multiple LLM Options**: Choose from various open-source models
|
| 22 |
+
- π¬ **Chat Interface**: Interactive conversation with context
|
| 23 |
+
- π **Source Citations**: See which documents were used for answers
|
| 24 |
+
- π **100% Free**: Uses HuggingFace's free inference API
|
| 25 |
+
|
| 26 |
+
## π How to Use
|
| 27 |
+
|
| 28 |
+
1. **Get a HuggingFace Token** (free):
|
| 29 |
+
- Visit [HuggingFace Settings](https://huggingface.co/settings/tokens)
|
| 30 |
+
- Create a **Fine-grained** token
|
| 31 |
+
- β
Enable **'Make calls to Inference Providers'**
|
| 32 |
+
- Copy the token
|
| 33 |
+
|
| 34 |
+
2. **Enter Your Token**:
|
| 35 |
+
- Paste it in the sidebar
|
| 36 |
+
|
| 37 |
+
3. **Ask Questions**:
|
| 38 |
+
- The chatbot will answer based on the knowledge base documents
|
| 39 |
+
- View source documents for each answer
|
| 40 |
+
|
| 41 |
+
## π Knowledge Base
|
| 42 |
+
|
| 43 |
+
The knowledge base contains documents that the chatbot uses to answer questions. You can customize it by:
|
| 44 |
+
|
| 45 |
+
1. Adding .txt files to the `knowledge_base/` folder
|
| 46 |
+
2. Clicking "π Reload Knowledge Base" in the sidebar
|
| 47 |
+
|
| 48 |
+
## π οΈ Configuration Options
|
| 49 |
+
|
| 50 |
+
- **Embedding Model**: Choose how text is converted to vectors
|
| 51 |
+
- **LLM Model**: Select the language model for generating answers
|
| 52 |
+
- **Chunk Size**: Control how documents are split
|
| 53 |
+
- **Number of Results**: How many document chunks to retrieve
|
| 54 |
+
|
| 55 |
+
## π Privacy
|
| 56 |
+
|
| 57 |
+
- Your token is only used to call HuggingFace APIs
|
| 58 |
+
- Conversations are not stored
|
| 59 |
+
- Documents remain private to your session
|
| 60 |
+
|
| 61 |
+
## π Troubleshooting
|
| 62 |
+
|
| 63 |
+
**Model is loading**: Wait 20-30 seconds and try again
|
| 64 |
+
**Token error**: Make sure 'Make calls to Inference Providers' is enabled
|
| 65 |
+
**No documents found**: Add .txt files to the knowledge_base folder
|
| 66 |
+
|
| 67 |
+
## π License
|
| 68 |
+
|
| 69 |
+
Apache 2.0
|
| 70 |
+
|
| 71 |
+
---
|
| 72 |
+
|
| 73 |
+
Built with β€οΈ using Streamlit, LangChain, and HuggingFace
|