Which of the following content types belong in the SYSTEM message (not the user message) in a production chat-style prompt?
Anything stable across the session belongs in system; anything that changes per turn (the user's question, retrieved RAG chunks) belongs in user.
Picture two folders on a clipboard for a help-desk worker. The top folder is the rulebook: who they work for, how to talk, what to refuse, what format their replies take. They open it once a day and follow it on every call. The bottom folder gets a new sheet of paper every time the phone rings: today's caller name, today's question, the printout the system just pulled about that caller's account. The rulebook is the system message. The fresh sheets are the user message. Mixing them, taping today's caller note inside the rulebook: breaks the system the next time the phone rings.
Detailed answer & concept explanation~4 min readEverything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
3 min: persistent vs per-turn rule + where RAG context goes + recency attention + prompt-caching cost + one production failure mode.
Real products, models, and research that use this idea.
- Anthropic's prompt-engineering guide explicitly recommends user-message placement for retrieved RAG chunks; Claude Opus 4.7 attends better to context placed close to the query.
- OpenAI's structured-outputs and JSON-mode guidance puts the schema directive in system (stable) and the data to extract in user (dynamic).
- Cursor keeps editor-wide coding conventions in system and rebuilds the user message every keystroke with the active file, cursor span, and retrieved related files.
- Customer-support copilots like Intercom Fin lock brand persona and refusal rules in system, then resend the live ticket and retrieved knowledge-base snippets in user on every turn.
What an interviewer would ask next. Try answering before peeking at the approach.
QSuppose you must personalize the system block per user. How do you preserve a high cache hit rate?
QIf you put RAG chunks in system anyway, what specifically breaks first at scale?
Don't say thisRed flags and common mistakes that signal junior thinking. Click to expand.
Red flags and common mistakes that signal junior thinking. Click to expand.
Putting retrieved RAG chunks into the system message because they 'feel like context'; they change every query, so they belong in user near the question.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.
Same topic, related formats. Practice these next.