DEV Community

Garret Williams
Garret Williams

Posted on Originally published at aibotchatting.com AI-assisted

How Do AI Chatbots Work? Explained Without the Jargon

Short answer: An AI chatbot runs on a large language model, software trained on huge amounts of text to predict the next word-piece in a sentence. When you send a message, the app combines it with the bot's instructions, recent chat history and any saved memories, and the model writes a reply one piece at a time. Personality comes from those instructions; memory comes from what the app chooses to feed back in.

The 30-second version

  1. The model: a large language model (LLM), trained on vast amounts of text, that predicts what text should come next.
  2. The prompt: each time you send a message, the app builds a bundle: the bot's instructions, recent messages, any saved memories, and your new message.
  3. The reply: the model writes a response one token (word-piece) at a time.
  4. Repeat: the conversation grows, and the app keeps choosing what fits into the next bundle.

Where personality comes from

The same model can be a pirate, a tutor or a tsundere. The difference is the character instructions: description, backstory, speaking style and example dialogue. Well-written instructions produce consistent personalities. See AI chatbots with personality and how to make an AI character.

Where memory comes from

Models don't remember between messages. The app provides memory by:

  • Short-term: including recent messages, up to the model's context window limit.
  • Long-term: saving important facts and adding the relevant ones back in later.

That's why some bots forget and others don't. Read why AI companions forget and what humanistic memory in AI means.

Why chatbots sometimes get things wrong

LLMs generate plausible text, not verified truth. Without the right information in the prompt, they can confidently invent details, which is known as hallucination. For facts that matter, check a reliable source.

Text, voice and images

  • Voice chat converts your speech to text, runs the same process, then turns the reply into speech. See AI voices & accents.
  • Images in chat apps usually come from a separate image model the app calls on request.

Next: what is AI bot chatting ยท AI companion vs AI chatbot

FAQ

Do AI chatbots understand what I say?
They model language patterns very well, which lets them respond sensibly, but they don't understand or experience things the way people do.

Why do AI chatbots make things up?
A language model generates likely-sounding text, not verified facts. When it lacks information it can produce confident but wrong answers, called hallucinations.

How do AI characters have different personalities?
Each character comes with instructions: a description, backstory, speaking style and example dialogue. The same model can play many characters depending on those instructions.

Does the AI learn from my chats?
The model itself usually isn't retrained live on your chat. The app may save memories about you, and some companies use conversations to train future models, depending on their privacy policy.


See it in practice: ChatBrat is an AI character chat app built around characters that remember you. It runs in any browser, including your phone. Try the 10-minute memory test on it, or on any app.

Originally published on AI Bot Chatting. I'm the founder of ChatBrat.

Top comments (0)