{"id":5418,"date":"2026-02-16T09:41:39","date_gmt":"2026-02-16T15:41:39","guid":{"rendered":"https:\/\/ykim.synology.me\/wordpress\/?p=5418"},"modified":"2026-02-16T09:41:48","modified_gmt":"2026-02-16T15:41:48","slug":"system-prompt-user-prompt-and-assistant-prompt","status":"publish","type":"post","link":"https:\/\/ykim.synology.me\/wordpress\/system-prompt-user-prompt-and-assistant-prompt-5418\/","title":{"rendered":"System Prompt, User Prompt, and Assistant Prompt"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">[Gemini]<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Understanding AI Prompt Roles: System, User, and Assistant<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">To create effective and reusable AI prompts, it is essential to understand the three primary &#8220;roles&#8221; in a Chat Completion API. Think of it as a script for a play where each participant has a specific job.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">1. System Prompt (The Architect)<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The <strong>System Prompt<\/strong> sets the stage. It defines the AI&#8217;s persona, boundaries, behavioral rules, and the &#8220;tone&#8221; of the conversation. It is the foundational layer that the AI refers to throughout the entire session.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Goal:<\/strong> Establish &#8220;who&#8221; the AI is and &#8220;how&#8221; it must behave.<\/li>\n\n\n\n<li><strong>Usage:<\/strong> Define constraints, output formats, and personality.<\/li>\n\n\n\n<li><strong>Your Example:<\/strong> The instructions you provided (&#8220;You are a data processor\u2026&#8221;) are a classic System Prompt.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">2. User Prompt (The Client)<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The <strong>User Prompt<\/strong> is the specific request or input from the human. It provides the &#8220;what&#8221;\u2014the actual task or question that needs to be addressed right now.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Goal:<\/strong> Provide the data, question, or instruction for the current turn.<\/li>\n\n\n\n<li><strong>Usage:<\/strong> Ask questions or provide the raw text\/data to be processed.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">3. Assistant Prompt (The Example)<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The <strong>Assistant Prompt<\/strong> represents the AI&#8217;s previous responses. In &#8220;few-shot prompting,&#8221; you can manually write Assistant prompts to show the AI exactly how you want it to respond.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Goal:<\/strong> Provide &#8220;gold standard&#8221; examples of the desired output.<\/li>\n\n\n\n<li><strong>Usage:<\/strong> Pattern matching. By showing a mock Assistant response, the AI learns the expected style better than through instructions alone.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">Comparison Table<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th class=\"has-text-align-left\" data-align=\"left\">Role<\/th><th class=\"has-text-align-left\" data-align=\"left\">Responsibility<\/th><th class=\"has-text-align-left\" data-align=\"left\">Analogy<\/th><\/tr><\/thead><tbody><tr><td class=\"has-text-align-left\" data-align=\"left\"><strong>System<\/strong><\/td><td class=\"has-text-align-left\" data-align=\"left\">Rules, Tone, Constraints<\/td><td class=\"has-text-align-left\" data-align=\"left\">The Employee Handbook<\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\"><strong>User<\/strong><\/td><td class=\"has-text-align-left\" data-align=\"left\">Task, Data, Query<\/td><td class=\"has-text-align-left\" data-align=\"left\">The Customer&#8217;s Order<\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\"><strong>Assistant<\/strong><\/td><td class=\"has-text-align-left\" data-align=\"left\">Previous Answers, Examples<\/td><td class=\"has-text-align-left\" data-align=\"left\">The Sample Product<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">How to Use Them (Technical Implementation)<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">When using these in a reusable format (like JSON for an API), it looks like this:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#24292e;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#24292e;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>&#091;\n  {\n    \"role\": \"system\",\n    \"content\": \"You are a data processor. Output ONLY markdown code blocks. Language: English.\"\n  },\n  {\n    \"role\": \"user\",\n    \"content\": \"Process this: Name: John, Age: 30\"\n  },\n  {\n    \"role\": \"assistant\",\n    \"content\": \"json\\n{\\n \\\"name\\\": \\\"John\\\",\\n \\\"age\\\": 30\\n}\\n```\"\n  },\n  {\n    \"role\": \"user\",\n    \"content\": \"Process this: Name: Sarah, Age: 25\"\n  }\n&#093;<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki github-light\" style=\"background-color: #fff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #24292E\">&#091;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">  {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    <\/span><span style=\"color: #005CC5\">&quot;role&quot;<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">&quot;system&quot;<\/span><span style=\"color: #24292E\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    <\/span><span style=\"color: #005CC5\">&quot;content&quot;<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">&quot;You are a data processor. Output ONLY markdown code blocks. Language: English.&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">  },<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">  {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    <\/span><span style=\"color: #005CC5\">&quot;role&quot;<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">&quot;user&quot;<\/span><span style=\"color: #24292E\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    <\/span><span style=\"color: #005CC5\">&quot;content&quot;<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">&quot;Process this: Name: John, Age: 30&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">  },<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">  {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    <\/span><span style=\"color: #005CC5\">&quot;role&quot;<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">&quot;assistant&quot;<\/span><span style=\"color: #24292E\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    <\/span><span style=\"color: #005CC5\">&quot;content&quot;<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">&quot;json<\/span><span style=\"color: #005CC5\">\\n<\/span><span style=\"color: #032F62\">{<\/span><span style=\"color: #005CC5\">\\n<\/span><span style=\"color: #032F62\"> <\/span><span style=\"color: #005CC5\">\\&quot;<\/span><span style=\"color: #032F62\">name<\/span><span style=\"color: #005CC5\">\\&quot;<\/span><span style=\"color: #032F62\">: <\/span><span style=\"color: #005CC5\">\\&quot;<\/span><span style=\"color: #032F62\">John<\/span><span style=\"color: #005CC5\">\\&quot;<\/span><span style=\"color: #032F62\">,<\/span><span style=\"color: #005CC5\">\\n<\/span><span style=\"color: #032F62\"> <\/span><span style=\"color: #005CC5\">\\&quot;<\/span><span style=\"color: #032F62\">age<\/span><span style=\"color: #005CC5\">\\&quot;<\/span><span style=\"color: #032F62\">: 30<\/span><span style=\"color: #005CC5\">\\n<\/span><span style=\"color: #032F62\">}<\/span><span style=\"color: #005CC5\">\\n<\/span><span style=\"color: #032F62\">```&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">  },<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">  {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    <\/span><span style=\"color: #005CC5\">&quot;role&quot;<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">&quot;user&quot;<\/span><span style=\"color: #24292E\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    <\/span><span style=\"color: #005CC5\">&quot;content&quot;<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">&quot;Process this: Name: Sarah, Age: 25&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">  }<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">&#093;<\/span><\/span><\/code><\/pre><\/div>\n<div style='text-align:center' class='yasr-auto-insert-overall'><\/div><div style='text-align:center' class='yasr-auto-insert-visitor'><\/div>","protected":false},"excerpt":{"rendered":"<p>[Gemini] Understanding AI Prompt Roles: System, User, and Assistant To create effective and reusable AI prompts, it is essential to understand the three primary &#8220;roles&#8221; in a Chat Completion API. Think of it as a script for a play where each participant has a specific job. 1. System Prompt (The Architect) The System Prompt sets&#8230;<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"_kadence_starter_templates_imported_post":false,"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","yasr_overall_rating":0,"yasr_post_is_review":"","yasr_auto_insert_disabled":"","yasr_review_type":"","fifu_image_url":"","fifu_image_alt":"","iawp_total_views":0,"footnotes":""},"categories":[10,291],"tags":[],"class_list":["post-5418","post","type-post","status-publish","format-standard","hentry","category-software-slug","category-ai-prompt-slug"],"yasr_visitor_votes":{"stars_attributes":{"read_only":false,"span_bottom":false},"number_of_votes":0,"sum_votes":0},"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/posts\/5418","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/comments?post=5418"}],"version-history":[{"count":1,"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/posts\/5418\/revisions"}],"predecessor-version":[{"id":5419,"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/posts\/5418\/revisions\/5419"}],"wp:attachment":[{"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/media?parent=5418"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/categories?post=5418"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/tags?post=5418"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}