kanopi / semantic-knowledge
Semantic search and knowledge management for WordPress using RAG (Retrieval-Augmented Generation)
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Type:wordpress-plugin
pkg:composer/kanopi/semantic-knowledge
Requires
- php: >=8.0
Requires (Dev)
- 10up/wp_mock: ^0.5
- brain/monkey: ^2.6
- dealerdirect/phpcodesniffer-composer-installer: ^1.0
- mockery/mockery: ^1.5
- phpcompatibility/phpcompatibility-wp: ^2.1
- phpunit/php-code-coverage: ^9.2
- phpunit/phpunit: ^9.5
- squizlabs/php_codesniffer: ^3.7
- wp-coding-standards/wpcs: ^3.0
This package is auto-updated.
Last update: 2026-02-05 16:31:58 UTC
README
AI-powered chatbot and semantic search for WordPress using RAG (Retrieval-Augmented Generation).
Features
- 🤖 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
Requirements
- PHP 8.0+
- Node.js 18+
- WordPress 6.0+
- Composer (for Composer installation)
- OpenAI API key
- Pinecone API key
Installation
Method 1: Composer (Recommended - Fully Automated)
# 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
Method 2: WordPress.org
- Download from WordPress.org (pending approval)
- Upload to
/wp-content/plugins/or install via WordPress admin - Activate the plugin
- Install indexer:
wp semantic-knowledge install-indexer
Or click "Install Indexer" button in WordPress admin
Method 3: Manual Installation
# 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 install
Configuration
1. API Keys
Add 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
2. Plugin Settings
- 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.,
3. Index Content
# Index all content wp sk-indexer index # Check system requirements wp sk-indexer check # View configuration wp sk-indexer config
Usage
Chatbot
Add to any page or post using shortcode:
[wp_ai_chatbot]
Or via block editor: Add the AI Chatbot block
Search
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
Development
Running Tests
# PHP tests composer test # Node.js indexer tests cd indexer/node_modules/@kanopi/wp-ai-indexer npm test
Code Quality
# PHP linting composer phpcs # JavaScript linting npm run lint
Troubleshooting
Indexer Not Found
Problem: 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 install
Authentication Errors
Problem: 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
No Search Results
Problem: Search returns no results
Solution:
# Re-index content wp sk-indexer delete-all wp sk-indexer index # Check index status wp sk-indexer config
Architecture
Built 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)
Documentation
Contributing
See CONTRIBUTING.md
License
MIT License - see LICENSE