Skip to content

Lesson 8 · the agent loop

What is an agent?

  1. 1. Story
  2. 2. Guess
  3. 3. Your turn

KaiPeople say AI agents will run shops. Should I be worried?

SitaraAn agent is just a loop: read a request, pick a tool, run it, and let a human check. Let’s build one together.

EllaAnd this practice Sitara runs right here on your phone. No internet, no cost.

An AI model on its own only writes text. An agent turns a request into a plan: which tool to use, with which inputs. Your code decides what actually runs.

  1. 1. ask_sitara reads a request and suggests a plan
  2. 2. The plan is a dictionary: a tool name and its inputs (args)
  3. 3. Sitara only suggests. Your code, and you, decide
cafe.py

Try: Ask about scone stock instead. Then try a message Sitara doesn’t understand.

Read · about 1 minute

The basics, in plain words

An AI model on its own only writes text. An agent turns a request into a plan: which tool to use, with which inputs. Your code decides what actually runs.

from sitara import ask_sitara

plan = ask_sitara("How much milk is left?")
print(plan)
  • ask_sitara reads a request and suggests a plan
  • The plan is a dictionary: a tool name and its inputs (args)
  • Sitara only suggests. Your code, and you, decide
AI model
Writes text. On its own it can’t do anything in the world.
agent
Turns a request into a plan: which tool to use, with which inputs. Your code decides what really runs.

Common slip: Trusting the plan without checking it. Always read what the agent wants to do.

Read all twelve Python basics with Sitara →
Next · lesson 9 · about 14 minutesGiving your agent toolsYou will learn tools as functions.Next lesson →