# State (/academy/state)



State is the sticky notes on the monitor. Storage is the notebook you take home.

Your app is thinking right now. Which modal is open. What the judge typed into the form. Which step the [agent](/academy/agent) already finished. That working picture is **state**. It is not the [database](/academy/database). The database is what you still know tomorrow. State is what you know this second, in this [process](/academy/process), in this [session](/academy/session).

Kill the process and the notes hit the floor. That's why [serverless](/academy/serverless) feels rude: every request may be a new process. If you stuffed the shopping cart in a variable, the cart is empty on the next click. The judge thinks your app is broken. You hid the memory in the wrong pocket.

**Two pockets**

* **UI state** — which tab is selected, is the modal open — can live in the process, the URL, or a [cookie](/academy/cookie). Lose it and the screen looks weird, not empty.
* **Business state** — whose todos, what they paid, the Polar receipt — lives in a database. Lose that and you have a pretty room with amnesia.

[Cache](/academy/cache) is a rumor of state. Allowed to be wrong for a minute. Don't put the receipt there.

**Agents forget the same way**

An agent doing a multi-step [job](/academy/job) needs a working picture. "Step one is done, here's the file, now step two." If the process dies and you never wrote that down, the agent wakes up as a stranger. That's a state problem, not a model problem.

The [builder](/builder) already picked a cabinet for you. Auth sessions, todos, the user row survive a refresh because they were never only in RAM. When you invent a new thing the app must remember, pick a pocket on purpose.

**What this unlocks**

Until you know where "right now" lives, every crash is a mystery. After you do, the cart belongs in the database, the modal belongs in the URL, the agent's checklist belongs in a file. The demo survives a refresh. The agent can continue. You stop blaming the model for a wiped board.
