stores

List store chunks by metadata filter and numeric ranking

Changed on

List store chunks purely by metadata filters — no embeddings, no semantic similarity, no reranking.

Unlike /stores/search, this endpoint does not require a query and never runs a vector lookup. It returns chunks whose file and chunk metadata satisfy filters, optionally ordered by a numeric metadata field via sort_by. Useful for ranked retrieval over numeric attributes (e.g. price, BPM) and for reproducing the agentic filter_chunks tool externally.

list-chunks filters across all requested stores and returns at most top_k chunks in total. With sort_by, results are ordered globally by that field. Otherwise results are interleaved across stores in the order requested, preserving each store's result order. Pagination is not supported; raise top_k to retrieve more chunks.

Args: filter_params: Filter configuration including: - store_identifiers: IDs or names of the stores to filter against - filters: optional metadata filter conditions - file_ids: optional list of file IDs to filter chunks by - sort_by: optional metadata field path, or (field, ascending) tuple, for numeric ordering - top_k: number of chunks to return

Returns: StoreListChunksResponse containing the list of matching chunks.

Raises: HTTPException (400): If filter parameters are invalid HTTPException (404): If the store is not found

post/v1/stores/list-chunks

Request

  • Base URL
    https://api.mixedbread.com
  • URL
    https://api.mixedbread.com/v1/stores/list-chunks
  • Auth
    HTTP bearer

Request body

top_kinteger

Number of results to return

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"
      }
    ]
  },
  "search_options": {
    "rerank": {
      "model": "rerank_model",
      "top_k": 10
    }
  }
}

Response

List of chunks matching the metadata filters, optionally ordered by a numeric metadata field

object'list'

The object type of the response

Example response

{
  "data": [
    {
      "mime_type": "text/plain",
      "model": "text-embedding-ada-002",
      "score": 0.5,
      "file_id": "file1",
      "filename": "file1",
      "store_id": "store1",
      "external_id": "ext-123",
      "metadata": {
        "key": "value"
      },
      "file_url": "https://storage.mixedbread.com/org1/files/file1.pdf?X-Amz-Signature=...",
      "context": "This chunk is from an SEC filing on ACME corp's Q2 2023 performance.",
      "summary": "A short overview of ACME's Q2 2023 performance."
    }
  ]
}

Changes