

history = [task]
while True:
step = model(history, tools)
if step.is_final:
break
out = tools[step.tool](**step.args)
history.append(out)# Cell 3, written by the model
pages = [fetch(u) for u in urls]
notes = summarize(pages)
# Call the model with only the notes;
# it calls set_next_cell_code (Cell 4)
call_me(input=f"Continue: {notes}")Simplified; the helper functions are illustrative.
| Aspect | Typical ReAct | Fibona Agent |
|---|---|---|
| Who writes the loop | The model writes it Cell by Cell | ReAct: The developer, in the host |
| What a step is | A complete block of Python | ReAct: One tool call |
| What it can do | Two host tools and the whole interpreter | ReAct: A pre-registered list of tools |
| Context | Only what the code picks | ReAct: All history, growing every turn |
| On error | Recovery Cells until three fail in a row | ReAct: The error goes back as an observation |
| When it ends | Only when the user asks to quit | ReAct: The model gives a final answer |