Skip to content

Manage knowledge bases and sync their documents from a directory.

Terminal window
caplo knowledge

Aliases: kb

A knowledge base holds documents an agent answers from. Each upload is extracted and waits for review; a person approves it in the console, or caplo knowledge approve does. Publishing snapshots the approved documents into a version, and an agent release pins the newest ready version. Agent files name knowledge bases by name or ID, and so do these commands.

Examples

Terminal window
caplo knowledge create "Returns policy" --owner support
caplo knowledge sync "Returns policy" ./docs/returns --approve --publish --yes

Commands

Wait for extraction and approve documents for the next version, by default every one awaiting review.

Terminal window
caplo knowledge approve <kb> [document]... [flags]

Approving a document skips reviewing its extracted text in the console. It waits for documents still being extracted and fails when one fails to extract. It needs agents:publish.

Examples

Terminal window
caplo knowledge approve "Returns policy"
caplo knowledge approve "Returns policy" refunds.md exchanges.pdf

Flags

Flag Value Default Description
--timeout duration 15m0s how long to wait for extraction

Create a knowledge base.

Terminal window
caplo knowledge create <name> --owner <team> [flags]

Creates a knowledge base. –owner names the team that owns its content. –audience verified_customer limits its content to customers who signed in; the default is public.

Examples

Terminal window
caplo knowledge create "Returns policy" --owner support --description "Return and refund rules"
caplo knowledge create "Account help" --owner support --audience verified_customer

Flags

Flag Value Default Description
--audience string public (default) or verified_customer, for content only signed-in customers may get
--description string what the knowledge base covers
--owner string team that owns the content

Show a knowledge base, its documents, and its versions.

Terminal window
caplo knowledge get <kb> [flags]

Shows the knowledge base, its newest version, and its documents with their extraction and review state. -o json or yaml includes every version.

Examples

Terminal window
caplo knowledge get "Returns policy"

Flags

Flag Value Default Description
--output, -o string table output format: table, json, or yaml

List the workspace’s knowledge bases.

Terminal window
caplo knowledge list [flags]

Examples

Terminal window
caplo kb list

Flags

Flag Value Default Description
--output, -o string table output format: table, json, or yaml

Publish a version from the approved documents and wait for it to index.

Terminal window
caplo knowledge publish <kb> [flags]

Publishes a version from the approved documents, unless the newest version holds exactly them, and waits until it is ready. Agent releases published from then on use it. Exits 3 when there are no approved documents or the version does not become ready.

Examples

Terminal window
caplo knowledge publish "Returns policy"
caplo knowledge publish "Returns policy" --timeout 30m

Flags

Flag Value Default Description
--timeout duration 15m0s how long to wait for indexing

Make a knowledge base’s documents match a directory, and optionally approve and publish them.

Terminal window
caplo knowledge sync <kb> <dir> [flags]

Uploads the directory’s new and changed documents and removes the ones whose file is gone. The older copy of a changed file is removed once the new copy is approved, so a version never lacks the document; a document a published version holds stays in that version. Files are matched by name and content, so an unchanged file is not uploaded again. Documents are named by file name, so two files in the tree may not share one. Supported types, up to 25 MiB each: .txt .md .markdown .html .pdf .docx .png .jpg .jpeg .webp. Other files are skipped, and so are hidden files and directories.

–approve waits for extraction and approves the directory’s documents, which skips reviewing their extracted text in the console; it needs agents:publish. –publish then publishes a version from the approved documents and waits for it to index. It asks for confirmation before removing documents; –yes skips it. –dry-run prints the changes only.

Examples

Terminal window
caplo knowledge sync "Returns policy" ./docs/returns --dry-run
caplo knowledge sync "Returns policy" ./docs/returns --approve --publish --yes

Flags

Flag Value Default Description
--approve wait for extraction and approve the directory’s documents
--dry-run show the changes without making them
--publish publish a version from the approved documents and wait for it to index
--timeout duration 15m0s how long –approve and –publish wait for extraction and indexing
--yes, -y remove documents without asking