kb_sources
Manage knowledge base source records and upload documents to stage pages and queue chunk/embed ingestion for retrieval.
Instructions
CRUD + inline upload for the KB registry (agent_data_sources).
action: list | get | create (name, kind, ...; pgvector sources default
to the shared ai_kb_embeddings/ai_kb_pages tables when config.table is
omitted) | update (source_id + fields) | delete (source_id,
confirm=true — detaches from every profile's data_source_ids, then
hard-deletes) | upload_document (source_id, filename, content — stages
a page row and queues background chunk/embed ingestion; pgvector
sources only; refused with what to set when no embedding model is
configured). list also returns embedding: the model in force.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"action": "<action>"
},
"name": "kb_sources"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| env | No | Config branch: which `environment` rows of the AI config DB to read/write. staging = the editable working set (default); prod = what production serves. | staging |
| kind | No | Source kind (pgvector, ...; see KB_KINDS). | |
| name | No | KB source name. | |
| title | No | upload_document: page title (default filename). | |
| action | Yes | Operation to run: list | get | create | update | delete | upload_document. The tool description lists what each action needs. | |
| config | No | Source config JSON (pgvector: table, pages_table, chunking, embed_model). | |
| confirm | No | false (default) = dry run, nothing changes; true = execute. | |
| content | No | upload_document: the document text. | |
| filename | No | File name of the uploaded document. | |
| language | No | Language code of the content. | en |
| is_active | No | Active flag. | |
| page_type | No | KB page type label, e.g. user_guide. | user_guide |
| source_id | No | agent_data_sources (KB source) UUID (kb_sources action=list). | |
| agent_kind | No | Agent kind the source belongs to. | |
| refresh_cadence | No | How often the source is refreshed (free text). | |
| freshness_sla_hours | No | Alert when the source is older than this. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |