RAG & Retrieval
13 prompts
Strict Source-Grounded Answering over a Legal Corpus
System prompt that forbids parametric knowledge, requires a cited source span for every claim, and defines explicit behaviour when the retrieved context does not cover the question.
Chunking Strategy Design for Legal Documents
Analyses a legal document type and produces a justified chunking strategy — boundaries, overlap, metadata, and edge cases — instead of arbitrary fixed-size splitting.
Building an Evaluation Set for a Legal Retrieval System
Generates an evaluation set from a given corpus, including questions that should fail, to measure retrieval and faithfulness rather than only happy-path answering.
Faithfulness Judge for RAG Answers
A judge prompt that decomposes an answer into atomic claims and verifies each against the retrieved chunks, returning a faithfulness score plus the list of unsupported claims.
Legal Query Rewriting for Retrieval
Turns a client's natural-language question into several retrieval queries in legal terminology, with synonyms and metadata filters.
Reranking Retrieved Chunks
Reranks candidate chunks by true relevance to the question and filters noise before the context reaches the generator, with a reason per decision.
Detecting Contradictions Across Retrieved Sources
Identifies conflicts among retrieved legal sources — versions, amendments, contradictory clauses — and classifies the conflict type instead of silently picking one.
Converting Retrieval Output into Verifiable Legal Citations
Turns retrieved chunks into references a user can verify independently — document, clause, page — and explicitly flags what cannot be verified.
Legal Document Metadata Extraction for Indexing
Extracts structured metadata fields from a legal document to enable retrieval filtering, with confidence levels separating what was found from what was inferred.
Diagnosing a RAG System Failure
Separates retrieval, ranking, indexing, and generation failures so the fix targets the right layer instead of endlessly tweaking the prompt.
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.
Redacting Identifying Information Before Sending to an External Model
Identifies and replaces personal and privileged client information in legal text before it reaches an external model, preserving legal meaning and reversibility.
Defining the Refusal Boundary for a Legal Assistant
A system prompt separating legal information from legal advice, defining exactly when to refuse, what to say, and where to escalate.