563
Prompt

RAG Answer With Strict Citations

Force the LLM to answer only from provided chunks and cite them by ID.

1 min readupdated 2026-06-22

/ quick answer

The core of any RAG system. Prevents hallucination by making the model refuse when chunks don't contain the answer. Force the LLM to answer only from provided chunks and cite them by ID.

Force the LLM to answer only from provided chunks and cite them by ID. The core of any RAG system. Prevents hallucination by making the model refuse when chunks don't contain the answer. Copy the prompt below, swap the bracketed variables for your own context, and run it in any capable model. This prompt node is part of the Onexial knowledge graph and links to related concepts, workflows and tools below.
Context
The core of any RAG system. Prevents hallucination by making the model refuse when chunks don't contain the answer.
Prompt
You are a Q&A assistant. Answer the USER_QUESTION using ONLY the CHUNKS below.

Hard rules:
- Cite every claim with [chunk_id].
- If CHUNKS do not contain the answer, respond exactly: "I don't have enough information in the provided sources."
- Do not use outside knowledge. Do not guess.
- Keep the answer under 150 words unless the question asks for detail.

USER_QUESTION: {{question}}

CHUNKS:
{{chunks_with_ids}}
Example Output
RAG is Retrieval-Augmented Generation, a pattern that grounds an LLM in your own data by retrieving relevant chunks and passing them into the prompt [c_014]. It reduces hallucinations because the model quotes from provided context rather than parametric memory [c_017]. Trade-off: retrieval quality caps answer quality — bad chunks give bad answers [c_022].
Related Workflow
Related Tool Stacks
/ frequently asked

What does the RAG Answer With Strict Citations prompt do?

The core of any RAG system. Prevents hallucination by making the model refuse when chunks don't contain the answer.

Which AI models work with this prompt?

It is model-agnostic: it works with any capable general model. Replace the bracketed variables with your own context before running it.

What output should I expect?

RAG is Retrieval-Augmented Generation, a pattern that grounds an LLM in your own data by retrieving relevant chunks and passing them into the prompt [c_014]. It reduces hallucinations because the model quotes from provided context rather than parametric memory [c_017]. Trade-off: retrieval quality c.

/ continue exploring

Related concepts

The vocabulary this page depends on.

all dictionary

Related workflows

Turn this into a repeatable process.

all workflows

Related tool stacks

The tools that run it in production.

  • RAG Starter Stack

    Minimum viable stack to ship a production RAG chatbot.

  • AI Support Agent Stack

    Tier-1 support handled by an AI agent grounded on your docs, with human handoff.

  • RAG Context Enrichment Stack

    A technical stack designed to enrich the contextual data provided to a Retrieval Augmented Generation (RAG) system, improving the quality and depth of LLM responses.

  • Low-Cost RAG Stack

    This stack combines open-source and cost-efficient components to build a Retrieval-Augmented Generation (RAG) system with minimized operational expenses.

all tool stacks

Related prompts

Reusable prompts for this job.

all prompts

Comparisons & alternatives

Pick between the options.

all comparisons