[Mate] Add Knowledge bridge to crawl official documentation#2069
Draft
wachterjohannes wants to merge 1 commit into
Draft
[Mate] Add Knowledge bridge to crawl official documentation#2069wachterjohannes wants to merge 1 commit into
wachterjohannes wants to merge 1 commit into
Conversation
Introduces a new Mate bridge (`symfony/ai-knowledge-mate-extension`) that exposes pluggable documentation providers as MCP tools so agents can crawl official docs structurally instead of guessing from training data. Tools shipped: * `knowledge-toc` — without args lists registered providers; with a provider browses its TOC at the given path * `knowledge-read` — reads a documentation page split into RST sections * `knowledge-search` — case-insensitive substring search across a provider's chunks Providers implement `DocsProviderInterface` and register as services tagged `ai_mate.knowledge_provider`. The first call clones the source repository (via `git clone --depth 1`) into the local Mate cache; the cache is auto-refreshed once it is older than `ai_mate_knowledge.cache_ttl_seconds` (default 24h). Section-based chunking reuses `Symfony\AI\Store\Document\Loader\RstLoader` so chunking semantics stay aligned with the Store component. The Symfony bridge ships a built-in `SymfonyDocsProvider` for https://github.com/symfony/symfony-docs that registers itself when the Knowledge bridge is also installed (guarded via `interface_exists()`).
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
Introduces a new Mate bridge —
symfony/ai-knowledge-mate-extension— that exposes pluggable documentation providers as MCP tools so agents can crawl official docs structurally instead of guessing from training data.The Symfony bridge ships a built-in
SymfonyDocsProviderfor symfony/symfony-docs that registers itself when the Knowledge bridge is also installed (interface_exists()guard).Tools
knowledge-tocprovider: browse its TOC atpath(or root).knowledge-readknowledge-searchBehavior
git clone --depth 1) into the local cache.ai_mate_knowledge.cache_ttl_seconds(default 24h).Symfony\AI\Store\Document\Loader\RstLoaderso chunking semantics stay aligned with the Store component.Adding a custom provider
Tag the service
ai_mate.knowledge_provider.Future-proofing
The chunk model (
PageChunk) already matches whatSymfony\AI\Store\Document\Vectorizerconsumes, so a future vector-search bridge would only need to extract a smallSearcherInterfacefromKeywordSearcherand anIndexerInterfacefrom the JSON cache step. Not done now to keep the scope focused (YAGNI).Test plan
bin/mate mcp:tools:call knowledge-toc '{}'then'{"provider":"symfony"}'