Mixedbread

Grep Store Chunks

POST/v1/stores/grep

AuthorizationLink to section

Authorizationstringrequired

Bearer token for API authentication. Format: `Bearer YOUR_API_KEY`

Request BodyLink to section

store_identifiersarrayrequired

IDs or names of stores

Constraints

Minimum items: 1Maximum items: 16
patternstringrequired

Regular expression (RE2 syntax) matched against chunk text

Constraints

Minimum length: 1Maximum length: 1024
top_kintegerdefault: 10

Number of results to return

Constraints

Minimum: 1
targetsenum

Chunk content groups to match against. `text` matches the original text of text chunks; `generated` matches ingestion-derived fields (transcription, OCR text, summaries).

Possible values

textgenerated

Constraints

Minimum items: 1
case_sensitivebooleandefault: false

Whether the regular expression is case-sensitive

file_idsarray | null

Optional file IDs to filter. Use list only for inclusion or specify an operator (`in` or `not_in`). Example: ["file_id_1", "file_id_2"] or ["not_in", ["file_id_1", "file_id_2"]].

return_metadatabooleandefault: true

Whether to return file metadata

Response BodyLink to section

objectstringdefault: list

The object type of the response

Request
POST/v1/stores/grep
from mixedbread import Mixedbread

mxbai = Mixedbread(api_key="YOUR_API_KEY")

response = mxbai.stores.grep(
    store_identifiers=["{{STORE_IDENTIFIER}}"],
    pattern="ERR-\\d{4}",
    top_k=10,
)

for chunk in response.data:
    print(chunk)
Response
JSON
{
  "object": "list",
  "data": [
    {
      "chunk_index": 3,
      "mime_type": "text/plain",
      "model": "mxbai-omni",
      "score": 1,
      "file_id": "{{FILE_ID}}",
      "filename": "error_logs.txt",
      "store_id": "c3d4e5f6-a7b8-9012-cdef-345678901234",
      "metadata": {
        "source": "upload",
        "page": 2
      },
      "type": "text",
      "text": "Encountered ERR-4021 while processing the request payload."
    },
    {
      "chunk_index": 7,
      "mime_type": "text/plain",
      "model": "mxbai-omni",
      "score": 1,
      "file_id": "b2c3d4e5-f6a7-8901-bcde-f23456789012",
      "filename": "incident_report.md",
      "store_id": "c3d4e5f6-a7b8-9012-cdef-345678901234",
      "metadata": {
        "category": "ops"
      },
      "type": "text",
      "text": "Root cause analysis points to ERR-1337 raised by the upstream service."
    }
  ]
}
Last updated: May 22, 2026