WikiInterrogator / README.md
OrganizingForChange's picture
Upload 8 files
eab4de1 verified
|
Raw History Blame Contribute Delete
2.41 kB
---
title: Chat with Wiki Documents
emoji: πŸ“š
colorFrom: blue
colorTo: purple
sdk: gradio
sdk_version: "5.49.1"
app_file: app.py
pinned: false
---
# Chat with Wiki Documents
A Gradio application that allows you to chat with documents from any online wiki using Retrieval Augmented Generation (RAG).
## Features
- πŸ”— Connect to any online wiki
- πŸ”‘ Secure API key input
- πŸ’¬ Interactive chat interface
- πŸ“š Automatic document fetching and processing
- πŸ” Semantic search across wiki content
- πŸ€– Powered by OpenAI's GPT models
## Setup
1. **Install dependencies:**
```bash
pip install -r requirements.txt
```
2. **Get an OpenAI API key:**
- Sign up at [OpenAI](https://platform.openai.com/)
- Create an API key from your dashboard
3. **Run the application:**
```bash
python app.py
```
4. **Open your browser:**
- The app will be available at `http://localhost:7860`
- Or use the public URL provided in the terminal
## Usage
1. **Enter Wiki URL:** Paste the URL of the wiki you want to chat with
2. **Enter API Key:** Paste your OpenAI API key
3. **Click "Initialize RAG":** This will fetch and process the wiki content
4. **Start Chatting:** Ask questions about the wiki content in the chat interface
## How It Works
1. **Document Fetching:** The app fetches content from the specified wiki URL and follows links to gather multiple pages
2. **Text Processing:** Documents are split into chunks for efficient processing
3. **Embedding:** Text chunks are converted to embeddings using OpenAI's embedding model
4. **Vector Store:** Embeddings are stored in a ChromaDB vector database
5. **Retrieval:** When you ask a question, relevant chunks are retrieved using semantic search
6. **Generation:** The retrieved context is used to generate an answer using GPT
## Notes
- The app fetches up to 10 wiki pages by default
- Vector database is stored locally in `./chroma_db`
- Your API key is only used for API calls and not stored permanently
- Make sure the wiki URL is publicly accessible
## Troubleshooting
- **"Error fetching wiki content":** Check that the wiki URL is correct and publicly accessible
- **"Error initializing RAG":** Verify your API key is valid and has credits
- **Slow initialization:** Large wikis may take time to process. Be patient!
## License
MIT