Français
Applied AI — Intermediate level · Session 6

🔁 The agentic loop

From the chatbot that responds once… to the agent that perceives, thinks, acts, observes — and starts again until the mission is accomplished. 100% offline page.

The Visualizer: TripDesk in action

TripDesk is a travel reservation agent . Go step by step and observe each beat of the loop: Perceive To reflect on Act Observe. You will also see a human checkpoint, a breakdown… and the shutdown decision made by the agent itself.

🎯 Mission entrusted to TripDesk: “Find me a Paris → Lisbon flight the week of the 14th, compatible with my schedule, book it and send me the confirmation. »
🧰 Tools: chercher_vols · consulter_agenda · reserver_vol (irreversible!) envoyer_confirmation
1
👁️ Perceive
read mission & context
2
🧠 Think
decide the next action
3
🛠️ Take action
call a tool
4
🔍 Observe
read the result
↻ …and the loop starts again, until the agent decides that the mission is accomplished
Iterations (guardrail: max 15)
0 / 15
Budget consumed (safeguard: €0.50 ⚠)
0,00
Click “Next Step” to start the loop.

The execution log will appear here, step by step…

🗒️ Agent notepad (working memory)

  • Empty — execution has not started.

💡 Three things to notice

1️⃣ The counters top: max iterations and budget cap — two guardrails that prevent a loop from running infinitely.
2️⃣ The notepad (scratchpad) which is enriched: it is the working memory — the history reread at each iteration. She is erased at the end of the execution.
3️⃣ The END : no one stops TripDesk — it itself assesses that the goal has been achieved. This is THE difference with a chatbot.

Do you really need an agent?

Agents are powerful… and expensive: each iteration = one call to the model = cost + latency + risk. Answer the questions to find the simplest architecture that is enough . Golden rule: prompt < unique tool < fixed workflow < agent .

Try with:

The essence of the session

The definition in one sentence

An agent = a language model in a loop, with tools, and the right to decide when it's finished.

It is not a “smarter” model: it is often exactly the same model than a chatbot, placed in a different architecture. Agency is a property of system .

Chatbot vs agent

ChatbotAgent
Functioning One turn: question → answer → stopA loop, until the end of the task
Stop Mechanics, after the answerDecided by agent when the goal is achieved
Production TextActions (tools) + text
Error Wrong answerFailed action → possible recovery

The loop and its bricks

BrickRoleTripDesk example
🔁 LoopPerceive → reflect → act → observe, in cycle5 iterations from mission to confirmation
🛠️ ToolsThe agent’s “hands” = the “act” step (tool calling, Session 5)chercher_vols , reserver_vol
🗺️ PlanningBreak down the goal into sub-steps — plan revisable Plan changes when agenda conflict is discovered
🗒️ Working memoryHistory/notepad reread at each iteration — deleted at the end The 3 flights found in iteration 1 remain available in iteration 4
🚧 GuardrailsMax iterations · budget ceiling ⚠ · human validation of irreversible actionsMax 15 iterations, €0.50 ⚠, validation before reserver_vol
🩹 Error recoveryRead error → adapt → try again differently “Full flight” → choose the alternative, not the same flight

⚠ The amounts and numbers of iterations are orders of magnitude: the prices of APIs (Application Programming Interface) and practices evolve quickly.

When NOT to use an agent

If a single well-written prompt is enough (summary, translation), or if a single tool call is enough (weather), or if the steps are fixed and known in advance (workflow), an agent is there. over-engineering : more expensive, slower, riskier, for zero profit.

“Always take the simplest weapon that accomplishes the mission. »