Wanda is a MediaWiki extension that provides an AI-powered chatbot interface for your wiki. It can answer questions about your wiki content using various LLM providers and includes both a dedicated special page and a floating chat widget.
- Multiple LLM Providers: Support for Ollama (self-hosted), OpenAI, Anthropic Claude, and Azure OpenAI
- Vector Search: Uses Elasticsearch with embeddings for semantic search
- Text Search Fallback: Falls back to text-based search when embeddings are unavailable
- Floating Chat Widget: Always-accessible chat button on all pages
- Special Page: Dedicated chat interface at Special:Wanda
- Responsive Design: Works on desktop and mobile devices
- Secure Configuration: API key management and timeout controls
- Clone or download this extension to your MediaWiki
extensions/directory - Add the following to your
LocalSettings.php:
wfLoadExtension( 'Wanda' );- Configure your preferred LLM provider (see Configuration section)
- Run MediaWiki update script:
php maintenance/update.phpAdd these configuration variables to your LocalSettings.php:
// Choose your LLM provider
$wgLLMProvider = 'ollama'; // Options: 'ollama', 'openai', 'anthropic', 'azure'
// Provider-specific settings
$wgLLMApiKey = 'your-api-key-here'; // Not needed for Ollama
$wgLLMModel = 'gemma:2b';
$wgLLMApiEndpoint = 'http://localhost:11434/api/';
// Elasticsearch configuration
$wgLLMElasticsearchUrl = 'http://elasticsearch:9200';Ollama (Self-hosted)
$wgLLMProvider = 'ollama';
$wgLLMApiEndpoint = 'http://localhost:11434/api/';
$wgLLMModel = 'gemma:2b';
$wgLLMEmbeddingModel = 'nomic-embed-text';OpenAI
$wgLLMProvider = 'openai';
$wgLLMApiKey = 'sk-your-openai-api-key';
$wgLLMModel = 'gpt-3.5-turbo';
$wgLLMEmbeddingModel = 'text-embedding-ada-002';Anthropic Claude
$wgLLMProvider = 'anthropic';
$wgLLMApiKey = 'sk-ant-your-anthropic-key';
$wgLLMModel = 'claude-3-haiku-20240307';For detailed configuration options, see LLM-CONFIG.md.
The floating chat widget appears on all pages (except Special:Wanda) as a blue chat button in the bottom-right corner. Click it to open the chat interface.
Visit Special:Wanda on your wiki to access the full-featured chat interface.
To enable the chatbot to answer questions about your wiki content, you need to index your pages in Elasticsearch with embeddings. Use the maintenance script:
php extensions/Wanda/maintenance/ReindexAllPages.php- MediaWiki 1.36.0 or later
- PHP 7.4 or later
- Elasticsearch (for content indexing and search)
- One of the supported LLM providers:
- Ollama (self-hosted)
- OpenAI API access
- Anthropic Claude API access
- Azure OpenAI service
- Content Indexing: Wiki pages are processed and stored in Elasticsearch with embeddings
- Query Processing: User queries are converted to embeddings (when available)
- Similarity Search: Elasticsearch finds the most relevant content
- Response Generation: The LLM generates responses based on the retrieved content
- Fallback Mechanism: Text-based search when embeddings are unavailable
- API keys are stored securely in MediaWiki configuration
- Content is processed by your chosen LLM provider
- For sensitive wikis, consider using self-hosted Ollama
- Configure appropriate timeouts and rate limits
Contributions are welcome! Please feel free to submit issues and pull requests.
This extension is licensed under the MIT License.