Semantic vs Lexical
POST /recall/full_recall is the default Knowledge recall endpoint. It performs hybrid retrieval over indexed Knowledge sources. POST /recall/recall_preferences uses the same recall model for user Memories. POST /recall/boolean_recall gives you explicit lexical search with or, and, and phrase operators.
Why Pure Semantic Search Breaks
Pure vector search can miss important production constraints:- Exact identifiers such as
E_AUTH_429orpayments-worker-v4may be generalized away. - A project name can collide with a normal word, like
strawberrythe project vs 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.
The alpha Parameter
alpha controls the semantic-vs-lexical blend in recall. Higher values lean semantic. Lower values lean lexical.
Start with the API default (
0.8) and tune from observed results. If users search for exact IDs and get loosely related content, lower alpha. If they ask broad conceptual questions and get sparse results, raise it.
Recall Request Example
metadata_filters run before ranking. Use them whenever the query has a scope that should not be violated.
Practical Recipes
General Retrieval
Use the default semantic-leaning blend for natural-language questions over documents.Technical Lookup
Loweralpha when names, IDs, and literal strings matter.
Scoped Retrieval
Use metadata filters to keep retrieval inside a project, team, customer, data class, or source.Exact Phrase Search
UsePOST /recall/boolean_recall when a literal match is the point of the query.
Reading The Response
Recall returns ranked chunks and source metadata, not an answer. A typical application flow is:- Call
full_recallorrecall_preferences. - Keep the chunks that are relevant enough for your use case.
- Format
chunk_content, source titles, and graph context into a prompt. - Ask your LLM to answer using only that context.
Mental Model
Semantic search finds text that means the same thing. Lexical search finds text that says the same thing. Graph context finds connected entities. Metadata filters decide what is allowed to be searched. HydraDB recall uses these together so your agents get context that is scoped, relevant, and explainable.Related
- Recall - full parameter reference and parallel recall patterns
- Context Graphs - how graph context enriches retrieval
- Metadata - designing filterable schemas
- How to Use API Results - turning the response into an LLM prompt