The user prompt is the specific request or question for this turn — where the system prompt sets standing rules, the user prompt is the actual task the model needs to act on right now.
System vs User — Division of Responsibility
| System Prompt | User Prompt | |
|---|---|---|
| Scope | Persists across the whole conversation | Specific to this one turn |
| Typical content | Persona, constraints, format rules | The actual question, task, or request |
| Who writes it | The application developer, fixed | Often the end user (or dynamically constructed with retrieved context) |
Example
system: "You are a coding assistant. Only answer Python questions.
Always include a brief explanation with code examples."
user: "How do I reverse a list in Python?"
The system prompt never changes across the conversation; each new user message is a new specific request within those standing rules.
Constructing User Prompts Dynamically
In real applications, the "user prompt" sent to the API is often not the literal text the user typed — it's typically been augmented with retrieved context (RAG), formatting instructions, or conversation history summaries before being sent:
raw_user_input = "What's the refund policy for damaged items?"
# Application constructs the actual user message sent to the API:
augmented_user_message = f"""
Context from documentation:
{retrieved_chunks}
Customer question: {raw_user_input}
Answer using only the context above.
"""
Practical Use Case
Understanding this separation is what makes RAG, conversation memory, and multi-turn applications possible — the "user prompt" the model sees is often a constructed, richer version of what the person actually typed, assembled by application code.
Common Mistakes
- Putting standing behavioral rules in every user message instead of the system prompt — wastes tokens repeating the same instructions turn after turn
- Forgetting that the "user prompt" your code sends to the API isn't always literally what the user typed — debugging issues requires inspecting the actual constructed prompt, not just the raw user input
Interview Relevance
"If a user's question isn't being answered correctly in a RAG chatbot, what would you check first?" — inspecting the actual constructed user prompt (with retrieved context) sent to the model, not just the user's raw input, is the practical first debugging step.
Practice Question
Write the code (pseudocode is fine) that constructs a user prompt combining a raw user question with 2 retrieved document chunks and a formatting instruction.