E_AUTH_429. POST /query runs both together by default, a combination called hybrid search, so one request handles paraphrases and exact identifiers. BM25 is the keyword-ranking method it uses.
In this guide:
- Choose the matching method:
query_by, and the three signals a query can use. - Balance meaning and keywords: the
alphavalue. - Where meaning alone falls short: why HydraDB has no pure vector mode.
1. Choose the matching method
query_by picks how the query text is matched:
"hybrid"(the default): matching by meaning and BM25 keyword matching, blended byalpha. Use it unless you have a reason not to."text": BM25 only. Use it when the literal wording is the point, such as a legal clause, a SKU, or a function name.operatorsays how the terms must match:"or"(the default),"and", or"phrase"."and"and"phrase"are valid only withquery_by: "text".
graph_context is on (the default):
Hybrid query and exact phrase query: Python, TypeScript, or cURL
Hybrid query and exact phrase query: Python, TypeScript, or cURL
The first request is a hybrid search kept inside the
phoenix project with a metadata filter. The second returns only passages that contain the exact phrase “mechanical engineer”.metadata_filters are exact constraints. They run before ranking and are re-checked after the matching passages load, so use them for any scope the query must not cross. Top-level keys match metadata and support equals, contains, and contains_any; there is no range or fuzzy match. Nest free-form per-document fields under additional_metadata. See Metadata.2. Balance meaning and keywords with alpha
alpha sets the blend in a hybrid query. Higher values lean on meaning; lower values lean on keywords.
Start with the default and tune from observed results.
"auto" also resolves to 0.8. If users query for exact IDs and get loosely related results, lower alpha. If they ask broad conceptual questions and get sparse results, raise it. alpha applies only to query_by: "hybrid"; it is ignored for "text".
Technical lookup with a low alpha: Python, TypeScript, or cURL
Technical lookup with a low alpha: Python, TypeScript, or cURL
Lower
alpha when names, IDs, and literal strings matter but the query still has a natural-language part.3. Where meaning alone falls short
Pure vector search misses things that matter in production:- Exact identifiers such as
E_AUTH_429orpayments-worker-v4may be generalized away. - A project name can collide with a normal word, like
strawberrythe project and strawberry the fruit. - Old and new documents can look equally relevant without recency or metadata signals.
- Different users can need different context for the same query.
- Relationship questions need graph context, not only similar text chunks.
query_by: "hybrid" inside the one /query endpoint rather than as a separate pure-vector mode. The keyword, recency, metadata, scope, and graph signals ride along with it.
Related
- Query: the request, the recipes, and the full parameter reference
- Context Graphs: the third signal, and how to read it
- Metadata: designing filterable schemas
- How to Use API Results: turning the response into a model prompt
