v4

OpenAPI 3.1.02026-08-01166346466.7 KB
stores

Enhance a search query

Extract metadata filters and ranking preferences from a search query.

post/v1/stores/queries/enhance

Request body

top_kinteger

Number of results to return

file_idsstring[] nullable

Optional list of file IDs to filter chunks by (inclusion filter)

instructionsstring nullable

Optional guidance for query enhancement.

Example request

{
  "filters": {
    "all": [
      {
        "key": "price",
        "operator": "gt",
        "value": "100"
      },
      {
        "key": "color",
        "operator": "eq",
        "value": "red"
      }
    ],
    "any": [
      {
        "key": "price",
        "operator": "gt",
        "value": "100"
      },
      {
        "key": "color",
        "operator": "eq",
        "value": "red"
      }
    ],
    "none": [
      {
        "key": "price",
        "operator": "gt",
        "value": "100"
      },
      {
        "key": "color",
        "operator": "eq",
        "value": "red"
      }
    ]
  },
  "file_ids": [
    "123e4567-e89b-12d3-a456-426614174000",
    "123e4567-e89b-12d3-a456-426614174001"
  ],
  "query": "This is a sample text input.",
  "search_options": {
    "rerank": {
      "model": "rerank_model",
      "top_k": 10
    }
  }
}

Response

A single enhanced query item