456
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.