You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(query-agent): make search-mode filtering a required argument
The Query Agent service now requires the search-mode `filtering` argument to be
"recall" or "precision"; the latest client (weaviate-agents 1.6.0) still
defaults it to None and sends null, so every `.search()` call that omits
`filtering` fails with a 422. Document `filtering` as required (recommending
"recall") and pass `filtering="recall"` in every initial search-mode snippet
(Python + TypeScript); the precision FilteringExample and pagination/ask calls
are unchanged.
Copy file name to clipboardExpand all lines: docs/query-agent/guides/search_mode.md
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -67,7 +67,7 @@ The `.search()` method accepts several arguments:
67
67
|`query`|`str \| list[ChatMessage]`| The user query you want the agent to search with. This can be a simple string (`"Find me some vintage shoes under $70"`) or a list of chat messages (for conversational context). [See the page on multi-turn conversations for more detail](../reference/multi_turn_conversations.md). |
68
68
|`collections`|`list[str \| QueryAgentCollectionConfig] \| None`| The name(s) of the collections to search. You can pass one or many collection names as a list of strings (e.g., `["ECommerce", "BookSales"]`), or provide collection configuration objects for more control. If specified in the `ask` method, it will overwrite those defined in the instantiation of `QueryAgent`. [See the page on collection configuration for more detail](../reference/advanced_collections.md). |
69
69
|`limit`|`int`| The maximum number of results returned in this page of results. Defaults to `20`. Use [`.next()`](#pagination) to fetch additional pages. |
70
-
|`filtering`|`Literal["recall", "precision"]`| Either `"recall"` or `"precision"` to control filter generation. `"recall"` favors more results across filter interpretations; `"precision"` favors strict intent match. See [Customized filtering](#customized-filtering) below. |
70
+
|`filtering`|`Literal["recall", "precision"]`|**Required.**Either `"recall"` or `"precision"` to control filter generation. `"recall"` favors more results across filter interpretations; `"precision"` favors strict intent match. Pass `"recall"` for most cases. See [Customized filtering](#customized-filtering) below. |
71
71
|`diversity_weight`|`float \| None`| A value between `0.0` and `1.0` that biases the result ranking towards diversity using Maximal Marginal Relevance (MMR). See [Diversity ranking](#diversity-ranking) below. |
72
72
73
73
</TabItem>
@@ -77,7 +77,7 @@ The `.search()` method accepts several arguments:
77
77
|`query`|`string \| ChatMessage[]`| The user query you want the agent to search with. This can be a simple string (`"Find me some vintage shoes under $70"`) or a list of chat messages (for conversational context). [See the page on multi-turn conversations for more detail](../reference/multi_turn_conversations.md). |
78
78
|`collections`|`(string \| QueryAgentCollectionConfig)[]`| The name(s) of the collections to search. You can pass one or many collection names as a list of strings (e.g., `["ECommerce", "BookSales"]`), or provide collection configuration objects for more control. If specified in the `ask` method, it will overwrite those defined in the instantiation of `QueryAgent`. [See the page on collection configuration for more detail](../reference/advanced_collections.md). |
79
79
|`limit`|`number`| The maximum number of results returned in this page of results. Defaults to `20`. Use [`.next()`](#pagination) to fetch additional pages. |
80
-
|`filtering`|`"recall" \| "precision"`| Either `"recall"` or `"precision"` to control filter generation. `"recall"` favors more results across filter interpretations; `"precision"` favors strict intent match. See [Customized filtering](#customized-filtering) below. |
80
+
|`filtering`|`"recall" \| "precision"`|**Required.**Either `"recall"` or `"precision"` to control filter generation. `"recall"` favors more results across filter interpretations; `"precision"` favors strict intent match. Pass `"recall"` for most cases. See [Customized filtering](#customized-filtering) below. |
81
81
|`diversityWeight`|`number`| A value between `0.0` and `1.0` that biases the result ranking towards diversity using Maximal Marginal Relevance (MMR). See [Diversity ranking](#diversity-ranking) below. |
82
82
83
83
</TabItem>
@@ -89,7 +89,9 @@ For more advanced searches, you can also specify _additional filters_ within the
89
89
90
90
Search Mode uses query rewriting to transform your original query into one or multiple Weaviate queries, each with either a search query, metadata filters, or both. The `filtering` parameter controls how many Weaviate queries are generated.
91
91
92
-
-**`"recall"`** (default): Generates multiple Weaviate queries spanning different filters and interpretations of the user query. You should use these when you prefer to get results, even if they don't match every criteria in your query.
92
+
`filtering` is a required argument; pass either `"recall"` or `"precision"`. `"recall"` is recommended when you want more results.
93
+
94
+
-**`"recall"`** (recommended): Generates multiple Weaviate queries spanning different filters and interpretations of the user query. You should use these when you prefer to get results, even if they don't match every criteria in your query.
93
95
94
96
-**`"precision"`**: Generates a single Weaviate query targeting the most likely interpretation of the user query. You should use this when you want the results to follow your query intent closely, even if that means potentially receiving no results.
0 commit comments