Use the SearchWikiPages interface to search currently published Wiki pages based on query text. This interface is used for page discovery; to retrieve the full content, call GetWikiPage.
Prerequisites
-
An AgentStorage instance has been created and its status is
normal, and the instance access address (endpoint) and instance name have been obtained. -
An API Key has been created.
-
Wiki operations use the complete three-segment Agent Scope (
appId/tenantId/agentId). Each segment must be non-empty and cannot be*, must be at most 128 bytes, and cannot contain/; do not pass inrunId.
Request parameters
|
Field |
Type |
Required |
Description |
|
|
string |
Yes |
The name of the memory store. |
|
|
object |
Yes |
The complete three-segment Agent Scope. The rules are the same as for |
|
|
string |
Yes |
Non-empty query text. |
|
|
int |
No |
The number of results to return. Default: 10. Maximum: 100. |
Request example
When you use API Key authentication, pass the instance name and API Key through the x-ots-instancename and x-ots-apikey request headers.
curl -X POST https://<endpoint>/SearchWikiPages \
-H "x-ots-instancename: <instance-name>" \
-H "x-ots-apikey: <your-api-key>" \
-H "Content-Type: application/json" \
-d '{
"memoryStoreName": "agent_memory",
"scope": {
"appId": "app-001",
"tenantId": "user-001",
"agentId": "assistant"
},
"query": "How does the payment callback ensure idempotency",
"limit": 5
}'
Response
|
Field |
Description |
|
|
A list of pages sorted by relevance. For the fields, see [Wiki page object](./get-wiki-page.md#wiki-page-object). |
|
|
The relevance score between the page and the query. |
The search results do not return content. We recommend that your application select a small number of matched pages, and then call GetWikiPage by path to retrieve the full content.
{
"pages": [
{
"path": "/wiki/payment-callback.md",
"title": "Payment callback",
"type": "guide",
"description": "Idempotency and signature verification requirements for payment callbacks",
"sources": [
"raw/product/payment.md"
],
"score": 0.87
}
]
}