Skip to main content
POST
/
api
/
v1
/
search
/
tables
/
{table_name}
/
search
Typescript (SDK)
import { SDK } from "@meetkai/mka1";

const sdk = new SDK({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.search.tables.searchData({
    tableName: "<value>",
    searchRequest: {
      operations: [
        {
          type: "vector_search",
          field: "embedding",
          vector: [
            0.11,
            -0.06,
            0.37,
          ],
          distanceType: "cosine",
          limit: 5,
        },
        {
          type: "filter",
          expression: "category = 'security'",
          prefilter: true,
        },
      ],
      returnColumns: [
        "id",
        "content",
        "category",
        "rating",
      ],
    },
  });

  console.log(result);
}

run();
{
  "operations_applied": [
    "vector_search",
    "filter",
    "limit"
  ],
  "results": [
    {
      "_distance": 0.102,
      "category": "account",
      "content": "Reset your password from the account settings page.",
      "id": "doc_001",
      "rating": 4.7
    }
  ],
  "search_time_ms": 18,
  "total": 1
}

Authorizations

Authorization
string
header
required

Authenticate with your MKA1 API key at the API gateway: Authorization: Bearer <mka1-api-key>. For multi-user server-side integrations, also send X-On-Behalf-Of to identify the end user making the request.

Headers

X-On-Behalf-Of
string

Optional external user identifier for multi-user server-side integrations. Use this when acting on behalf of one of your end users.

Path Parameters

table_name
string
required

Body

application/json
operations
(VectorSearchOperation · object | BinaryVectorSearchOperation · object | FtsSearchOperation · object | FilterOperation · object | LimitOperation · object | OffsetOperation · object)[]
return_columns
string[] | null

Response

Successful Response

results
Results · object[]
required
total
integer
required
search_time_ms
integer
required
operations_applied
string[]
required