Pattern
Jurisdiction Filters Before You Rank
Filter retrieval by market, language variety, and regulatory scope before semantic ranking—so global similarity cannot override local law.
1 min readJaneiro.ai
Semantic similarity will happily retrieve a California policy note for a São Paulo operator. Filter first.
The pattern
Make jurisdiction a hard pre-rank constraint, not a prompt hint.
- At ingest, tag chunks with market, language variety (PT-BR / PT-PT / ES), and policy scope.
- At query time, apply filters for the user’s jurisdiction before dense or hybrid ranking.
- Fail closed when no in-jurisdiction evidence exists—prefer refusal over a confident foreign answer.
When to use
- Enterprise assistants over multi-country policy and product docs
- Compliance-aware Q&A where “global best practice” is the wrong answer
- Direct extension of Retrieval with Regional Context
Trade-offs
- Metadata discipline at ingest
- Smaller candidate sets (by design)
- Fewer confident wrong answers that look globally correct
Rank what is allowed. Similarity is not permission.
raglgpdarchitecture
Published by Janeiro.ai. Original editorial for operators. How this was made