ARIA Adaptive Response & Intelligence Agent
The only one of the four that is not a request and a response. A conversation is a log of events that arrive when they arrive, so the design problem is deciding when a turn has actually finished being said.
Cloudflare Pages cannot define a Durable Object, so the realtime half lives in its own Worker. The Pages Worker stays the auth boundary and forwards.
google/gemma-4-31B-it served through Novita, on a Gradio SpaceAriaConversationEverything that arrives is an event: a message, an image, a file, or the system noticing you went quiet.
The client sends an event over the socket. The object appends it to the log and persists it. Nothing is overwritten, so the conversation has a history rather than a current state.
Consecutive unanswered events are gathered into one logical turn, debounced. This is the whole trick: "buy apples" followed a second later by "and pears" is one thought, and answering the first before the second arrives makes the agent look like it is not listening.
The object builds structured context from the recent events and the resolved topic, and calls the brain. Media is passed as a signed URL rather than bytes, so the public Space can fetch it without the bucket being public.
The brain returns bubbles as structured JSON, each tied to the event it answers. The object streams a typing signal, then the bubbles, then persists them.
An alarm rearms after every turn. When it fires, the object emits a system event and the brain may choose to say something unprompted, which is how an image sent with no caption gets a "what is this?" instead of silence. Capped per turn so it cannot nag.
The brain does not return prose. It returns a list, and each item names the event it is answering, which is what lets a reply attach to the right message in a conversation that kept moving while the model was thinking.
[
{ "bubble": "co to?", "target_event_id": "evt_123", "type": "proactive" },
{ "bubble": "jabłka ogarnięte", "target_event_id": "evt_456", "type": "response" },
{ "bubble": "gruszki też dorzucę", "target_event_id": "evt_457", "type": "follow_up" }
]brain → durable object → client