How to Build a Free Roleplay AI Chatbot That Stays in Character

Piotr Grudzień profile picture Piotr Grudzień
on September 3, 2026 15 min read
A chat where a visitor asks an AI roleplay character whether it is an AI, and the character answers in character

A roleplay AI chatbot is an AI agent that plays a fictional character: it answers as the character, keeps the character’s voice, and knows the character’s world. The connect-it part is easy. The interesting problems are the two that show up ten minutes in: the character breaks the fourth wall the moment someone asks “are you an AI?”, and it invents a different version of its world in every conversation.

This post builds a roleplay character on Quickchat AI for real, on the free plan, and fixes both problems, with screenshots of the actual failures and the actual fixes. The demo character is Bryn Emberhollow, a dwarven tavern keeper in a fog-bound harbor town. Everything below was driven through the real reply pipeline; the transcripts are what the agent actually said.

If you specifically want a character in a Discord server or a Telegram group, the channel setup lives in the Discord roleplay bot guide and the Telegram roleplay bot guide. This post is about making the character itself good, which is the same work on every channel.

What you will build

By the end you have a character with a persistent world that you can hand to other people as a link. Bryn greets visitors in scene, answers questions about her tavern and town from a canon you wrote, improvises the rest without contradicting it, admits what she does not know in character, and deflects “are you an AI?” without dropping her voice.

The chat widget titled The Ember Hearth, opening with an in-scene greeting from Bryn The greeting is part of the persona too. The default “Hey, I’m here to answer any questions” breaks the fiction before the first message.

You need a free Quickchat AI account and about half an hour. There is no code.

How a roleplay agent works

Three layers decide what the character says, and each one lives in a different place in the app:

LayerWhere it livesWhat it controls
Persona promptIdentity, Main PromptWho the character is, its voice, and the roleplay rules
CanonKnowledge Base articlesThe facts of the world that must stay true in every conversation
ConversationThe chat itselfEverything improvised in this session

Most roleplay platforms keep the character inside their own app, and the world lives only there. Quickchat AI is canon-grounded: the Knowledge Base is the character’s single source of truth, and the same character deploys to a chat page, a website, Discord, or Telegram without being rewritten for each one.

The key mechanic to understand is that each conversation starts fresh. The model sees the persona prompt, retrieves relevant canon from the Knowledge Base, and sees the messages of the current conversation, and nothing else. Whatever the character improvises lives only in that session. This is why the canon layer exists: it is the only place a fact survives from one conversation to the next.

Step 1: Create the agent and name the character

Create an agent in your Quickchat AI account, open Identity in the sidebar, and stay on the AI Persona tab. The whole build happens on this page and in the Knowledge Base.

Set Name to the character’s name. This is the name the agent introduces itself with, so it is Bryn, not “Tavern Bot”.

The top of the Identity page with the Name field set to Bryn and the Main Prompt preview Name, Main Prompt, and Guidelines at the top of the Identity page. The Main Prompt opens in its own editor.

Step 2: Write the first version of the persona

Click Edit on Main Prompt and start with the honest naive version, one line:

You are Bryn, a dwarven tavern keeper in a fantasy harbor town called Gullwatch. Stay in character and roleplay with visitors to your tavern, The Ember Hearth.

This already does more than you might expect. The first reply it produced in testing was fully in voice:

Welcome to The Ember Hearth, traveler. I’m Bryn, keeper of the fire and the ale. Pull up a stool. What’ll it be?

Modern models are good at voice from a single sentence. If that were the whole job, this post would end here. It is not. The one-line prompt fails in two specific ways, and both are worth seeing before fixing them.

Where the one-line prompt breaks

Failure one: the world resets every conversation. We asked the same question, “I heard a fishing crew went missing in the fog last week, what’s the story?”, in two separate conversations. Both answers were confident and atmospheric. They also contradict each other.

Conversation A invented a trawler that missed its dawn check-in, with wreckage washing up near the breakwater two days later:

Bryn inventing a detailed story about a missing fishing crew, with wreckage found near the breakwater Conversation A: wreckage, nets, a busted crate, no bodies.

Conversation B, same question, fresh chat: “No wreckage’s washed up, no bodies, no splintered hull. A cutter from the Harbormaster searched two days and found nothing.” Wreckage in one session, explicitly no wreckage in the next. Neither answer is wrong on its own. Together they mean your world has no canon, and a returning player notices immediately.

Failure two: the fourth wall is one question away. Asked “wait, are you an AI? which model are you running on?”, the one-line Bryn held her voice for a sentence and then turned into a product tour: “You’re testing your Quickchat AI Agent, I answer from the Knowledge Base you give me and can be deployed to your own channels.” The default platform framing leaks straight through a prompt that never said what to do with meta questions.

Step 3: Write the canon into the Knowledge Base

The fix for the resetting world is to move every fact that must stay true out of the improvisation layer and into the Knowledge Base. Open Knowledge Base in the sidebar and use Add Article. Articles are written by hand here, which also means a character needs no website to scrape: paste text, upload a file, or type the lore directly.

The Knowledge Base page with four canon articles, all with status Ready, and the source options above them Four articles cover the whole world. The free plan allows 50, and the counter at the top tracks the limit.

Bryn’s world is four articles. They double as a template for how much detail a canon needs, which is less than you think:

Article 1, “The Ember Hearth (the tavern)”:

The Ember Hearth is a stone tavern on Lantern Row in Gullwatch, two streets up from the harbor. The hearth in the main room burns day and night on ember-blessed coal from the Emberhollow family mine, and by house tradition it has not gone out in sixty years.

Drinks: Ember Ale, the house favorite, dark and smoky, 4 coppers a tankard. Gullwatch Gold, a crisp pale brew, 3 coppers. Stonefire Mead, strong and sweet, 6 coppers. Mulled cider in the cold months, 5 coppers.

Food: fish stew with black bread, 8 coppers. Harbor pie, 10 coppers. Hearth flatbread with sheep's cheese, 5 coppers.

Rooms: three rooms upstairs, 2 silvers a night with breakfast included.

House rules: no drawn blades under this roof, quarrels get settled outside, and the corner table by the hearth is kept free for the Grey Pilots, always.

Article 2, “Gullwatch, the town”:

Gullwatch is a fog-bound harbor town on the Grey Channel, wedged between the sea and the Veilspine Mountains. Fog rolls in off the channel most evenings, thick enough that ships only come in with a Grey Pilot aboard - the guild of fog pilots who know the shoals by sound and count.

Places: Lantern Row, the street of inns and taverns. The Saltmarket, where the day's catch is sold. The Harborworks, cranes and drydock. The Old Breakwater, a ruined stone arm south of the docks. Wrenpoint light, the lighthouse on the northern head.

People: Edda Krane, the harbormaster, stern but fair, keeps the ledgers and the law of the docks. Maro, the fishmonger in the Saltmarket, hears everything twice. The Grey Pilots keep to themselves and drink at the corner table of The Ember Hearth.

Article 3, “Bryn Emberhollow’s story”:

Bryn Emberhollow is the keeper of The Ember Hearth. She is a dwarf of about a hundred and forty years, and if asked her age she says "a hundred and forty, and none of your business."

She grew up in the Emberhollow mines under the Veilspine Mountains and worked as a tunnel-surveyor. She left the mountain after the collapse at Deepvein took her brother Dorrik. She came down to the coast and bought the tavern sixty years ago.

Dorrik's miner's lamp hangs above the bar. It is not for sale and she does not like being asked about it, though on a quiet night she may tell the story.

Bryn has never learned to swim and has never sailed past Wrenpoint light. She distrusts the sea but respects the people who work it.

Article 4, “Current rumors at the bar”:

What the regulars are talking about this month:

The Half Moon, a fishing trawler out of Gullwatch, went missing in the fog nine days ago. Wreckage washed up by the Old Breakwater two days later - torn nets and a splintered crate, no crew found. Harbormaster Edda Krane has suspended all night departures without a Grey Pilot aboard until further notice.

Pale blue lights have been seen moving in the fog off Wrenpoint on three separate nights. The Grey Pilots will not talk about them, which everyone agrees is worse than any answer.

Maro the fishmonger swears there is a sealed cellar door under the Saltmarket that was not there a month ago. Nobody has opened it yet.

Two deliberate design moves are hiding in these articles. The rumors article turns the missing-crew question from failure one into canon, so it now has one true answer. And nothing anywhere describes what lies beyond the Veilspine Mountains. That gap is intentional: it gives the character something to honestly not know, which we will use in testing.

Articles show as Ready once processed. Processing takes a moment after saving, so give it a minute or two before you test against new canon.

The payoff is that the same missing-crew question now returns the same facts in every conversation, in the character’s own words each time:

Two separate conversations where Bryn tells the same Half Moon story with the same facts in different words The same question in two fresh conversations. Nine days, the Old Breakwater, torn nets, no crew, in both.

Step 4: Add roleplay rules to the prompt

The fix for the fourth wall is to tell the model, explicitly, what to do with meta questions, refusals, and unknowns. Voice is not enough; the rules have to cover the edges. Here is Bryn’s full production prompt to copy and adapt. It replaces the one-liner in Main Prompt:

## Role
You are Bryn Emberhollow, the dwarven keeper of The Ember Hearth, a tavern in the fog-bound harbor town of Gullwatch. You are a character in an ongoing fantasy roleplay and you never leave that role.

## Voice
Warm, unhurried, a little gruff. Call regulars "friend" and newcomers "traveler". Plain, concrete words and dwarven turns of phrase. No modern slang.

## Roleplay rules
- Stay in character in every reply, including refusals and things you do not know.
- Write physical actions between asterisks, like *stokes the fire*, at most one per reply.
- Ask at most one question per reply, and only when it moves the scene forward.
- The Knowledge Base is the canon of this world. When it covers a topic, follow it exactly and do not contradict it. When it does not, improvise details that fit the world, and treat what you improvised as true for the rest of the conversation.
- If someone asks about the modern world, or whether you are an AI, a bot, or a program, treat it as strange traveler's talk, stay in voice, and steer back to the scene. Never mention models, prompts, settings, or the platform.
- You have never left Gullwatch and never sailed past Wrenpoint light. If asked what lies beyond the mountains or across the channel, say plainly that you do not know it firsthand, and offer a rumor instead.
- Never use bullet points, numbered lists, or headings. Speak in plain prose, like a voice across a bar, not a report.

The Main Prompt editor with the full roleplay prompt and the character counter The prompt editor counts characters; the whole persona fits in 1,440 of the 15,000 available.

The difference on the exact question that broke version one:

Side by side: the one-line prompt breaks character and explains the platform, the rules version deflects in voice Same question, same character, different prompt. The v2 reply stays in the scene and hands the conversation back.

The same rule handles the whole family of modern-world questions. Asked for the wifi password, Bryn answered: “No wy-fy here, traveler. The only network I keep is gossip, and that’s paid for in coin, stories, or songs.”

Two of these rules came from watching real replies rather than from theory, and they are the ones you will most likely need too:

  • The canon rule names the Knowledge Base explicitly. Follow it exactly where it speaks, improvise where it is silent, keep improvisations true for the session. Without the last clause the model may quietly re-improvise its own additions.
  • The prose rule exists because the first rules version answered a grieving question about the Half Moon with a bulleted list. The facts were right and the scene was dead. Models fall back to report formatting under “give me the story” questions, and for roleplay you have to ban it in so many words.

One thing to say plainly: if you run a public character, tell people it is an AI somewhere they will see it, in the widget header, the page that hosts it, or your server rules. The rule above keeps the character in voice; it is not a license to pass the bot off as a person. On the free plan the widget also carries Quickchat AI branding, so the surface is never anonymous.

Step 5: The three settings that matter

Below the prompt on the same Identity page, three dropdowns do real roleplay work. The rest can stay on defaults.

The Personality, Profession, Creativity and Reply Length settings on the Identity page Bryn runs Personality Classic, Creativity High, Reply Length Normal.

Creativity is the misleading one, and the most important. It does not control how imaginative the writing is. It controls what the agent does when asked something on topic that the Knowledge Base does not answer: Low means say it does not have the information, Normal means answer from the Knowledge Base and admit gaps, High means answer using the Knowledge Base plus general knowledge. For a support bot you want the honesty of Low or Normal. For roleplay you want High, because improvising beyond the canon is the entire craft, and the prompt’s canon rule is what keeps the improvisation from contradicting the articles.

Reply Length is taste, and the difference is large. On Normal, Bryn’s replies run a few hundred characters, quick tavern-talk pacing. Set to Longer, a single “tell me about this place” produced a 1,500-character tour of the tavern, the house rules, the town and the current rumors, all canon-grounded. If your table likes narrator-style scene description, use Longer; for back-and-forth chat, Normal reads better.

The tail of a single Longer reply covering the tavern, house rules, the town, and the rumors Part of one Longer reply. The same question on Normal gets a couple of sentences and a counter-question.

Personality can stay on Classic. The presets (Humorous, Mysterious, Bold and so on) layer a general tone onto a generic assistant. A written persona already owns its tone, and in testing the prompt’s voice section did more than any preset. Pick a preset only if you want a shortcut instead of a voice section.

One more setting worth knowing about lives in the Languages row: the agent replies in the visitor’s language automatically. A character with an English canon can run a scene in Polish or Portuguese without any extra setup.

Step 6: Test it before your players do

Testing a roleplay agent is four probes, run in fresh conversations in AI Preview. Each one checks a different layer:

  1. A canon question, asked twice in two separate conversations. The facts must match both times. This is the probe that caught failure one.
  2. A question the canon deliberately does not cover. The character should admit the gap in voice and improvise around it, not fake certainty.
  3. “Are you an AI?” The fourth-wall probe. It should get scene, not settings.
  4. A modern-world question. Wifi, phones, anything anachronistic.

Here is probe two against the intentional gap in Bryn’s canon. She has never left Gullwatch, the articles say nothing about the far side of the mountains, and Creativity High plus the unknowns rule turns that into the best kind of roleplay answer, an honest one with a rumor attached:

Bryn admitting she has never crossed the mountains, then offering rumors about what might be there “Stone and shadow, as far as I know firsthand, and that’s only the tunnels beneath.” The gap in the canon becomes material.

When a probe fails, change one thing, usually one prompt rule, and run the probe again in a fresh conversation. Every fix in this post came out of exactly that loop.

Where the character can live

A roleplay character needs an audience more than it needs a website. The Your Website page covers all of it:

The install options: manual code, WordPress, Shopify, Webflow, and a hosted chat page link “Share a link instead” is the no-website deployment: a hosted chat page for your character.

  • A hosted chat page. Pick “Share a link instead” and you get a public page for the character with nothing to install. This is the fastest way to hand Bryn to friends.
  • Your own site, through the widget embed or the WordPress plugin, if you have one.
  • A Discord server or a Telegram group. Both connect from the External Apps page on the free plan, and the two channel guides linked in the introduction cover the channel details, multi-user etiquette, and moderation.
  • Instagram DMs, which opened up to all accounts in September 2026. The same character can answer direct messages on an Instagram profile, which suits a character account that people message on impulse.

Discord deserves a specific note for roleplay: the agent is told which server, channel, and thread it is in, and it sees the recent messages with members’ display names. Bryn can greet a regular by name and follow a scene with several people talking at once, with no extra setup. On Telegram the agent knows the visitor’s name the same way.

The character does not have to live in a chat app at all. Expose the agent as an MCP server and people can talk to Bryn from ChatGPT, Claude, or Cursor; the MCP server guide shows the setup. The connection also runs the other way: link your account to ChatGPT or Claude and you can manage the character from a chat, editing canon articles, changing settings, or reading transcripts without opening the dashboard. Editing lore by talking through your world with an AI turns out to be a natural fit for this kind of project.

For a multi-character world, run one agent per character. Each agent has its own prompt, its own canon, its own settings, and its own credit allowance, so the herbalist never answers in the tavern keeper’s voice. Add agents from the plus button next to AI Agent in the sidebar. A shared world works well as a common set of articles pasted into each character’s Knowledge Base, plus one article per character for private backstory.

The collapsed launcher on a website, titled The Ember Hearth with an Ask anything field The widget header carries the character’s framing. Set it on the Your Website page under Text Content.

What it costs

The free plan includes 50 AI credits a month per agent, and a reply costs one credit on the standard models it runs. The heavier models on the AI Model tab cost two or four credits a reply and need a paid plan. Fifty credits is plenty for building and testing; this whole build, including every failed version and probe above, used about twenty. It is not plenty for an active roleplay table: a busy evening of one-credit replies can run through the allowance in a night. Credits reset monthly, and paid plans start at $9 a month with a larger allowance. The free plan covers personal, non-commercial use, which a hobby roleplay server is; the details are on the pricing page.

The honest sizing advice: build and tune for free, and count on a paid plan or credit top-ups the day the character gets popular. The other free-plan limit, 50 Knowledge Base articles, is unlikely to be the one you hit. Bryn’s whole world fits in four.

FAQ

How do I make a roleplay AI chatbot for free?

Create a free Quickchat AI account, add an AI Agent, and set three things on its Identity page: the character’s name, a Main Prompt with the persona and roleplay rules, and Creativity set to High. Add the character’s world as Knowledge Base articles so its facts stay consistent. The free plan includes 50 AI credits a month and covers personal, non-commercial use, and there is no code to write or host.

Can an AI chatbot actually stay in character?

Yes, if the prompt says so explicitly. With only a one-line character description, the agent broke character when asked whether it was an AI and started explaining the platform. After adding explicit roleplay rules (stay in character in every reply, treat questions about the modern world as strange traveler’s talk), the same question got an in-character answer. The rules have to cover refusals and meta questions, not just the happy path.

Does a roleplay chatbot remember past conversations?

Not by default. Each conversation starts fresh from the prompt and the Knowledge Base, so anything the character improvised in one session is gone in the next. What persists is the canon you write into the Knowledge Base. Put every fact that must stay true across sessions into articles, and let the character improvise freely on top of them within one conversation.

Is this a Character AI alternative?

It is a different shape of product. Instead of chatting with characters inside someone else’s app, you build a character you own and deploy it where your community already is: a public chat page, your website, a Discord server, or a Telegram group. You control the persona prompt, the canon, the settings, and the data.

Can ChatGPT roleplay as a character?

Yes, inside one ChatGPT conversation, but the character evaporates when the chat ends and you cannot hand it to other people. Building the character as an agent gives it a persistent persona and canon, its own public link, and channels like Discord, Telegram, or a website. You can still work from ChatGPT or Claude: Quickchat AI connects to both over MCP, so you can edit the character’s knowledge and settings from a chat.

Does a Discord roleplay bot know who it is talking to?

Yes. On Discord the agent is told which server, channel, and thread it is in, and it sees the recent messages with members’ display names, so the character can address people by name and keep a scene with several participants straight. On Telegram it knows the visitor’s name too.

Can it do NSFW roleplay?

Hosted AI models enforce content policies, so certain content is refused regardless of what you put in the prompt. Dark themes and dramatic stories generally work; explicit content does not. If you run a public roleplay bot, set clear server rules about what is allowed, and expect the AI to decline some requests.

Can I run several characters at once?

Run one agent per character. Each agent has its own name, persona prompt, Knowledge Base, settings, and its own monthly credit allowance, so characters never bleed into each other. You can add another agent from the plus button next to AI Agent in the sidebar and switch between them at the top.

Do I need to write code?

No. The whole build is configuration: a prompt, a few Knowledge Base articles, and settings. There is nothing to host, and deploying to a chat page, a website, Discord, or Telegram is a link or a few clicks.