# Fast RAGbot Version 2.0

AI-powered chatbot with multi-LLM support, multi-domain indexing, document upload, and conversation memory.

## Features

### Multi-LLM Support
- **Gemini** (Google AI)
- **OpenAI** (ChatGPT)
- **Claude** (Anthropic)
- Switch between models with radio button selection
- Each model has its own API key field

### Multi-Domain Indexing
- Index up to 3 different domains
- Per-domain controls: allowlist, denylist, max depth
- Index one domain at a time
- Respects robots.txt and sitemap

### Document Upload
- Bulk upload and index documents
- Supported formats: PDF, DOCX, PPTX, XLSX, TXT, XML, CSV
- Documents indexed with same RAG pipeline as web pages

### Conversation Features
- **Memory**: Keeps last 5 Q&A turns per session
- **Smart Follow-ups**: Suggests 3 questions when answer not found
- **Pre-chat Form**: Optional name/email collection

### Widget Customization
- Custom color scheme
- Position: bottom-right or bottom-left
- Custom logo support
- Theme CSS inheritance option
- Shortcode: `[ragbot_chat]`
- Inline embed: `[ragbot_chat inline="true"]`

### Chat Logs
- Records all conversations
- Includes session ID, user info, model used, citations
- CSV export functionality
- Admin table view

### RAG Configuration
- Adjustable chunk size (default: 1000 chars)
- Chunk overlap (default: 180 chars)
- Top K results (default: 5)
- Similarity threshold (default: 0.80)

## Installation

1. Upload plugin to `/wp-content/plugins/fast-ragbot/`
2. Activate through WordPress admin
3. Go to Settings > Fast RAGbot
4. Configure API keys in Models tab
5. Add content sources in Indexing tab
6. Customize widget in UI/UX tab

## Configuration

### Models Tab
1. Select active model (Gemini/OpenAI/Claude)
2. Enter API key for selected model
3. Click "Test Active Model" to verify

### Indexing Tab
1. Click "Add Source" (max 3)
2. Enter label and base URL
3. Click "Index" to crawl and index
4. Upload documents using "Upload Documents" button

### General Tab
- Enable/disable source URLs in answers
- Enable/disable pre-chat form
- Customize pre-chat form label

### UI/UX Tab
- Set widget color
- Choose position (bottom-right/left)
- Add custom logo URL
- Enable theme CSS inheritance
- Copy shortcode or embed snippet

## Usage

### Automatic Widget
Widget appears automatically on all pages when API key is configured.

### Shortcode
Add to any page/post:
```
[ragbot_chat]
```

### Inline Chat
Embed chat panel directly in content:
```
[ragbot_chat inline="true"]
```

## Requirements

- WordPress 6.0+
- PHP 7.4+
- MySQL 5.7+
- API key for at least one LLM provider

## Security

- Rate limiting: 10 requests per 60 seconds per IP
- Nonce verification on all AJAX requests
- Capability checks for admin functions
- Sanitized and escaped output
- No PII in error logs

## Support

For issues and feature requests, visit plugin support forum.

## License

GPL v2 or later
