Back to Prompts

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.

groundinghallucinationcitationssystem-prompt

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.

chunkingindexingarchitecturepreprocessing

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.

evaluationtestingqualitybenchmark

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.

evaluationllm-as-judgefaithfulnessqa

Legal Query Rewriting for Retrieval

Turns a client's natural-language question into several retrieval queries in legal terminology, with synonyms and metadata filters.

query-expansionretrievalhybrid-searchpreprocessing

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.

rerankingprecisioncontext-windowretrieval

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.

contradictionversioningqualityanalysis

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.

citationstraceabilityoutput-formatcompliance

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.

metadataextractionindexingstructured-output

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.

debuggingdiagnosticsroot-causeoperations

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.

hybrid-searchbm25embeddingsarchitecture

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.

privacypiicompliancesecurity

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.

safetyguardrailscompliancesystem-prompt