Three animated flows that explain the three ideas behind modern AI: how a language model writes text one token at a time, how retrieval keeps answers grounded in real documents, and how an agent loops through tools until the goal is done.
Everything here is a simplified educational visualization — the shape of the idea, not real model internals. The Run buttons drive simulated animations in your browser; no real AI model runs and nothing is sent anywhere.
The experiments
Press Run, watch the idea move
Each flow is an animated diagram powered by the PlainLogic flow engine. Follow the packet along the edges — every step is labeled as it fires.
The LLM flow — one token at a time
Simplified educational visualization
A large language model does not look up answers — it writes them one piece at a time. Your prompt is sliced into tokens, the model reads the full context, and predicts the most likely next token, repeating until it stops. Real models do this with probabilities across billions of parameters, so this is a conceptual simplification: no actual tokenization or model math happens here — the animation only shows the shape of the idea.
Ready. Press Run to watch a prompt travel through the flow.
Simplified educational visualization. No real tokenization runs in your browser; the packet animation is illustrative.
The RAG flow — answers with receipts
Simplified educational visualization
RAG (retrieval-augmented generation) fixes the model's knowledge cutoff by handing it cheat sheets. Your question is turned into a search, matching documents are pulled from a knowledge store, and the best chunks are pasted into the model's context before it writes the answer. This is simplified: real systems use vector indexes and similarity search to find those chunks — the diagram shows the shape of the idea, not the machinery.
Ready. Press Run to watch a question get answered with documents.
Simplified educational visualization. No real embeddings, search, or retrieval runs here; the packets are illustrative.
The agent flow — the loop that does work
Simplified educational visualization
An agent does not just answer — it works in a loop toward a goal. It decides on an action, calls a tool, reads the observation, and decides again, iterating until the goal is done. Watch the loop-back edge: the first tool call fails, so the agent retries the tool, re-plans from the observation, and finishes on the second pass. Real agents juggle far more memory, tools, and error handling than this tidy loop — it is a loop illustration, nothing more.
Ready. Press Run to watch the agent iterate: attempt 1 fails, attempt 2 lands.
Simplified educational visualization. The loop-back edge from Observation to Decision is the whole idea of an agent: iteration.
Plain-language AI
What each step means
The six boxes in each flow, in plain words. Nothing here requires a math degree.
LLM flow
PROMPT — the words you type to start.
TOKENIZE — the text is sliced into tokens, small chunks the model actually reads. Illustrated here, not computed.
CONTEXT — everything the model may consider: your prompt plus what it has written so far.
MODEL — the trained predictor that turns context into a guess about what comes next.
NEXT TOKEN — one predicted piece is picked from the model's options.
OUTPUT — the picked tokens accumulate into readable text.
RAG flow
QUESTION — what you ask.
EMBEDDING / SEARCH — the question becomes a search over the knowledge store. Real systems use vector indexes; shown simplified.
DOCUMENTS — the stored knowledge: manuals, articles, notes.
RETRIEVED CHUNKS — the few passages most relevant to the question.
CONTEXT — question plus evidence, handed to the model together.
ANSWER — the model's reply, now grounded in your documents.
Agent flow
GOAL — the task the agent is trying to complete.
DECISION — the agent picks its next action.
TOOL — the action happens out in the world: a search, a file write, an API call. It can fail, and be retried.
OBSERVATION — the agent reads what the tool returned.
NEXT DECISION — the plan adjusts based on the observation. This is where the loop closes.
RESULT — the goal is reached and the loop exits.
Honest answers
What this page is (and is not)
Is this how AI really works?
Conceptually, yes — literally, no. Each flow shows the real shape of the idea: a language model predicts one token at a time; RAG retrieves documents and then answers; an agent decides, acts, observes, and repeats. Real systems involve billions of parameters, vector indexes, and tooling this page only hints at, which is why every visualization is labeled "simplified educational visualization."
Does pressing Run use a real AI model?
No. The Run buttons drive a simulated animation built with the PlainLogic flow engine. No prompts are sent anywhere and no real model runs — it is an educational illustration, not a working AI. Nothing leaves your browser.
What is the difference between RAG and an AI agent?
RAG gives the model documents to read before it answers — the model itself stays passive. An agent gives the model tools to act with and a loop to keep trying until the goal is done. In practice they combine: agents routinely call retrieval as one of their tools.