AI-powered, conversational search for WordPress. This repository contains the plugin source code, tests, and developer resources. For end-user guides and full documentation, see the links below.
- Comprehensive unit test suite with 105 tests covering core functionality
- Support for multiple AI providers (OpenAI, Google, Anthropic)
- Advanced Japanese tokenization with TinySegmenter and optional Yahoo! MA API
- Real-time post synchronization hooks
- Cohere reranker integration for improved search relevance
- Extensive filter hooks for customization
FE Search AI replaces standard WordPress search with a conversational AI chat using RAG (Retrieval-Augmented Generation). It indexes your content into vector embeddings and keyword indexes, providing accurate answers based only on your website's content.
This plugin is designed to be highly extensible and performant, running on standard MySQL databases without requiring external vector databases.
- User Documentation: https://firstelementjp.github.io/fe-search-ai/
- Installation Guide: https://firstelementjp.github.io/fe-search-ai/#/installation
- Configuration: https://firstelementjp.github.io/fe-search-ai/#/configuration
- Hooks Reference: https://firstelementjp.github.io/fe-search-ai/#/hooks
- Releases: https://github.com/firstelementjp/fe-search-ai/releases
- Issues: https://github.com/firstelementjp/fe-search-ai/issues
- WordPress 6.6 or higher
- PHP 7.4 or higher (PHP 8.0+ required for built-in Japanese tokenizer)
- MySQL 5.7 or higher
- OpenSSL extension
- Download the latest release ZIP from the Releases page
- Go to Plugins β Add New β Upload Plugin
- Select the ZIP file and upload it
- Activate the plugin
- Download the latest release ZIP from the Releases page
- Extract the ZIP file
- Upload the
fe-search-ai/directory to/wp-content/plugins/ - Activate the plugin from the WordPress admin screen
Important
Use the release ZIP file for installation, not Source code (zip).
git clone https://github.com/firstelementjp/fe-search-ai.git
cd fe-search-ai
composer install
npm installAfter installing dependencies, place the plugin in your local WordPress environment and activate it from the admin dashboard.
PHPUnit for FE Search AI is designed to run in a local WordPress environment.
- Copy
wp-tests-config.php.exampletowp-tests-config.php - If you use
direnv, copy or create a.envrcfile forfe-search-ai - Set
DB_HOST,DB_NAME,DB_USER,DB_PASSWORD, andMYSQL_UNIX_PORTfor your Local site - Approve the environment with
direnv allow - Run
composer install
Example setup command:
cp wp-tests-config.php.example wp-tests-config.phpExample environment values:
export DB_HOST=localhost
export DB_NAME=local
export DB_USER=root
export DB_PASSWORD=root
export MYSQL_UNIX_PORT="/Users/your-name/Library/Application Support/Local/run/xxxxxxx/mysql/mysqld.sock"Verify the MySQL socket path from the Database tab in Local before running tests.
Run PHPUnit from the plugin root:
cd wp-content/plugins/fe-search-aiRun all tests:
composer testThe equivalent direct PHPUnit command is:
./vendor/bin/phpunitRun coverage:
composer run test-coverageCoverage reports are generated in:
tests/coverage/
If the test database connection fails in Local, confirm that MYSQL_UNIX_PORT is loaded in the current shell:
printenv | grep MYSQL_UNIX_PORTIf .envrc was updated, reload it before running PHPUnit:
direnv allow
direnv reload
composer test# PHP/Composer
composer test # Run test suite
composer phpcs # Check coding standards
composer phpcbf # Fix coding standards automatically
# Node.js/npm
npm run build # Build/minify frontend assets
npm run lint:js # Check JavaScript coding standards
npm run lint:js:fix # Fix JavaScript coding standards
npm run dev # Development build with source maps
npm run watch:all # Watch for changes and rebuild automaticallySee package.json for the complete list of available npm scripts.
The plugin includes built-in support for Japanese tokenization using TinySegmenter (lightweight, dictionary-free). For higher accuracy, you can optionally enable the Yahoo! Japanese Morphological Analysis API (MAService) by configuring an App ID in the settings.
fe_search_ai_chat_ui_html: Override the chat UI HTMLfe_search_ai_system_prompt: Modify the system prompt sent to AIfe_search_ai_tokenize_text: Implement custom tokenizersfe_search_ai_stop_words: Add/remove stop wordsfe_search_ai_retrieved_chunks: Modify retrieved context chunksfe_search_ai_rate_limit_settings: Adjust rate limit configuration
For detailed implementation notes, see the hooks documentation.
Contributions are welcome.
Basic workflow:
- Fork the repository
- Create a feature branch from develop
- Make changes and run tests
- Open a Pull Request against develop
Please check existing issues before opening a new feature request or bug report.
GPLv2+
See LICENSE for details.
This plugin incorporates the following third-party libraries:
- php-stemmer (MIT License)
- TinySegmenter (Modified BSD License)
- Source: https://github.com/u7aro/tinysegmenter-php
- Full license text: LICENSE-TinySegmenter.txt
- Web Services by Yahoo! JAPAN
- Pickr (MIT License)
- Author: Simon Wep
- Source: https://github.com/Simonwep/pickr
