Which of the following content types belong in the SYSTEM message (not the user message) in a production chat-style prompt?
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
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.
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.
What an interviewer would ask next. Try answering before peeking at the approach.
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.