Tawa docs
Knowledge

Search served knowledge

Searches the documents currently served from the app's buckets. Combines keyword and semantic ranking and returns at most one hit per document. When semantic search is unavailable the response has `mode: "keyword"` and a `note` saying so. Documents in review or still being scanned are not searched; the previously served version keeps answering until the new one is released.

POST
/knowledge/search

Searches the documents currently served from the app's buckets. Combines keyword and semantic ranking and returns at most one hit per document. When semantic search is unavailable the response has mode: "keyword" and a note saying so. Documents in review or still being scanned are not searched; the previously served version keeps answering until the new one is released.

Authorization

AuthorizationBearer <token>

Your API key as a bearer token.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/knowledge/search" \  -H "Content-Type: application/json" \  -d '{    "query": "string"  }'
{
  "mode": "hybrid",
  "note": "string",
  "results": [
    {
      "doc_id": "c8561737-9a40-4d91-8958-e405c0ad8596",
      "title": "string",
      "bucket": "string",
      "snippet": "string",
      "score": 0,
      "provenance": {
        "status": "served",
        "redacted": true,
        "engine": "string",
        "scanned_at": "2019-08-24T14:15:22Z"
      }
    }
  ]
}
{
  "error": "Invalid API key",
  "code": "INVALID_API_KEY",
  "retryAfter": 0
}
{
  "error": "Invalid API key",
  "code": "INVALID_API_KEY",
  "retryAfter": 0
}
{
  "error": "Invalid API key",
  "code": "INVALID_API_KEY",
  "retryAfter": 0
}
{
  "error": "Invalid API key",
  "code": "INVALID_API_KEY",
  "retryAfter": 0
}