Skip to content

AIKnowledgeSearch

POST ai/knowledge/search

Returns the fragments the assistant would receive for this question, with their scores. When an answer is wrong, this is the first thing to check: usually the right document was not found at all, and the model is not to blame.

Scope follows the session. The brand comes from the session, never from the request — a manager of one brand cannot read another brand's knowledge. A client session gets only documents allowed for clients.

Access Control

Allowed: client, manager, admin.

Parameters

Parameter Type Description
query string The question, 1 to 1000 characters
route string Optional. Current interface screen; documents attached to it rank higher
language string Optional. Detected from the query when omitted
limit int 1 to 20

Response Data

{
  "brand": "Ion",
  "count": 3,
  "rows": [
    {
      "id": "trading.margin-call#1",
      "docId": "trading.margin-call",
      "title": "Margin call and stop out",
      "section": "Margin call",
      "language": "en",
      "scope": "global",
      "score": 39.23,
      "content": "When the margin level falls to the group's threshold…"
    }
  ]
}

A chunk id is <document>#<index>; docId is what appears in an answer's sources.

Errors

Code Error Description
403 AI_ACCESS_DENIED The session type may not use the assistant
503 AI_KNOWLEDGE_NOT_READY The index is still being built