AI Engineering Tools

Generative AI Engineering

RAG and Document Search Terms

Learn the ingestion, indexing, retrieval, ranking, grounding, citation, and RAG prompt patterns used to build verifiable AI answers from trusted documents.

19 matching terms

Overview

Retrieval-augmented generation (RAG)

Retrieval-augmented generation (RAG)

Meaning

A pattern that retrieves relevant external information and supplies it to a model before generation.

When to use it

Use it when answers should rely on current, private, or domain-specific documents.

Practical example

Retrieve policy passages for the question, then answer using only those passages.

Ingestion

Chunking

Chunking

Meaning

Splitting documents into smaller units that can be indexed and retrieved.

When to use it

Choose chunk boundaries that preserve meaning while keeping retrieval focused.

Practical example

Split the handbook by section and keep each heading with its paragraphs.

Indexing

Embedding

Embedding

Meaning

A numerical vector representing semantic characteristics of text or other content.

When to use it

Use embeddings to compare semantic similarity beyond exact keyword matches.

Practical example

Create embeddings for each document chunk and for the user's query.

Indexing

Vector store

Vector store

Meaning

A system that stores embeddings and supports nearest-neighbor retrieval.

When to use it

Use it to manage semantic indexes and associated document metadata.

Practical example

Store each chunk vector with its source URL, title, and access scope.

Retrieval

Similarity search

Similarity search

Meaning

Retrieval based on how close vector representations are under a chosen distance measure.

When to use it

Use it to find passages with meaning related to the query.

Practical example

Search the vector store for passages nearest to the query embedding.

Retrieval

Retriever

Retriever

Meaning

The component that selects candidate documents or chunks for a query.

When to use it

Configure it to combine query rewriting, filters, search methods, and result limits.

Practical example

The retriever returns policy chunks the current user is allowed to access.

Retrieval

Top-k

Top-k

Meaning

The number of highest-ranked retrieval results selected for the next stage.

When to use it

Tune it to balance evidence coverage against noise and context usage.

Practical example

Retrieve top-k 8 candidates, then rerank and keep the best 4.

Retrieval

Metadata filter

Metadata filter

Meaning

A constraint that narrows retrieval by attributes such as date, product, language, or permissions.

When to use it

Use it before semantic ranking to enforce scope and access control.

Practical example

Filter to Korean documents published after 2025 that the user may view.

Retrieval

Hybrid search

Hybrid search

Meaning

A search method that combines lexical keyword signals with semantic vector signals.

When to use it

Use it when exact identifiers and conceptual similarity both matter.

Practical example

Combine BM25 keyword results with embedding similarity for error code AB-104.

Ranking

Reranking

Reranking

Meaning

A second-stage model or rule that reorders retrieved candidates for relevance.

When to use it

Use it to improve precision after collecting a broader candidate set.

Practical example

Rerank 20 candidate chunks and send the best 5 to the generator.

Grounded response

Grounding

Grounding

Meaning

Connecting a generated response to supplied or retrieved evidence.

When to use it

Use it to reduce unsupported claims and make the answer auditable.

Practical example

Answer only claims supported by the retrieved policy excerpts.

Grounded response

Citation

Citation

Meaning

A reference that identifies the source supporting a claim.

When to use it

Attach citations at the claim level so readers can verify evidence quickly.

Caution

A citation can still point to irrelevant evidence; verify that it actually supports the claim.

Practical example

Include the document title, section, and direct source link for each policy claim.

RAG prompt patterns

Query rewriting prompt

Query rewriting prompt

Meaning

An instruction that transforms a user's request into one or more queries better suited to keyword, semantic, hybrid, or filtered retrieval.

When to use it

Use it for vague, conversational, underspecified, or domain-mismatched questions while preserving the original intent.

Caution

Do not silently change the user's intent, add unsupported facts, or weaken access filters.

Practical example

Rewrite the question for hybrid search. Preserve the original intent, add likely document terminology, and return the original plus up to three rewritten queries.

RAG prompt patterns

Grounded-answer instruction

Grounded-answer instruction

Meaning

A prompt rule requiring factual claims to be supported by retrieved passages supplied to the generation step.

When to use it

Use it when answers must be auditable and unsupported model knowledge should not be presented as evidence.

Practical example

Answer the question using the supplied passages. Attach the supporting source ID to every factual claim and separate any clearly labeled inference.

RAG prompt patterns

Context-only answering

Context-only answering

Meaning

A strict generation rule that limits the answer to information explicitly supported by the supplied retrieval context.

When to use it

Use it for policies, contracts, regulated content, or other tasks where outside model knowledge must not fill gaps.

Caution

This rule cannot compensate for poor, incomplete, outdated, or unauthorized retrieval results.

Practical example

Use only <retrieved_context>. If the context does not contain the answer, return insufficient_evidence instead of using prior knowledge.

RAG prompt patterns

No-evidence response and abstention

No-evidence response and abstention

Meaning

A defined fallback response used when retrieved evidence is absent, insufficient, contradictory, or below a support threshold.

When to use it

Use it to prevent confident guessing and to route the case to clarification, another retrieval attempt, or human review.

Practical example

If no passage directly supports the answer, return status: insufficient_evidence, explain what is missing, and suggest one clarifying question.

RAG prompt patterns

Citation format instruction

Citation format instruction

Meaning

A prompt contract defining where and how source identifiers must appear in a generated answer.

When to use it

Use it to produce claim-level references that applications and reviewers can validate consistently.

Caution

Formatting a citation does not prove that the cited passage supports the claim; validate citation correctness separately.

Practical example

After each supported sentence, cite one or more retrieved IDs in [S1] format. Never invent an ID and do not cite a source that does not support the sentence.

RAG prompt patterns

Retrieved-context synthesis

Retrieved-context synthesis

Meaning

Combining complementary evidence from multiple retrieved passages into a coherent answer without erasing source boundaries.

When to use it

Use it for comparison, summary, or multi-part questions that require more than one passage.

Practical example

Group passages by subquestion, remove duplicates, preserve dates and scope, then synthesize the answer with claim-level source IDs.

RAG prompt patterns

Conflicting-source handling

Conflicting-source handling

Meaning

A prompt rule for detecting and reporting contradictions among retrieved sources instead of silently choosing one.

When to use it

Use it when documents can differ by version, date, jurisdiction, authority, or interpretation.

Caution

Recency alone does not always determine authority; encode the domain's source-priority policy outside or alongside the prompt.

Practical example

If sources conflict, list each claim with its source, version, and date; identify the conflict; apply an explicit authority rule or request review.

RAG prompt flow

Retrieval quality and generation instructions must be designed and evaluated together; a prompt cannot repair missing or unauthorized evidence.

StagePrompt responsibility
Before retrievalPreserve intent while rewriting, expanding, filtering, or decomposing the query
Context assemblyLabel source IDs, versions, dates, permissions, and passage boundaries
Answer generationLimit claims to evidence, define citation format, and specify abstention behavior
After generationValidate claim support, citation correctness, conflicts, completeness, and access compliance

Frequently asked questions

Can a strict context-only prompt guarantee a factual answer?

No. It reduces the allowed evidence scope, but the answer can still misread passages, combine incompatible sources, attach incorrect citations, or rely on poor retrieval. Validate retrieval recall, claim support, citation correctness, and abstention behavior.

When should a RAG system abstain instead of answering?

Abstain when no authorized passage directly supports the required claim, evidence is below the defined threshold, sources conflict without an authority rule, or the question is too ambiguous to retrieve safely. Return a structured reason and the next useful action.

Should a RAG prompt ask for citations?

Yes when users or downstream systems need to verify claims, but the application must preserve real source identifiers and validate that each cited passage supports the nearby claim. The model must never invent source IDs.

Official references