Repository navigation
Knowledge: import an existing knowledge base and connect any MCP search tool - #531
Merged
Merged
Conversation
…ch tool, with per-person access - Connect a search tool through MCP in place: a Connected apps server's search tool (and fetch for results without text) is searched live and its ranked list joins the rank fusion; one test search on save, failures in plain words. A server that signs each person in is searched with the asker's own sign-in. - Import from an S3 bucket (Bedrock metadata sidecars read), from a Bedrock knowledge base (its S3 data sources become S3 imports) and from an export archive (Notion, Confluence HTML, a zipped docs folder). Imports are sources: progress, re-sync, deletes and re-embedding only what changed. - Buckets are read only with the team's CoderHelmLogReader role, on the buckets named in its new ImportBuckets parameter; the install's own role gets no bucket reads. The boundary already allows what is used, so no admin step. - Bases can be limited to named people and roles; agent runs search only what their person may read; the page says what attaching means. - Imports keep up to 2,500 documents per source; indexes load 16 at a time into a byte-budgeted least recently used cache.
…he existing modules, routes, passes and role templates
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
Everything that remained of knowledge base import and connect, in one change:
searchtool, results without text are read with itsfetchtool, and the ranked list joins the same rank fusion. One test search on save, failures in plain words..metadata.jsonsidecars), from a Bedrock knowledge base (its S3 data sources become S3 imports), and from an export archive (Notion Markdown and CSV, Confluence HTML, a zipped docs folder). Imports are sources, so progress, re-sync, removing what was deleted and re-embedding only what changed work as they do for synced apps.Changes
common::knowledgeProvider::Mcp,Access::Connection,Remote.per_person,search_tool,fetch_tool,name;SourceKind::McpSearch; search labels each connected hit by its provider.remote_mcp.rs: picking the search and fetch tools (never a destructive one), arguments from each tool's schema, reading answers in the usual shapes (OpenAI'sresults, BedrockretrievalResults, Pineconesnippets, Glean snippets, prose), the check on save, and theMcpSearchretriever.remote::Connectedanswers each base with its own retriever.Base.readers,Person,open_to,searchable_in_run,agent_access_note.search.rs:IndexCache(160 MB, least recently used out), indexes read in groups of 16.common::knowledge::sourcesKind::S3andKind::Archivewithmax_items(2,500 for imports).s3.rs: browse by folder, list by page with ETags (and the sidecar's) as version markers, fetch with sidecar title, link and date, plain S3 errors.archive.rs: entries by CRC-32 and size, export names read as titles, bounded entry reads, zip bombs refused.bedrock_import.rs:GetKnowledgeBase,ListDataSources,GetDataSourceinto an import plan.connect.rs: S3 opens with the team'sCoderHelmLogReaderrole in the bucket's account (never the install's own role); archives read from the team's folder.log_reader.rsand both log reader templates:ImportBucketsparameter withReadImportBuckets,ReadImportObjectsandDecryptImportsThroughS3(through S3 only);ReadKnowledgeBasesgains the three settings reads;Chosencarries knowledge bases and buckets into the one-click update link and stack name.GET /api/knowledge/search-tools,GET /api/knowledge/bedrock/import,POST /api/knowledge/:kb_id/archivesand.../archives/:source_id/uploaded; MCP connect and check;readerson bases; S3 sources checked on save with the grant link when the role only lacks the bucket; brain chat filters by named readers and searches as the asker; AWS accounts carry their import buckets.ReadsImportBucketsfalse), checked insynth.test.ts. The permissions boundary already allowss3:*,kms:*,bedrock:Get*andbedrock:List*, so the boundary, the access stack and the deploy role are unchanged and nothing waits on an admin step.docs/self-host/knowledge-sources.md.Verification
cargo fmt --check,cargo clippy --workspace --tests -- -D warnings: clean.cargo test --workspace: 3,840 passed, 20 ignored (common 1,611; gateway 767; worker 1,411; the rest).infra:npm test156 of 156;cfn-lint infra/cfn/*.yamlclean;node --test selfhost/launch/*.test.mjspasses.