--- title: Agent Loop emoji: ๐Ÿ” colorFrom: yellow colorTo: gray sdk: static pinned: false --- # The Agent Loop Animated explainer for [Unit 6 of the Context Course](https://huggingface.co/learn/context-course): the agent loop. Renders the four-step cycle โ€” `call llm โ†’ parse โ†’ execute โ†’ append` โ€” with a live terminal log that fills as the loop iterates and a `STOP ยท end_turn` branch that fires on the final pass. Source composition (HyperFrames) lives at [github.com/huggingface/context-course/tree/main/course-hyperframes/agent-loop](https://github.com/huggingface/context-course/tree/main/course-hyperframes/agent-loop). Embedded in the course via `