Prompts
RAG & Retrieval

Designing Hybrid Search for Legal Content

Balances lexical and semantic search for legal content, where clause numbers and defined terms need exact matching while conceptual questions need semantic similarity.

Prompt

Design a hybrid search layer. Semantic-only search misses clause numbers and defined terms; lexical-only search misses conceptual questions.

Corpus: [document type and volume] Languages: [Hebrew / English / mixed] Typical query types: [describe 4-6 real examples] Existing infrastructure: [database, search engine, embedding model]

Produce:

  1. Division of labour — which queries should go lexical, which semantic, which both. Base this on the supplied examples.
  2. Cases requiring exact matching — clause numbers, quoted defined terms, party names, case numbers, amounts, dates. Explain why embeddings fail on each.
  3. Fusion method — Reciprocal Rank Fusion or weighted linear combination. Justify the choice and propose starting values.
  4. Hebrew specifics — handling of niqqud, full vs defective spelling, inflected forms, abbreviations, and Hebrew-English mixing within one sentence.
  5. Metadata filtering — when to filter before search versus after, and why the order matters.
  6. Measurement — how to know hybrid beats either method alone. Propose a metric and the baseline.

Explicitly name three cases where hybrid will still fail.

Why this converts well

  • Ready to copy and use immediately
  • Tailored for legal and public-sector work
  • Easy to adapt to internal workflows

Tags

hybrid-searchbm25embeddingsarchitecture