(slop, but accurate)
Most AI chat examples look simple.
Take a list of messages. Send them to a model. Stream tokens back to the browser. Persist the result somewhere. Repeat.
That is a useful starting point, but it hides the actual problem. A production AI application is not just a model call. It is a small distributed system: clients disconnect, users open multiple tabs, tools run on both sides of the