Add documents to a knowledge base
workbench_kb_add_documentsAdds documents to a knowledge base and starts ingestion (chunk + embed; graph KBs also extract entities; tabular KBs load CSV as tables). Text goes inline (Markdown, plain text, CSV — encoding utf8); binary files (PDF, .docx) go base64-encoded with their mimeType. Up to 50 sources per call, ~10 MB each. Ingestion runs in the BACKGROUND — the result carries a runId; check it with workbench_kb_ingestion_status when the user asks, don't poll. workbench_kb_search works once it finishes. Content from blocks is ideal source material. Check workbench_kb_documents_list first so you don't add a document twice. Embedding spends workspace inference credit, so this sits behind the approval gate: may return needs_confirmation.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kbId | Yes | Knowledge base id (from workbench_kb_list or workbench_kb_create). | |
| sources | Yes | Documents to ingest (1-50). | |
| workspace | No | Workspace slug override. | |
| approvalId | No | Approval id from a prior needs_confirmation envelope. |