Skip to content
Janeiro.ai
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 read

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.

  1. At ingest, tag chunks with market, language variety (PT-BR / PT-PT / ES), and policy scope.
  2. At query time, apply filters for the user’s jurisdiction before dense or hybrid ranking.
  3. 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 . Original editorial for operators. How this was made