‹ Back to blog

Features Explained

How AI Chat Works, Step by Step

how ai chat works shown as a young man in a library typing a question into an AI chat on his laptop with notes beside him

How AI chat works, in seven steps: your message is sent to the company's servers, split into tokens, combined with instructions, recent history and saved memories, passed to a language model that predicts a reply word by word, checked by safety systems, sent back to you and then stored according to the app's retention rules. Below, each step explained in plain English, with what ChatGPT, Gemini, Claude and companion apps say about storing and using your chats.

How AI Chat Works: The 7 Steps at a Glance

StepWhat happens
1. SendYour message travels to the company's servers
2. TokenizeText is split into tokens: words or parts of words
3. Build contextSystem instructions, recent messages and saved memories are added
4. GenerateThe language model predicts the reply one token at a time
5. CheckSafety systems screen the request and the reply
6. ReturnThe reply streams back to your screen
7. StoreThe chat is saved for a period set by the company and your settings

Tokens and Context

Language models don't read letters or whole sentences; they read tokens, small chunks of text. Each model can only handle a limited number of tokens at once, called the context window. Everything the model "knows" about your conversation must fit inside it: the app's hidden instructions, your recent messages, any files you uploaded and any memories it adds.

When a conversation gets too long, older messages drop out or are summarized. That's why a chatbot can "forget" something you said an hour ago. More on the model itself in what is a large language model?

How the Model Writes the Reply

The model doesn't look up a stored answer. It predicts the most likely next token, adds it, and repeats, hundreds of times per reply. Settings chosen by the company control how creative or predictable it is. Some assistants also run a "thinking" step first, or call tools such as web search or code, then fold the results into the answer.

Because it is predicting rather than retrieving, the model can sound confident and still be wrong. Always check important facts, and ask for sources.

Safety Checks

Before and after generation, automated systems screen for harmful requests and outputs. Companies may also review some chats: Google says "human reviewers (including trained reviewers from our service providers) review some of the data we collect" for Gemini (source), and Replika says human review can happen "where necessary" to detect crisis content (source). New laws in California and New York require companion apps to refer users to crisis services when self-harm comes up (details).

What Happens After the Reply

ServiceUsed for training?How long chats are kept
ChatGPTYes by default; turn off "Improve the model for everyone"Temporary chats deleted within 30 days
GeminiYes with Keep Activity on18 months by default; reviewed chats up to 3 years
ClaudeOnly if you allow it30 days if training is off; 5 years if on

Sources: OpenAI, Google, Anthropic.

Step-by-step opt-outs are in our guide to stop AI training on your data.

A Simple Example

Imagine you type: "What should I pack for a weekend in Chicago in March?" The app splits that into tokens, adds its hidden instructions ("be helpful, be concise"), your last few messages and perhaps a saved memory that you prefer carry-on luggage. The model predicts a reply: layers, a waterproof jacket, comfortable shoes. If the assistant can search the web, it may first look up the weather forecast and include it. Safety systems check nothing harmful is involved, the answer streams to your screen, and the conversation is saved according to your settings. The whole process usually takes a few seconds, and every step can affect the quality and privacy of the answer.

How Companion Apps Differ

AI companion apps follow the same seven steps, with two extras: a detailed personality description added to every reply, and a long-term memory system that stores facts about you between conversations. Kindroid, for instance, describes persistent, cascaded and retrievable memory (source). Read how AI companions work for the full picture, and AI chatbot privacy before sharing anything personal.

Last checked: November 16, 2026. Prices and features change; the official app screen is always the final word.

Frequently Asked Questions

How does AI chat work?

Your message is split into tokens, combined with instructions and recent history, and a language model predicts a reply token by token, which is then safety-checked and sent back.

Does the AI understand what I write?

It processes patterns in text very well, but it predicts likely replies rather than understanding like a person.

Why does an AI chatbot forget things?

Each model has a limited context window. Older parts of long conversations drop out unless the app saves them as memories.

Are my AI chats stored?

Yes, for a period that depends on the service and your settings. ChatGPT temporary chats are deleted within 30 days; Gemini keeps chats 18 months by default.

Can people read my AI chats?

Some companies use human reviewers for a portion of chats, for example Google for Gemini.