List store chunks by metadata filter and numeric ranking
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
Request body
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"
],
"sort_by": "price",
"search_options": {
"rerank": {
"model": "rerank_model",
"top_k": 10
}
}
}Response
List of chunks matching the metadata filters, optionally ordered by a numeric metadata field
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"
},
"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
Changed in 4 of the 30 revisions of this API.419
- ▲
added to the
////response propertyoneOflist for the response statusresponse-property-one-of-added
- ▲
added to the
////response propertyoneOflist for the response statusresponse-property-one-of-added
- ▲
added to the
////response propertyoneOflist for the response statusresponse-property-one-of-added
- ▲
added to the
////response propertyoneOflist for the response statusresponse-property-one-of-added
- ○
added
csvdiscriminator mapping keys to the////response property for the response statusresponse-property-discriminator-mapping-added
- ○
added
csvdiscriminator mapping keys to the////response property for the response statusresponse-property-discriminator-mapping-added
- ○
added
csvdiscriminator mapping keys to the////response property for the response statusresponse-property-discriminator-mapping-added
- ○
added
csvdiscriminator mapping keys to the////response property for the response statusresponse-property-discriminator-mapping-added
- ▲
- ●
the
request property's max was set to10000.00request-property-max-set
This revision also has 4 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog
- ●
- ○
added the new optional request property
/new-optional-request-property
- ○
- ○
the
request property default value changed frommixedbread-ai/mxbai-rerank-v3-listwisetomixedbread-ai/mxbai-rerank-v3.1-listwiserequest-property-default-value-changed
- ○
added the optional property
///to the response with the statusresponse-optional-property-added
- ○
added the optional property
///to the response with the statusresponse-optional-property-added
- ○
added the optional property
///to the response with the statusresponse-optional-property-added
This revision also has 5 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog
- ○