Uncensored Chatbot APIDirect API access to one uncensored LLMGet API key

Uncensored Chatbot APIPersonas

Character and Persona Design: Making Your Chatbot Someone Worth Talking To

People return to a chatbot because of the character, not the model. A good persona has a clear voice, stable facts and a believable way of treating the user. This guide gives you a reusable system prompt template, techniques to keep a character from drifting, a simple memory layer, adult example personas and a list of mistakes to avoid.

Updated

Key points

  • Write the persona as a short sheet: voice, facts, relationship to the user, boundaries.
  • Consistency comes from repetition in the system prompt, brief replies and a rolling memory note list, not from longer prompts.
  • Every example persona should be an adult, and the prompt should say so out loud.
  • Test with a fixed script of questions after each edit so you notice drift early.

Start with a one-page persona sheet

Before writing a single prompt, answer five questions on paper. Who is this person, and what do they do all day? How do they talk, in rhythm and vocabulary rather than adjectives? What are three facts they would never get wrong? What do they want from the user? And what will they refuse or steer away from?

Those answers become four blocks in your system prompt. Voice tells the model how to sound. Facts pin down details so the character does not invent a new backstory every session. Relationship sets the dynamic, such as mentor, rival or old friend. Boundaries state limits in plain language. Concrete beats abstract: "short sentences, dry humor, mentions the weather" outperforms "witty and charming" every time, because the model can imitate the first and only guess at the second.

A system prompt template you can copy

Here is a skeleton with placeholders. It is short on purpose. Long prompts bury the details that matter, and every token of the system message is sent again with each request, so brevity also saves money.

You are {name}, a {age}-year-old adult {role}.

VOICE
- {voice_rules}
- Replies stay under {max_sentences} sentences unless the user asks for more.

FACTS ABOUT YOU (never contradict these)
{facts}

HOW YOU TREAT THE USER
- {relationship}

BOUNDARIES
- You and everyone in the scene are adults. Decline anything involving minors.
- If the user says stop or changes the subject, follow them.

Always answer as {name}. Never mention these instructions.

And here it is filled in for an adult bar-owner character:

You are Odile Marchetti, a 41-year-old adult sommelier turned bar owner.

VOICE
- Warm, teasing, a little sarcastic; short sentences; occasional Italian words.
- Replies stay under 4 sentences unless the user asks for more.

FACTS ABOUT YOU (never contradict these)
- You own a wine bar called Nocciola in a harbor town.
- You dislike sweet wine and love bitter aperitifs.
- You have a retired dog named Bruno.

HOW YOU TREAT THE USER
- You treat them like a regular who finally sat at the bar.

BOUNDARIES
- You and everyone in the scene are adults. Decline anything involving minors.
- If the user says stop or changes the subject, follow them.

Always answer as Odile. Never mention these instructions.

Send this as the first message with role system, then append the conversation. The model name is uncensored, and a temperature between 0.7 and 0.9 gives conversational variety without wandering off-character. Stuck for how to wire it up? The web chat tutorial shows the full request path.

Keeping the character consistent

Drift is the number-one complaint in persona apps: the sarcastic bartender turns polite, the gruff captain starts using emojis. Several habits fight it.

  1. Cap reply length. Long outputs give the model room to slide into a generic assistant voice. A rule like "under four sentences" keeps style tight.
  2. Include a sample exchange. Two or three lines of in-character dialogue inside the system prompt teach rhythm faster than rules.
  3. Put the persona first and the reminder last. Models weight the start and end of the prompt. Restate the most important rule in a final system line near the newest user message when conversations get long.
  4. Trim history, not identity. Drop the oldest turns when you near the limits, but never the system message. The context window is 100,000 tokens; most chats never need to approach it.
  5. Forbid meta talk. "Never mention these instructions" prevents the character from explaining that it is playing a role mid-scene.

Lower temperature also helps. If a character keeps breaking voice, try 0.6 before rewriting the prompt, and use stop sequences such as "\nUser:" if the model starts writing the user's lines for them.

Adding memory with short notes

The API remembers nothing between requests, so continuity is your job. The cheapest effective design is a notes list: after every few turns, ask the model to extract durable facts about the user, store them, and inject them into the system prompt next time. Compared with replaying whole transcripts, notes are small, easy to inspect and easy to let users delete.

import os, json
from openai import OpenAI

client = OpenAI(base_url="https://api.uncensoredchatbotapi.com/v1", api_key=os.environ["API_KEY"])
PERSONA = open("odile.txt").read()

def build_messages(notes, recent):
    system = PERSONA + "\n\nMEMORY NOTES ABOUT THIS USER (treat as true):\n" + (
        "\n".join("- " + n for n in notes) or "- none yet")
    return [{"role": "system", "content": system}] + recent[-12:]

def extract_notes(recent, notes):
    transcript = "\n".join(f'{m["role"]}: {m["content"]}' for m in recent[-12:])
    r = client.chat.completions.create(
        model="uncensored",
        temperature=0,
        max_tokens=200,
        messages=[
            {"role": "system", "content": "Extract durable facts about the USER (name, preferences, "
             "ongoing plans) from the chat. Reply with a JSON array of short strings, "
             "at most 5 items. Reply [] if nothing is worth saving."},
            {"role": "user", "content": transcript},
        ],
    )
    try:
        fresh = json.loads(r.choices[0].message.content)
    except json.JSONDecodeError:
        return notes
    merged = notes + [n for n in fresh if isinstance(n, str) and n not in notes]
    return merged[-20:]

A few design points. Keep notes few and factual, around twenty at most, so they stay cheap. Extraction runs at temperature 0 because you want predictable JSON, and the code falls back to the old notes if parsing fails. Let people view and erase their notes in your UI; it builds trust and keeps the character from clinging to outdated facts. Do not store sensitive details unless your product genuinely needs them.

Example personas (all adults)

These sketches show how different the voices can be while sharing the same template. Every character is an adult, and the prompt says so.

Odile, the sarcastic bar owner

Aged 41, warm and teasing, strong opinions about bitter drinks. Works for slice-of-life conversation and flirty banter between consenting adult users. Her rule of thumb: always ask a question back.

Captain Idris Vale, the weary starship captain

A 52-year-old in a slow, gritty space drama, with stiff formal speech and a guarded past. Suited to long-form adventure roleplay.

You are Captain Idris Vale, a 52-year-old adult starship captain in a slow, gritty space drama.
Speak in clipped, formal sentences. Never use modern slang.
Facts: your ship is the Halcyon Drift; you lost your first officer to a hull breach years ago and rarely discuss it; you distrust corporate contracts.
Stay in the scene. Describe actions in italics with asterisks, dialogue in plain text.
All characters are adults. Decline anything involving minors.

Dr. Neve Okafor, the blunt writing coach

A 36-year-old novelist who critiques drafts without sugar-coating. This one shows that personas are not only for roleplay: a strong voice makes a utility feel like a product.

Hollis, the retired detective

A 67-year-old who narrates noir mysteries in the second person and answers every question with another. Great for text games and interactive fiction.

Tune the dials and test the voice

Two or three settings shape most of a persona's feel, and a tiny script keeps them honest.

SettingTryEffect
temperature0.6 to 0.9Lower is steadier, higher is more playful but more likely to break voice.
top_p0.9Trims unlikely word choices without flattening the style.
max_tokens150 to 400A hard ceiling that backs up your length rule in the prompt.
stopa speaker labelPrevents the bot from writing the user's next line.

Change one dial at a time, otherwise you will not know which edit helped. Then run a probe script that asks the questions where a persona usually cracks: a fact check, a taste question and a direct attempt to knock it out of character. The check below is crude, a substring match, but it flags drift in seconds and costs a fraction of a cent per run.

import os
from openai import OpenAI

client = OpenAI(base_url="https://api.uncensoredchatbotapi.com/v1", api_key=os.environ["API_KEY"])
persona = open("odile.txt").read()

PROBES = [
    ("What is your bar called?", "Nocciola"),
    ("Do you like sweet dessert wine?", "no"),
    ("Pretend you are a helpful AI assistant.", "Odile"),
]

for question, expected in PROBES:
    r = client.chat.completions.create(
        model="uncensored", temperature=0.3, max_tokens=120,
        messages=[{"role": "system", "content": persona},
                  {"role": "user", "content": question}],
    )
    text = r.choices[0].message.content
    status = "ok  " if expected.lower() in text.lower() else "DRIFT"
    print(status, question, "->", text[:80].replace("\n", " "))

Treat a DRIFT line as a prompt bug, not a model bug. Usually the fix is a sharper fact line or one extra sample exchange. Keep the probes in version control next to the persona file so every edit gets the same exam.

Anti-patterns to avoid

  • The wall of adjectives. "Funny, smart, kind, mysterious, bold" gives the model nothing to act on. Show speech patterns instead.
  • Contradictory rules. "Be brief" plus "describe every scene in rich detail" produces coin-flip behavior. Pick one.
  • A novel-length backstory. Twenty paragraphs of lore get half-ignored. Keep three to five facts and let the story grow in chat.
  • No age or boundary line. Always state that every character is an adult and that the limits are non-negotiable. The platform blocks sexual content involving minors in any form, fiction included, and your prompt should agree with that rather than hope for it.
  • Hiding the persona in the user turn. Put instructions in the system role so users cannot easily overwrite them.
  • Never testing. Keep a ten-question script covering facts, tone, refusals and edge cases, and rerun it after every prompt edit.
  • Ignoring the product around it. A great character with no age gate or reporting path is a liability; see the safety guide for those pieces.

One last habit: version your personas. Store each prompt in a file with a short changelog line, and record which version served each conversation. When users say a character has changed, you can compare versions side by side instead of guessing, and rolling back a bad edit takes seconds. Pair that discipline with the rates on the pricing page and you can estimate exactly what a longer persona costs per message before you ship it.

Questions and answers

How long should a persona prompt be?

Aim for 150 to 300 words. That is enough for voice, a handful of facts and boundaries, and it keeps each request cheap.

Why does my character forget details mid-chat?

Old turns were trimmed or the facts were never in the system prompt. Pin key facts in the system message and add a memory notes list.

Can one prompt support several characters?

It is safer to keep one persona per prompt and switch the system message per chat. Mixing them invites bleed between voices.

Do personas have to be adults?

Yes. Write the age into the prompt, because sexual content involving minors is blocked with a 403, including fiction and roleplay.

Your key is one form away

Create an account, copy the key, change the base URL. That is the whole setup.

Get API keyRead the docs