Knowledge API
The sources an agent answers from. 7 ops: add_knowledge_source, list_knowledge_sources, get_knowledge_source, update_knowledge_source, sync_knowledge_source, delete_knowledge_source, search_knowledge.
The sources an agent answers from.
add_knowledge_source
writeAdd a knowledge source · POST /api/v1/add_knowledge_source · scope knowledge:write
Adds content agents answer from. kind url: a public page (follow_links: true also reads same-site pages under path_prefix, up to max_pages); sitemap: every page of a sitemap.xml (filtered by path_prefix); markdown, text or file: a document you upload as text (filename tells HTML from Markdown). Content is chunked and embedded; crawls sync in the background within a minute and then every sync_interval_hours. agent_id attaches it to one agent; without it every agent of the organization can use it. Returns the source; check status with get_knowledge_source.
curl -X POST https://getwabi.dev/api/v1/add_knowledge_source \ -H "Authorization: Bearer wabi_…" \ -H "Content-Type: application/json" \ -d '{"kind":"url","name":"Support"}'npx @meterapp/wabi add_knowledge_source --json '{"kind":"url","name":"Support"}'{
"type": "object",
"properties": {
"kind": {
"type": "string",
"enum": [
"url",
"sitemap",
"markdown",
"text",
"file"
]
},
"name": {
"type": "string",
"minLength": 1,
"maxLength": 200
},
"agent_id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"description": "AI agent id."
},
"url": {
"description": "url and sitemap: the page or sitemap.xml to read (http or https, publicly reachable).",
"type": "string",
"format": "uri"
},
"follow_links": {
"default": false,
"type": "boolean"
},
"path_prefix": {
"description": "Only pages whose path starts with this (e.g. /help/).",
"type": "string",
"maxLength": 500
},
"max_pages": {
"type": "integer",
"minimum": 1,
"maximum": 200
},
"content": {
"type": "string",
"maxLength": 1000000,
"description": "The document's text (Markdown, plain text or HTML), at most 1,000,000 characters."
},
"filename": {
"type": "string",
"maxLength": 200
},
"sync_interval_hours": {
"default": 24,
"description": "Resync crawled sources this often; 0 never.",
"type": "integer",
"minimum": 0,
"maximum": 8760
},
"stale_after_days": {
"default": 30,
"type": "integer",
"minimum": 1,
"maximum": 3650
}
},
"required": [
"kind",
"name"
]
}List knowledge sources · POST /api/v1/list_knowledge_sources · scope knowledge:read or GET …?input=
The organization's knowledge sources (or one agent's plus the organization-wide ones) with status, document and chunk counts, last and next sync, and whether each is stale and why.
curl -X POST https://getwabi.dev/api/v1/list_knowledge_sources \ -H "Authorization: Bearer wabi_…"npx @meterapp/wabi list_knowledge_sources{
"type": "object",
"properties": {
"agent_id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"description": "AI agent id."
}
}
}Get a knowledge source · POST /api/v1/get_knowledge_source · scope knowledge:read or GET …?input=
One source with its documents (URL or file name, title, size, when fetched and when last changed) and staleness.
curl -X POST https://getwabi.dev/api/v1/get_knowledge_source \ -H "Authorization: Bearer wabi_…" \ -H "Content-Type: application/json" \ -d '{"source_id":"6f1c2e0a-4b7d-4c2e-9a51-0d3b8e7f9a10"}'npx @meterapp/wabi get_knowledge_source --json '{"source_id":"6f1c2e0a-4b7d-4c2e-9a51-0d3b8e7f9a10"}'{
"type": "object",
"properties": {
"source_id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
}
},
"required": [
"source_id"
]
}Update a knowledge source · POST /api/v1/update_knowledge_source · scope knowledge:write
Renames a source, replaces an uploaded document's content (re-embedded at once), changes a crawl's settings or schedule, or disables it (agents stop using it). Crawl changes take effect at the next sync; call sync_knowledge_source to sync now.
curl -X POST https://getwabi.dev/api/v1/update_knowledge_source \ -H "Authorization: Bearer wabi_…" \ -H "Content-Type: application/json" \ -d '{"source_id":"6f1c2e0a-4b7d-4c2e-9a51-0d3b8e7f9a10"}'npx @meterapp/wabi update_knowledge_source --json '{"source_id":"6f1c2e0a-4b7d-4c2e-9a51-0d3b8e7f9a10"}'{
"type": "object",
"properties": {
"source_id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
"name": {
"type": "string",
"minLength": 1,
"maxLength": 200
},
"content": {
"type": "string",
"maxLength": 1000000,
"description": "The document's text (Markdown, plain text or HTML), at most 1,000,000 characters."
},
"url": {
"type": "string",
"format": "uri"
},
"follow_links": {
"type": "boolean"
},
"path_prefix": {
"type": "string",
"maxLength": 500
},
"max_pages": {
"type": "integer",
"minimum": 1,
"maximum": 200
},
"sync_interval_hours": {
"type": "integer",
"minimum": 0,
"maximum": 8760
},
"stale_after_days": {
"type": "integer",
"minimum": 1,
"maximum": 3650
},
"enabled": {
"type": "boolean"
}
},
"required": [
"source_id"
]
}Sync a knowledge source now · POST /api/v1/sync_knowledge_source · scope knowledge:write
Re-reads a source now: a crawl is queued for the agents worker (done within a minute or two); an uploaded document is re-embedded at once. Unchanged pages keep their chunks; changed pages are re-chunked; pages that disappeared are removed.
curl -X POST https://getwabi.dev/api/v1/sync_knowledge_source \ -H "Authorization: Bearer wabi_…" \ -H "Content-Type: application/json" \ -d '{"source_id":"6f1c2e0a-4b7d-4c2e-9a51-0d3b8e7f9a10"}'npx @meterapp/wabi sync_knowledge_source --json '{"source_id":"6f1c2e0a-4b7d-4c2e-9a51-0d3b8e7f9a10"}'{
"type": "object",
"properties": {
"source_id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
}
},
"required": [
"source_id"
]
}Delete a knowledge source · POST /api/v1/delete_knowledge_source · scope knowledge:write
Deletes a source with its documents and chunks. Agent versions that name it stop finding its content.
curl -X POST https://getwabi.dev/api/v1/delete_knowledge_source \ -H "Authorization: Bearer wabi_…" \ -H "Content-Type: application/json" \ -d '{"source_id":"6f1c2e0a-4b7d-4c2e-9a51-0d3b8e7f9a10"}'npx @meterapp/wabi delete_knowledge_source --json '{"source_id":"6f1c2e0a-4b7d-4c2e-9a51-0d3b8e7f9a10"}'{
"type": "object",
"properties": {
"source_id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
}
},
"required": [
"source_id"
]
}search_knowledge
readSearch knowledge · POST /api/v1/search_knowledge · scope knowledge:read or GET …?input=
Hybrid (semantic + keyword) search over knowledge sources, exactly as agents retrieve: the passages that best match a question, each with its source, document title and URL, heading, score and freshness. Pass agent_id to search what that agent can use, or source_ids.
curl -X POST https://getwabi.dev/api/v1/search_knowledge \ -H "Authorization: Bearer wabi_…" \ -H "Content-Type: application/json" \ -d '{"query":"refund"}'npx @meterapp/wabi search_knowledge --json '{"query":"refund"}'{
"type": "object",
"properties": {
"query": {
"type": "string",
"minLength": 2,
"maxLength": 1000
},
"agent_id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"description": "AI agent id."
},
"source_ids": {
"maxItems": 50,
"type": "array",
"items": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
}
},
"limit": {
"default": 8,
"type": "integer",
"minimum": 1,
"maximum": 20
}
},
"required": [
"query"
]
}