Thuta Learning
ExercisesAIbeginner

Practice — Agent Fundamentals

Relax. We'll talk through this in plain words — no textbook voice.

What you'll walk away with

  • Get hands-on practice with agent fundamentals
  • Practice the skills you've already learned until they stick
  • Learn to spot mistakes, fix them, and check your own work

Let's think about this for a second

This lesson isn't new material — it's a practice round putting the Agent vs Chatbot distinction, the Observe-Think-Act loop, how to write a clear goal, and how to call tools (all from the Basics chapter) back into action. "I understand this concept" and "I can actually write it" are two different things, so skip the talking and just write it out here. Each task should take roughly 5 minutes, and it's fine to get an answer wrong — the point is to shake your memory back into gear. When you're done, check your answers against the checklist.

Exercises

Task 1: Write two examples of your own that clearly tell a chatbot apart from an agent (on the agent side, spell out which tool it uses and where it loops back). Task 2: Rewrite the vague instruction "Summarize the emails" so it includes a goal, an input, and a done condition — all three. Task 3: In the code skeleton below, mark the observe → think → act steps with comments, and add a stop condition that says when the loop should end. Task 4 (optional): Write a precise spec for a tool, including its input/output shape (e.g. searchNotes(query: string) -> {title, snippet}[]).

Code Example

text
// Task 3 အတွက် starter skeleton — comment ထည့်ပြီး ဖြည့်ပါ
function runAgentStep(state) {
  // 1) OBSERVE — ဘာကို ကြည့်နေတာလဲ? (tool result, user message, file...)
  const observation = getLatestInput(state);

  // 2) THINK — ဘာဆုံးဖြတ်မလဲ? goal ပြည့်ပြီလား၊ tool ထပ်ခေါ်ရမလား?
  const decision = decideNextAction(observation, state.goal);

  // 3) ACT — ဆုံးဖြတ်ချက်အတိုင်း tool ခေါ်တာလား၊ ရပ်တာလား?
  if (decision.type === "call_tool") {
    return callTool(decision.toolName, decision.input);
  }

  // TODO: stop condition တစ်ခု ထည့်ပါ — ဘယ်အချိန် loop ရပ်မလဲ?
  return decision;
}
You should see
You'll come away having written all three yourself: an Agent-vs-Chatbot example, a rewritten goal statement, and a skeleton with a stop condition.

5-minute try

Set a 5-minute timer and tackle just Task 1 and Task 2 first — don't open your code editor, write it out on paper.

A quick word of caution

There's no new concept in this lesson — if you get something wrong, go back and reread the earlier lessons before trying again. Don't just fill in an answer for the sake of it.

Easy traps

  • When writing a goal, just restating the purpose without a done condition (e.g. "make a good summary" — never defining what "good" actually means)
  • Writing a stop condition that only covers the success case and forgets the error case

Now try it yourself

Set a 5-minute timer and tackle just Task 1 and Task 2 first — don't open your code editor, write it out on paper.

You'll know it worked when: You'll come away having written all three yourself: an Agent-vs-Chatbot example, a rewritten goal statement, and a skeleton with a stop condition.

Practice — Agent Fundamentals | Thuta Learning