Knowledge bases
A knowledge base (KB) is a named set of text documents that permitted users can search and cite. Access is per group: a user’s effective set is the KBs whose access groups intersect theirs, plus the KBs they own, plus everything for the operator. An unknown or unauthorized KB answers no knowledge base matches, never “forbidden”, so the error leaks no existence information.
Knowledge bases shipped in v0.14.0 (ADR-0004, decision D6). Per-document permission sync from the sources is a declared non-goal; the unit of access is the whole KB.
ka-agent kb create handbook --group devka-agent kb add handbook ./plan.md --title "Q3 plan"ka-agent kb grant handbook --group dev,ops # replace the access groupska-agent kb rm handbook plan.mdka-agent kb listka-agent kb delete handbookadd reads text-like files (.md .txt .csv .json); the file’s base name becomes the document path, and adding the same path again replaces the document.
Retrieval
Section titled “Retrieval”Three paths, all gated by the same access check:
- The
kagent__kb_searchtool (Read effect): every query word must appear; it returns at most 8 hits with title, snippet and citation, and the model is asked to cite what it uses askb:<name>/<path>. - The
@kb:<name>reference (whole KB) or@kb:<name>/<path>(one document) in any message: the content rides the turn as context, like every other@reference (see scheduling & references). - The panel’s
/kbpage: documents, access groups and an upload form (the same replace-by-path rule).
Search is SQLite FTS5 over the stored documents. Every hit a turn uses is recorded with the KB’s access groups in turn_sources, which is what the share-time provenance check reads (below).
Sync connectors
Section titled “Sync connectors”A KB can feed from an external source instead of (or beside) manual uploads:
ka-agent kb source add handbook git https://github.com/acme/handbook --every-minutes 15ka-agent kb source add handbook notion <root-page-id> --token notion.tokenka-agent kb source add handbook dropbox "/Shared/handbook" --token dropbox.tokenka-agent kb source list · kb source sync handbook · kb source rm handbook git <target>kind is notion, dropbox or git; the token (Notion and Dropbox) resolves from the secret store, never the config. --include narrows the indexed files with globs, and the sync interval defaults to 15 minutes (kb source sync forces one now). Deletions at the source propagate, with the delay of one sync interval: the index is eventually consistent with the source, by design and stated as such.
Provenance: sharing is checked
Section titled “Provenance: sharing is checked”When a turn’s answer is about to leave the context it was built in (posting to a shared Slack or Discord channel, or a /file/ link on the panel), ka agent intersects the turn’s recorded sources with the receiving account’s groups. A miss blocks the post, notifies the admin, and writes a provenance.blocked audit row: sharing a summary built from restricted documents is a decision, not a leak. See users & accounts for groups and roles for the enforcement table.