kanopi/semantic-knowledge
Composer 安装命令:
composer require kanopi/semantic-knowledge
包简介
Semantic search and knowledge management for WordPress using RAG (Retrieval-Augmented Generation)
README 文档
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
Support
kanopi/semantic-knowledge 适用场景与选型建议
kanopi/semantic-knowledge 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 02 月 05 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 kanopi/semantic-knowledge 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 kanopi/semantic-knowledge 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 27
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-02-05