Skip to content

Knowledge: import an existing knowledge base and connect any MCP search tool - #531

Merged
nambok merged 2 commits into
mainfrom
knowledge-import-connect
Nov 9, 2026
Merged

nambok merged 2 commits into
mainfrom
knowledge-import-connect

Conversation

@nambok

@nambok nambok commented Nov 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

Everything that remained of knowledge base import and connect, in one change:

  • Connect any search tool through MCP, live, beside Bedrock: a server on Connected apps (Azure AI Search or Foundry IQ, Pinecone Assistant, Glean, Rovo, Dropbox Dash, an AgentCore gateway, a team's own) is searched with its search tool, results without text are read with its fetch tool, and the ranked list joins the same rank fusion. One test search on save, failures in plain words.
  • Import an existing knowledge base: from an S3 bucket (with Bedrock .metadata.json sidecars), 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.
  • Per-person access: a base can be limited to named people and roles; a search tool that signs each person in is searched with the asker's own sign-in; agent runs search only what the person who started them may read, and the page says what attaching a base to agents means.
  • Scale: imports keep up to 2,500 documents per source; search reads indexes 16 at a time and keeps them in a byte-budgeted cache that lets the least recently used go, instead of clearing every 64.

Changes

  • common::knowledge
    • Provider::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's results, Bedrock retrievalResults, Pinecone snippets, Glean snippets, prose), the check on save, and the McpSearch retriever. remote::Connected answers 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::sources
    • Kind::S3 and Kind::Archive with max_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, GetDataSource into an import plan.
    • connect.rs: S3 opens with the team's CoderHelmLogReader role in the bucket's account (never the install's own role); archives read from the team's folder.
  • log_reader.rs and both log reader templates: ImportBuckets parameter with ReadImportBuckets, ReadImportObjects and DecryptImportsThroughS3 (through S3 only); ReadKnowledgeBases gains the three settings reads; Chosen carries knowledge bases and buckets into the one-click update link and stack name.
  • Gateway: GET /api/knowledge/search-tools, GET /api/knowledge/bedrock/import, POST /api/knowledge/:kb_id/archives and .../archives/:source_id/uploaded; MCP connect and check; readers on 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.
  • Worker: syncs open S3 and archive sources; agents get only the bases the run's person may read, and search per-person tools as them.
  • Infra: the install's own role gets no bucket reads (ReadsImportBuckets false), checked in synth.test.ts. The permissions boundary already allows s3:*, kms:*, bedrock:Get* and bedrock:List*, so the boundary, the access stack and the deploy role are unchanged and nothing waits on an admin step.
  • Docs: 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 test 156 of 156; cfn-lint infra/cfn/*.yaml clean; node --test selfhost/launch/*.test.mjs passes.
  • The permission simulator fixture is unchanged: no boundary, access stack, deploy role or helper policy changed (the new permissions are in the customer's log reader templates), and the native simulator tests replay it green.

…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
@nambok
nambok merged commit b933675 into main Nov 9, 2026
10 checks passed
@nambok
nambok deleted the knowledge-import-connect branch November 9, 2026 04:18
coderhelm Bot pushed a commit that referenced this pull request Dec 3, 2026
Moves dashboardRef from 6593784 to 1002bc7, carrying CoderHelm/coderhelm #502, #514, #513, #527, #530, #531, #533, #529, #536, #535, #499 and #537.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant