How it works

In a chat with AI, the user prompt is the text typed by the user. It joins the system prompt, system instructions, and the conversation history to form the complete context the model processes.

The quality of the user prompt directly affects the quality of the response. A clear and specific prompt tends to produce better answers. A vague or ambiguous prompt tends to produce generic or incorrect answers.

In code agents, the user prompt can be "refactor this function to use async/await" or "create tests for this module". The agent interprets that instruction, analyzes the code and executes the change.

Practical example

In a code agent, the user prompt can be "refactor this function to use async/await". The agent interprets that instruction, analyzes the code and executes the change. If the prompt is vague ("improve this code"), the result will be less precise.

In a chatbot application, the user prompt can be "summarize this article in 3 points". The model uses the system prompt, which defines tone and rules, together with the user prompt, which defines the task, to generate the response.

What it's for

Understanding the difference between user prompt and system prompt helps design more effective AI agents and applications. The user prompt defines what to do. The system prompt defines how to do it.

For developers, this means designing interfaces that capture user intent clearly. For users, it means learning to write specific prompts with enough context.

Difference between user prompt and system prompt

The system prompt defines rules, personality and general context for the model. It is configured by the developer and does not change during the conversation. The user prompt defines the specific task. It is sent by the user on each interaction.

In LLM APIs, the system prompt goes in the "system" field and the user prompt goes in the "user" field. Some models do not differentiate the two and treat everything as a single text sequence.