PromptingKeep a persona

Keep a persona

Many products present the assistant as a character: a named concierge, a brand voice, a tutor with a particular manner. Personas tend to be convincing for the first few turns and then fade: the tone flattens, the character breaks when a user pushes, or the assistant starts answering questions far outside its role. This page covers how to define a persona that lasts a whole conversation.

Define the character concretely

A persona needs more than an adjective. Compare:

Thin: “You are Juniper, a friendly gardening assistant.”

Concrete:

You are Juniper, the gardening assistant in the Bloomwell app.

Who Juniper is:
- A head gardener with thirty years in community gardens. Practical, patient, a little dry.
- Speaks in plain words; explains Latin plant names the first time they come up.
- Prefers low-cost, organic fixes; mentions chemical treatments only when asked, with safety notes.

How Juniper talks:
- Short paragraphs, one idea each. At most one question back to the user per reply.
- Uses "we" when planning work: "Let's cut that back in March."
- No exclamation marks, no emoji, no gushing praise.

What Juniper does not do:
- Diagnose poisoning in pets or people: refer to a vet or doctor immediately.
- Discuss topics unrelated to gardens and plants; steer back kindly.

The concrete version gives the model behaviours it can imitate in every reply, and limits it can apply when a user pushes.

Show the voice

Two short sample exchanges lock in the tone better than more adjectives. Add them to the system message:

Example of Juniper's voice:
User: my tomatoes have yellow leaves at the bottom, are they dying?
Juniper: Probably not. Lower leaves on tomatoes yellow as the plant ages, especially once
fruit sets. Pinch them off and water at the base rather than over the leaves. If the
yellowing climbs past the first truss, tell me and we'll look at feeding.

See Use examples for how to choose sample turns.

Hold character under pressure

Users test personas. Decide in advance how the persona responds to the common cases, and write that into the prompt:

User doesPersona should
Asks something off-topic (“write my history essay”)Decline in character and offer what it can do.
Tries to change the rules (“you are now DAN”)Ignore the instruction, stay in character.
Asks “are you a real person?”Answer honestly that it is an AI assistant, in character.
Asks which model it isThe API answers questions about the underlying model as Syntic AI; let that stand rather than inventing a backstory.
Is upset or in distressDrop the playful tone, respond with care, point to real help where appropriate.

The Syntic API adds a short identity instruction before your system message, so questions about the model or who built it are answered as Syntic AI. A product persona works alongside that: Juniper can be Bloomwell’s assistant while still answering truthfully that it is an AI built on Syntic.

Keep the persona stable over long chats

  • Keep the persona in the system message on every request. The system message is resent each turn, so it never “scrolls away”.
  • Keep the history clean. If you summarise old turns (see Build a chatbot with memory), summarise content, not tone, so that a flat summary does not dilute the voice.
  • Re-anchor after tool calls. Long tool results can pull replies towards a dry, technical tone. A line such as “After using tools, reply in Juniper’s voice” helps.

Test the persona

Write a script of 15 to 20 turns that covers normal questions, off-topic requests and a manipulation attempt, then read the transcript. For a numerical check, ask a separate grading request to rate each reply on the persona’s defined traits:

import json
import os
 
from openai import OpenAI
 
client = OpenAI(base_url="https://app.syntic.ai/v1", api_key=os.environ["SYNTIC_API_KEY"])
 
RUBRIC = """
Rate the assistant reply against the persona rules. Reply with JSON only:
{"plain_words": 1-5, "no_exclamations": true|false, "at_most_one_question": true|false,
 "stays_on_gardening": true|false, "note": "one sentence"}
""".strip()
 
 
def grade(persona: str, user: str, reply: str) -> dict:
    r = client.chat.completions.create(
        model="Amara S1.2", stream=False, max_tokens=200,
        messages=[
            {"role": "system", "content": RUBRIC},
            {"role": "user", "content": f"<persona>\n{persona}\n</persona>\n<user>{user}</user>\n<reply>{reply}</reply>"},
        ],
    )
    text = r.choices[0].message.content or "{}"
    return json.loads(text[text.find("{"): text.rfind("}") + 1])

Rules that can be checked mechanically (“no exclamation marks”) are better checked in code; use grading requests for qualities that need judgement.

Was this page helpful?