# Anatomy of AI > An interactive explanation of the machine behind the phrase "AI": how a large language model is built, how it is run, and what the ordinary software around it does. Written for someone with no background, from first principles, with a hands-on interaction for every part. Nothing on the site calls a model API: every interaction computes its numbers in the browser of whoever is reading. The subject is one machine: the system built around a large language model. It is not a survey of artificial intelligence, and the opening part says so explicitly. 29 parts are written, each with something you can operate, and every figure states whether it was measured here or taken from published work. The machine is described in five stages: 1. **Build** Text becomes a file of numbers. Runs once, long before you arrive. 2. **Assemble** Everything the model will see is gathered into one string. 3. **Run** The file is run over the context, producing one token. 4. **Loop** A program repeats the whole thing, deciding what goes back in. 5. **Constrain** What measures the output, and what limits what it can do. ## The machine - [Anatomy of AI: how a language model actually works](https://www.agenticprosperity.com/): The machine in five stages, one stage open at a time, with all 29 parts and a hands-on interaction for each of them. - [The whole machine on one page: Anatomy of AI](https://www.agenticprosperity.com/flow): Every component and every connection at once, plus a step by step trace of one request from pressing enter to the answer coming back. - [How an AI model is built: Anatomy of AI](https://www.agenticprosperity.com/substrate): The eight parts that run once, before anyone talks to a model, read in order as a single article rather than opened one at a time. ## Reference - [AI glossary: every term, and where it comes from](https://www.agenticprosperity.com/glossary): Every term used anywhere on the site, with the one part that introduces it and the sentence that does the defining. - [About, and where every number came from](https://www.agenticprosperity.com/about): Provenance for every number on the site, stated per source, including which figures were measured here and which were taken from published work. - [Keyboard shortcuts: Anatomy of AI](https://www.agenticprosperity.com/keyboard): The full keyboard interface, including the places where the arrow key grammar is not yet uniform. ## The parts - **What we mean by "AI" here**: "AI" now labels a dozen unrelated machines. This one is ours - **The corpus**: Text, gathered at a scale no person could read - **Tokens**: Text cut into pieces a machine can count - **Embeddings**: Meaning stored as position in space - **Parameters**: The adjustable numbers, and the shape they sit in - **Training**: Guess, measure the error, nudge every number - **Scale**: More of everything, and what that actually buys - **The weights**: A file of numbers, and nothing else - **Post-training**: Why it answers you instead of continuing your sentence - **The forward pass**: One token at a time, from a standing start, every time - **Sampling and temperature**: Why the same question gives different answers - **Reasoning**: Thinking out loud is more tokens through the same loop - **The context window**: Everything the model can see. There is nothing else. - **Attention**: How each token decides which others matter - **Cost and latency**: What you actually pay for, and why it feels slow - **The prompt and its roles**: Roles, and the fact that it is all one string - **Markdown and the plain-text interface**: Why plain text became the interface for instructions - **Tools and function calling**: How a text machine acts on the world - **Retrieval**: Fetching the right paragraph before answering - **The stores**: Four kinds of store, and what each is for - **Interfaces**: Chat, API, SDK, MCP. The same machine, four doors - **Agents**: A model in a loop, with tools and a goal - **Context engineering**: Deciding what goes in the window, and what stays out - **Context sharding**: Splitting work so no one context holds it all - **Orchestration**: Arranging many runs: in sequence, in parallel - **Memory**: What persists between runs, and where it lives - **Evaluation and failure**: How you know it worked, and the ways it fails - **Guardrails and permissions**: Limits, accountability, and where they belong - **One request, end to end**: Everything you have just met, working at once ## Optional - [The full text](https://www.agenticprosperity.com/llms-full.txt): every part in full, as markdown, including the advanced material, the 27 components, the 35 connections between them and the 21 step trace of one request. - [Sitemap](https://www.agenticprosperity.com/sitemap.xml): the six pages.