Retrieval-augmented generation RAG
A pattern where relevant documents are fetched first and pasted into the prompt, so the model answers from your data rather than its training.
RAG splits the problem in two. A retrieval step finds passages relevant to the question, usually by comparing embeddings in a vector-database. A generation step hands those passages to the model along with the question and asks it to answer from them.
The appeal is that it needs no training. Your documents can change hourly, the model stays the same, and answers can cite the passage they came from, which makes them checkable.
Most RAG systems fail at retrieval, not generation. If the right passage is not fetched, no prompt saves the answer. Chunk size, how documents are split, and whether keyword search runs alongside vector search matter more than which model writes the final text.
Tagged
Where this comes up
Prompts, configs and tutorials in the library that touch this term.
- GuideUniversal
Working with long documents and code
Why long sessions drift, what a large context window actually buys you, and how to keep a model on task across a big input.
- GuideUniversal
Giving a model a role and constraints
How naming the audience, the format and the exclusions turns unpredictable answers into repeatable ones.
No-padding everyday default
The one to set if you set only one. Answer first, nothing before it, nothing after it, and no offer to help further.
Tested on Claude Sonnet · May 2026
- CheatsheetUniversal
Forcing an output format that holds
The phrasings that actually constrain output, and the ones people use that do not. Tested by asking for the same thing twenty times and counting the…
Tested on Claude Sonnet · May 2026
- PromptUniversal
Extract structured data as JSON
A strict extraction prompt that returns valid JSON only, with nulls for missing fields instead of invented values.
- PromptMidjourneyStable Diffusion
Image prompt skeleton
A fill-in structure for image models that keeps subject, environment, light, lens and style in the order the models weight them.