Skip to main content
AI Chatbots

Recommendations for creating prompts

When communicating with a large language model, English is better understood. To get better response results, it is recommended to write the prompt in English, providing examples in the original language where necessary.

1. Core Pieces of a Prompt

System / Role

Tell the AI what it is and what it does. Keep personality (tone) separate from formatting rules.

Good: You are a data cleaner that outputs JSON only.

Bad: You are a funny assistant who tells jokes and cleans data. (Too many jobs!)


Task (One Sentence)

Write each task in a separate sentence, keeping it as brief and simple as possible.

Good: Summarize the text into 5 bullet points.

Bad: Summarize the text and also make suggestions for improvement.


Audience & Tone

Specify who will read the answer and how it should sound.

Example:

  • Audience: busy managers
  • Tone: concise, neutral

Output Rules

This is the contract. Be strict.

  • Allowed formats: JSON, CSV, or Markdown — nothing else
  • Handle missing data (null), units, and special characters
  • Provide a schema (fields, types, required vs optional)
  • Ban extra comments or fields

Algorithm (Steps)

Tell the AI exactly what to do, in order.

Example: Read → Clean → Generate → Validate → Fix if invalid


Inputs

List the values you’ll provide.

Example: title, body, date


Examples

Always give two: one good, one bad. You can include several examples.

Good: Correct format + schema followed

Bad: Wrong format, missing fields, extra fields


Edge Cases

Specify what to do when inputs are unusual.

  • Empty input
  • Very long text
  • Special symbols (€, %, emojis)

Self-Check

A small checklist for the AI at the end.

Example:

  • Did I follow the schema?
  • Did I use markers?
  • Did I add no extra fields?

2. A Simple Prompt Template

Here’s a “fill-in-the-blanks” template. Replace the ALL-CAPS words.

## SYSTEM / ROLE
You are a ROLE that does ONE THING WELL. Stay within scope.

## TASK
TASK: ONE CLEAR SENTENCE DESCRIBING THE JOB.

## AUDIENCE & TONE
Audience: WHO WILL READ THIS.
Tone: e.g., concise, neutral.

## OUTPUT RULES
- [START EACH RESPONSE WITH A SMILING EMOJI 😊]
- [UNITS: USE SI UNITS; INCLUDE THE UNIT WHERE IT IS ESSENTIAL]
- [KEEP EMOJIS]

## ALGORITHM
[READ THE INPUT]
[EXTRACT KEY FACTS]
[CREATE A SUMMARY]
[GENERATE A REPLY]
[CORRECT GRAMMAR AND FLUENCY]
[ADD AN EXTRA QUESTION TO ENCOURAGE FURTHER CONVERSATION]

## EXAMPLES
GOOD EXAMPLE:
[-QUESTION: ‘DO YOU HAVE RHUBARB ICE CREAM?’
-ANSWER: ‘WE CURRENTLY DON’T HAVE RHUBARB ICE CREAM IN OUR ASSORTMENT. MAY I OFFER YOU SOMETHING ELSE?’]
BAD EXAMPLE:
[-QUESTION: ‘DO YOU HAVE RHUBARB ICE CREAM?’
-ANSWER: ‘NO.’]

3. Edge Cases

If necessary, the prompt can specify the expected behavior when the retrieved data — most commonly in prompts that process incoming information from an API — is in an atypical format. For example:

  • Empty input → return valid JSON with title: "Unknown", summary: "", bullets: [], word_count: 0.
  • Long text → summarize first, then follow schema.
  • Symbols/emoji → keep them; escape quotes for JSON.

4. Using Variables (#variable#)

Sometimes a prompt requires values that are stored in context and previously retrieved from a scenario or an API. To reference the required information, context variables can be defined using the following format: #variable#. When the prompt is executed, these variables are automatically replaced with actual values. (All variables are visible in the conversation analysis context window.)

  • Examples of how a defined variable is replaced in the prompt in specific cases:
    • #user_city# → Rīga
    • #today# → 2025-09-29
    • #selected_card_number# → INSURANCE-12345

Example With Variables

## SYSTEM / ROLE
You are a benefits explainer for health insurance. Output JSON only.

## TASK
Summarize coverage for the user’s selected card and requested service.

## OUTPUT RULES
- JSON only between markers.
===BEGIN_JSON===
===END_JSON===
- Missing → null.
- Schema:
{
"user_city": "string | null (required)",
"service": "string (required)",
"card_number": "string | null (required)",
"is_covered": "boolean | null (required)",
"coverage_note": "string (required)"
}

## INPUTS
- user_city: #user_city#
- service: #service_name#
- card_number: #selected_card_number#
- context_date: #today#

## EXAMPLES
Good
===BEGIN_JSON===
{
"user_city": "Rīga",
"service": "Ultrasonogrāfija",
"card_number": "INSURANCE-12345",
"is_covered": true,
"coverage_note": "Service is covered 50% up to EUR 50 per period."
}
===END_JSON===

Bad
(Unresolved variables + extra field)
===BEGIN_JSON===
{
"user_city": "#user_city#",
"service": "Ultrasonogrāfija",
"card_number": null,
"is_covered": "yes",
"note": "looks fine" // extra field not allowed
}
===END_JSON===

5. Quick Checklist

To ensure that all essential elements are included in the prompt, the checklist outlines the key aspects that prompt designers should consider. It helps confirm that the prompt is clear, well-structured, technically sound, and suitable for effective interaction with the AI.

  • One clear task only
  • Audience + tone defined
  • Output format locked (JSON/CSV/Markdown/plain text)
  • Start/end markers included
  • Schema listed (types + required)
  • Steps listed (algorithm)
  • Good + bad examples included
  • Edge cases covered
  • Variables resolved → no #placeholders# left

Read more: Knowledge test, prompt