post/api/v2/knowledge-sources/search
Search Knowledge Base chunks.
Searches locally indexed Knowledge Base chunks for Content Agent retrieval.
Requires bearer API keyParameters
| Name | In | Description |
|---|---|---|
| X-Project-Id | header | Required for organization-wide API keys on project-scoped endpoints. Project-scoped keys infer the project automatically.string |
Request Body
{
"type": "object",
"additionalProperties": false,
"properties": {
"query": {
"type": "string"
},
"q": {
"type": "string"
},
"limit": {
"type": "integer"
},
"k": {
"type": "integer"
}
}
}Responses
200
application/jsonKnowledge chunk search results.
{
"type": "object",
"additionalProperties": false,
"properties": {
"chunks": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"id": {
"type": "string"
},
"sourceId": {
"type": "string"
},
"sourceTitle": {
"type": "string"
},
"sourceKind": {
"type": "string",
"enum": [
"file",
"url",
"note"
]
},
"text": {
"type": "string"
},
"tokenCount": {
"type": "integer",
"nullable": true
},
"score": {
"type": "number"
}
},
"required": [
"id",
"sourceId",
"sourceTitle",
"sourceKind",
"text",
"score"
]
}
}
},
"required": [
"chunks"
]
}400
application/jsonError response.
{
"type": "object",
"properties": {
"error": {
"type": "string"
},
"message": {
"type": "string"
}
}
}Try it
Send this request to the local WatchLLM REST handler. Use a key from /workspace/api; organization keys can include X-Project-Id only when the endpoint documents that header.