Um momento
0x10Lesson 2 of 6

Track state and progress

Keep a compact record of goals, completed work, and the next useful step.

12 min 5-question quiz
By the end of this lesson you can
  • Design state that helps a loop resume without repeating or losing work.

A multi-step loop needs state: the user’s goal, relevant constraints, completed actions, important results, and outstanding work. Keep this state explicit and bounded. Store durable results outside a short model context when they must survive interruptions. Separate trusted application state from untrusted text returned by tools or documents.

A small example

Illustrative Python
state = {"goal": "prepare report", "completed": ["collect totals"], "next": "check outliers"}
print("Next:", state["next"])
Output
Next: check outliers

A progress summary helps prevent repeated work and supports recovery after a timeout. Persist only what is necessary, protect sensitive fields, and version stored state when its structure changes. The model can propose a state update; application code should validate it before saving.

Key takeaways

  • Design state that helps a loop resume without repeating or losing work.

  • Bound the loop, validate actions, and make its outcome observable.

Lesson quiz

5 questions · pass with 4 correct · up to 50 XP

Passing this quiz completes the lesson and keeps your streak going. Questions you miss come back in review sessions later.

Questions about this lesson

Stuck? Ask. Figured something out? Share it. Explaining is one of the best ways to learn.

Loading posts…

Gostou da aula? 😆👍
Apoie nosso trabalho com uma doação: