Skip to main content

System Prompt Configuration

Overview​

This chapter is a practical guide for creating clear and reliable system prompts for agents used in everyday work. First, it focuses on short templates and checklists so you can understand what to write.

  • Helps you prepare prompts that fit your purpose in less time.
  • Reduces variability in output and produces stable responses.
  • Helps you run an improvement cycle in operations (test → evaluate → refine).

Start with the minimal template below. Once you get used to it, add constraints and examples little by little.

Summary Template

You are a [role].
Goal: {Write the desired outcome in one sentence here}
Output format: {e.g., Markdown headings + bullet points / JSON with keys:..., ...}
Constraints: {e.g., Rewrite technical terms in plain language. Under 400 characters.}
Input example: {Write one simple sample}

Example:

You are a professional editor.
Goal: Summarize the given text in 300 characters or less.
Output format: A single paragraph in Markdown (no heading).
Constraints: Keep proper nouns as-is; replace technical terms with plain language.
Input example: {body text}

Key Points When Creating One​

  • Write the "role" and "goal" in one line first. This alone greatly stabilizes behavior.
  • Make the output format specific (e.g. "JSON with keys: title, summary"). Explicit structure makes post-processing easier.
  • Put long constraints in external documentation and reference them; keep the main prompt short.
  • Always test with about 10 real examples before rollout.

Checklist​

  • The goal is clear in one sentence.
  • The output format is clearly defined (e.g. JSON schema).
  • Test data (normal cases and edge cases) is prepared.
  • A mechanism exists to store execution logs (input + output).
  • The prompt is managed with a version name.

Simple Evaluation Method​

  1. Format check: Automatically determine whether the output matches the specified format (JSON, etc.).
  2. Sample check: Have a person judge "satisfactory / unsatisfactory" for 10 representative cases, then calculate the satisfaction rate.
  3. Cost check: Record tokens consumed during testing and compare them with the expected cost.

Target example: 100% format pass rate, satisfaction rate ≥ 80%.


Common Pitfalls​

  • Instructions are vague: Adding concrete examples (input and expected output) helps improve results.
  • Making it too long because you want to "write everything": Keep the main prompt short and put details elsewhere.
  • Including sensitive information directly: Mask it if necessary before passing it in.
  • Behavior changes after model updates: Re-evaluate regularly.

Example System Prompts​

Classification (inquiries)​

You are a customer support classifier.
Goal: Classify inquiries as "Urgent / Normal / Low priority."
Output format: JSON {"category":"urgent|normal|low"}
Constraints: Include a one-sentence reason for the judgment.

Structured Extraction (entity resolution)​

You are a data extraction engine.
Goal: Extract names and email addresses from the text.
Output format: JSON array [{"name":..., "email":...}]

Operational Tips for Real Use​

  • Make changes small: Do not change too much at once; repeat improvement → evaluation one item at a time.
  • Accumulate error patterns: Add common failure examples to the template.
  • Prepare a fallback: Build a mechanism to retry with another prompt if the output is unexpected.
  • Always keep version control and the reason for each change.

このページは役に立ちましたか?