AI-powered chatbot and semantic search for WordPress using RAG (Retrieval-Augmented Generation).
- π€ AI-powered chatbot with conversation history
- π Semantic search using vector embeddings
- π Built on OpenAI and Pinecone
- π¨ Customizable UI components
- βΏ WCAG 2.1 Level AA accessible
- π§ Easy configuration via WordPress admin
- PHP 8.0+
- Node.js 18+
- WordPress 6.0+
- Composer (for Composer installation)
- OpenAI API key
- Pinecone API key
# Install plugin
composer require kanopi/semantic-knowledge
# Activate plugin
wp plugin activate semantic-knowledge
# Indexer installs automatically during composer install! β
Why this works:
- Plugin's
composer.jsonhaspost-install-cmdhook - Automatically installs indexer into
indexer/node_modules/ - No manual steps required
- Download from WordPress.org (pending approval)
- Upload to
/wp-content/plugins/or install via WordPress admin - Activate the plugin
- Install indexer:
Or click "Install Indexer" button in WordPress admin
wp semantic-knowledge install-indexer
# Clone repository
cd wp-content/plugins
git clone https://github.com/kanopi/semantic-knowledge.git
cd semantic-knowledge
# Install PHP dependencies
composer install
# Install Node.js indexer
cd indexer
npm installAdd to wp-config.php:
define('OPENAI_API_KEY', 'sk-...');
define('PINECONE_API_KEY', 'pcsk_...');Or set via WP-CLI:
wp config set OPENAI_API_KEY "sk-..." --type=constant
wp config set PINECONE_API_KEY "pcsk_..." --type=constant- Go to Settings β AI Assistant in WordPress admin
- Configure:
- Pinecone Index Host (e.g.,
your-index-123.pinecone.io) - Pinecone Index Name (e.g.,
wp-content) - Post Types to index
- Chunk Size (default: 1000 characters)
- Embedding Model (default: text-embedding-3-small)
- Pinecone Index Host (e.g.,
# Index all content
wp sk-indexer index
# Check system requirements
wp sk-indexer check
# View configuration
wp sk-indexer configAdd to any page or post using shortcode:
[wp_ai_chatbot]
Or via block editor: Add the AI Chatbot block
Replace default WordPress search:
// In your theme's functions.php
add_filter('wp_ai_assistant_enable_search', '__return_true');Or use the search widget in Appearance β Widgets
# PHP tests
composer test
# Node.js indexer tests
cd indexer/node_modules/@kanopi/wp-ai-indexer
npm test# PHP linting
composer phpcs
# JavaScript linting
npm run lintProblem: Plugin shows "Indexer not installed" notice
Solution:
# Check Node.js
node --version # Should be 18+
# Install indexer
wp semantic-knowledge install-indexer
# Or manually
cd wp-content/plugins/semantic-knowledge/indexer
npm installProblem: 401 Unauthorized errors when indexing
Solution:
- Verify API keys are set correctly
- Check Pinecone index exists and is active
- Ensure OpenAI API key has sufficient credits
Problem: Search returns no results
Solution:
# Re-index content
wp sk-indexer delete-all
wp sk-indexer index
# Check index status
wp sk-indexer configBuilt on a modular architecture:
- WP_AI_Core: Settings and configuration management
- WP_AI_OpenAI: OpenAI API integration
- WP_AI_Pinecone: Pinecone vector database integration
- WP_AI_Chatbot_Module: Chatbot functionality
- WP_AI_Search_Module: Search functionality
- @kanopi/wp-ai-indexer: Node.js indexing package (separate npm package)
See CONTRIBUTING.md
MIT License - see LICENSE