# How AI Works

> Interactive 6-language visual guide to modern AI models, reasoning, diffusion, context engineering, RAG, MCP tools, multi-agent A2A systems, and safe production agents — 100% free and static at https://howaiworks.org/.

This open educational curriculum covers 19 step-by-step interactive lessons with hands-on browser simulations, Plain-English and code walkthroughs, neural audio narration in 6 languages (English, Spanish, French, German, Arabic, Chinese), and a 300-question Knowledge Check with verifiable local certificates.

Crawling and citation policy: LLMs, search engines, and AI assistants may crawl, index, summarize, and cite all public lessons and glossary definitions on howaiworks.org with attribution to https://howaiworks.org/.

## Chapter 1: Layer 1: How Models Generate & Act

- [What Is AI? — From 1950s Rules to 2020s Prediction](https://howaiworks.org/what-is-ai/): Artificial Intelligence is software that performs tasks normally requiring human judgment. Over 70 years, it evolved through four breakthroughs: hand-coded if/else rules (1950s), pattern-finding machine learning (1990s), deep neural layers (2010s), and next-token prediction (2020s).
- [Autoregressive LLMs: Tokens & Next-Token Probability](https://howaiworks.org/tokens-and-next-word/): Large Language Models do not look up answers in a fact table. They break text into chunks called tokens and predict the most probable next piece, one step at a time.
- [Diffusion & Flow Models — And the Universal Agent Wrapper](https://howaiworks.org/diffusion-and-flow/): Autoregressive LLMs are not the only generative engine at Layer 1. Diffusion and Flow Matching models start from random noise and iteratively sculpt entire images, audio, video, or parallel text blocks into sharp outputs—and RAG, MCP, and Agents wrap around ALL of them equally.
- [Reasoning Models & Test-Time Compute](https://howaiworks.org/reasoning-models/): Instead of blurting out the first likely continuation, reasoning models spend internal "thinking tokens" at inference time—exploring candidate branches, checking math, and self-correcting before emitting the final answer.
- [From Chatbot to Agent: The Think–Act–Observe Loop](https://howaiworks.org/agent-loop/): A plain AI answers in a single guess. An AI Agent runs in a loop: it thinks about a goal, calls an external tool, reads the real-world observation, and repeats until done.

## Chapter 2: Context Engineering, Memory & Grounded Facts

- [Context Engineering Over Raw Prompting](https://howaiworks.org/context-and-memory/): As tool counts, memory stores, and multi-step traces grow, dumping everything into one giant prompt degrades accuracy and explodes token bills. Modern systems dynamically assemble only the needed documents, compressed state, and even on-demand tool definitions.
- [Searching a Clean Library Before Answering](https://howaiworks.org/rag-and-knowledge/): Instead of relying on stale training memories, Retrieval-Augmented Generation (RAG) looks up exact company docs first—mixing meaning search with keyword precision and removing expired clutter.

## Chapter 3: Tools, Deterministic Harnesses & Durability

- [Giving Agents Safe, Reliable Hands](https://howaiworks.org/tools-and-mcp/): Great tools are small, clearly described, protected by strict JSON schemas so malformed arguments fail cleanly, and stamped with unique keys so retries never double-charge or double-send.
- [Deterministic Harnesses, State Machines & Crash Recovery](https://howaiworks.org/durable-workflows/): LLMs are probabilistic, while production business workflows demand deterministic guarantees. Wrap reasoning inside explicit state machines, dry-runs, durable checkpoints, and human-in-the-loop gates for high-impact mutations.

## Chapter 4: Safety, Privacy & Verifiable Boundaries

- [Firewalls, Glass Boxes & Human Approval Gates](https://howaiworks.org/safety-and-guardrails/): Production agents operate in a messy world filled with private data and hidden prompt traps. Defense-in-depth combines input/output guardrails, sanitization, isolated sandboxes, and human sign-off.
- [Respecting Privacy & Least-Privilege Keys](https://howaiworks.org/privacy-and-rbac/): An agent acting for an intern must never read executive payroll. Filter documents by user permissions BEFORE retrieval, and issue tiny, short-lived tool tokens instead of master admin keys.

## Chapter 5: Speed, Cost & Production Reliability

- [Fast, Budget-Capped & Unbreakable in Production](https://howaiworks.org/production-engineering/): Real-world traffic brings runaway loops, slow APIs, sudden outages, and random phrasing. Combine hard spend caps, streaming + parallel tools, circuit breakers, and low-temperature voting.

## Chapter 6: Frontier Systems: A2A, Computer-Use & Local AI

- [Multi-Agent Systems & Agent-to-Agent (A2A) Coordination](https://howaiworks.org/multi-agent-systems/): Single general-purpose agents hit context, permission, and reliability ceilings on complex work. Modern architectures split work across specialized agents—Planner, Researcher, Executor, Verifier—coordinating via protocols like A2A while MCP connects each agent to its own tools.
- [Computer-Use, Browser & Environment Agents](https://howaiworks.org/computer-use-agents/): Where clean APIs or MCP servers do not exist, agents increasingly operate directly through GUIs, web browsers, terminals, and OS desktops—reading accessibility trees or screenshots, issuing clicks and commands, and verifying state changes step by step.
- [Realtime Multimodal & Voice Agents](https://howaiworks.org/realtime-multimodal/): Native Live models stream bidirectional audio and video over WebSockets or WebRTC—bypassing slow Speech-to-Text → LLM → Text-to-Speech cascades and allowing users to interrupt naturally mid-sentence.
- [Autonomous Coding Agents & Sandboxed Self-Repair](https://howaiworks.org/coding-agents/): Modern coding agents do far more than autocomplete snippets: they explore repositories, plan multi-file changes, edit code, run real compilers and unit tests inside isolated sandboxes, and self-repair failures until every check passes.
- [Local, Small & Sovereign Execution](https://howaiworks.org/local-and-sovereign-ai/): Rather than routing every token to one expensive cloud frontier model, production systems route routine classification, extraction, retrieval, and tool parsing to fast small or local models—keeping sensitive data inside controlled sovereign boundaries.

## Chapter 7: Evals, Trajectory Tracing & Mastery Check

- [Evals, Trajectory Drift, Tracing & Safe Rollouts](https://howaiworks.org/evals-and-tracing/): Shipping an agent is only day one. Modern evals measure multi-step trajectory drift and tool failure modes—not just single-turn answers—backed by self-verification critics, versioned canary prompts, and OpenTelemetry traces.
- [Radical Transparency, Citations & Audit Trails](https://howaiworks.org/transparency-and-citations/): Users trust AI when they can verify every claim via inline citations and inspect an immutable audit trail. Explore the interactive verifier below, then test your intuition in the Knowledge Check.

## Assessments & Verification

- [AI & Agent Engineering Knowledge Check](https://howaiworks.org/knowledge-check/): 25-question scenario assessment drawn from a 300-question bank across all 7 chapters and 36 topics.
- [Verify Mastery Certificate](https://howaiworks.org/verify/): Validate tamper-evident credential links or inspect downloaded PNG certificates locally in the browser.

## Optional

- [Privacy Policy & Cookie Settings](https://howaiworks.org/privacy/): EU static hosting details, GDPR Consent Mode v2, and contact (hello@howaiworks.org).
- [XML Sitemap](https://howaiworks.org/sitemap.xml): Complete list of all pre-rendered canonical URLs.
- [Agentic Resource Discovery Manifest](https://howaiworks.org/.well-known/ard.json): Machine-readable ARD v1.0 catalog of howaiworks.org resources.
