feat: local RAG knowledge base with 4 sources + auto-consult#182
Merged
pluginslab merged 2 commits intodevfrom Mar 22, 2026
Merged
feat: local RAG knowledge base with 4 sources + auto-consult#182pluginslab merged 2 commits intodevfrom
pluginslab merged 2 commits intodevfrom
Conversation
Expand the local RAG system from code-only indexing into a full knowledge base with four sources: site code, database schema, WordPress API signatures, and bundled reference docs. The ReAct agent automatically consults the knowledge base before reasoning. New PHP abilities: - schema-extract: SHOW TABLES + DESCRIBE with semantic context for core WP tables and sensitive column redaction - wp-api-extract: scans wp-includes/ for function signatures and docblocks, groups ~5 per chunk - docs-extract: reads curated markdown from docs/knowledge/, chunks by heading boundaries New knowledge base docs (docs/knowledge/): - database-schema, hooks-lifecycle, options-api, post-types, user-roles, rest-api, cron, queries, security, theme-development, plugin-development, performance, multisite Settings UI (Knowledge Base card): - Build/Rebuild Index button with progress bar - Status display: last built, chunk counts by source - Clear Index button - Indexing service extracted into knowledge-base.js Auto-consult (react-agent.js): - Before ReAct loop, initializes vector store from IndexedDB - Searches top-2 results matching user message - Injects as [Relevant knowledge base context] prefix (~1750 chars) - Best-effort: failures do not block the agent Code search broadened: - Label: "Search knowledge base" (was "Search site codebase") - Keywords: added database, schema, wordpress, documentation Bugfix: codebase-extract.php used undefined register_agentic_ability() - Fixed to wp_agentic_admin_register_ability() and added missing registration in class-abilities.php. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Auto-consult only injects RAG context when user enables the library icon toggle in the chat input (next to web search globe). Saves ~500 tokens on every message when knowledge base is not needed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
pluginslab
approved these changes
Mar 22, 2026
Owner
pluginslab
left a comment
There was a problem hiding this comment.
4-source knowledge base with auto-consult gated behind a library icon toggle (same pattern as web search globe). RAG context only injected when the user opts in — saves ~500 tokens per message otherwise. Settings UI with build/clear index. LGTM!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
codebase-extract.phpused undefinedregister_agentic_ability()— fixed and added missing registrationNew Files
includes/abilities/schema-extract.phpincludes/abilities/wp-api-extract.phpincludes/abilities/docs-extract.phpsrc/extensions/services/knowledge-base.jsdocs/knowledge/*.md(13 files)Modified Files
includes/class-abilities.phpincludes/abilities/codebase-extract.phpregister_agentic_ability()→wp_agentic_admin_register_ability()src/extensions/services/react-agent.jssrc/extensions/abilities/codebase-index.jssrc/extensions/abilities/code-search.jssrc/extensions/components/SettingsTab.jsxTest plan
wpAgenticLogLevel = 3, ask a question → verify[ReactAgent] Auto-consult: injected 2 RAG resultsappearsdb://schema chunksnpm test— 71/71 unit tests pass🤖 Generated with Claude Code