Search the agent's trained knowledge base and get the most relevant passages, ordered by relevance, without generating a reply. Runs the same retrieval the agent uses when answering, so it is the fastest way to check what the agent knows about a topic. Does not use message credits. An agent that has not finished training returns an empty list. Requires the read:knowledge permission.
Authorization
BearerAuth read:knowledgeIn: header
Scope: read:knowledge
Path Parameters
Query Parameters
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/api/v1/agents/string/knowledge/search?query=string"{
"agentId": "string",
"query": "string",
"items": [
{
"content": "Our starter plan includes 1,000 message credits per month and unlimited agents.",
"title": "Pricing",
"url": "https://example.com/pricing"
}
]
}{
"type": "string",
"title": "string",
"status": 0,
"detail": "string",
"issues": [
{
"path": "string",
"message": "string"
}
]
}{
"type": "string",
"title": "string",
"status": 0,
"detail": "string",
"issues": [
{
"path": "string",
"message": "string"
}
]
}{
"type": "string",
"title": "string",
"status": 0,
"detail": "string",
"issues": [
{
"path": "string",
"message": "string"
}
]
}{
"type": "string",
"title": "string",
"status": 0,
"detail": "string",
"issues": [
{
"path": "string",
"message": "string"
}
]
}{
"type": "string",
"title": "string",
"status": 0,
"detail": "string",
"issues": [
{
"path": "string",
"message": "string"
}
]
}{
"type": "string",
"title": "string",
"status": 0,
"detail": "string",
"issues": [
{
"path": "string",
"message": "string"
}
]
}Upload a file source POST
Upload a document (PDF, DOCX, PPTX, CSV, XLS/XLSX, TXT, Markdown, HTML, or JSON; 10 MB max) as a `file` training source and queue background indexing. Send the document as a `file` field in a `multipart/form-data` body. Poll `GET /agents/{id}/sources` or `GET /agents/{id}/training-status` to watch progress. Requires the `write:sources` permission.
Get training status GET
Live training state for an agent: whether a run is active, its phase, and page progress. Poll this after adding sources or triggering a retrain. Requires the `read:sources` permission.