Introduction
Most backend services own state. They write to a database, track sessions, remember where you are in a flow.
StareBrain’s backend does none of that. Every request to /next-step is self-contained. The backend reads what the client sends, decides the next action, and returns it. Nothing is written. Nothing is stored. The session ends when the response leaves.
This is a deliberate architectural choice — and it has real consequences for how the agent handles plans, step history, and recovery.
The Request and Response
The full schema for a single agent step:
` class AgentStepRequest ( BaseModel ): task : str screen_description : str current_package : Optional [ str ] = None steps_so_far : list [ str ] = [] step_count : int known_facts : str = "" plan : list [ str ] = [] current_subgoal : int = 0 screenshot_b64 : Optional [ str ] = None capabilities : list [ str ] = []
class AgentStepResponse ( BaseModel ): reasoning : Optional [ str ] = None action : str target_index : Optional [ int ] = None…