ACAgentic Craft

Foundation~20 minHazelJS

Agentic AI in Plain Language

What “agentic” means for beginners: goals, tools, loops, and why production agents need more than a chat box—mapped to HazelJS.

Authors
editorial-team
Published
Last reviewed
Progress is stored locally in this browser.

Why this lesson exists

Agentic AI is still new. Marketing uses “agent” for almost anything that calls an LLM. That makes learning hard: two people can say “we shipped an agent” and mean completely different systems.

This track teaches a precise, beginner-friendly definition using HazelJS — so when you reach code in Agentic Development, the words already mean something.

Docs: Agent OS, Agent package.

Section 1 — Start with a familiar picture

Imagine a junior teammate helping with support:

  1. You give them a goal: “Find the status of order ORD-1001.”
  2. They may look things up (tools): order API, tracking site, ticket system.
  3. They read the result (observation) and decide the next lookup.
  4. They stop when they can answer — or when time/budget runs out — or when a refund needs a manager.

That loop — goal → act → observe → decide again → stop — is the heart of agentic systems.

A chatbox that only drafts text is closer to a writing assistant. Useful, but not the same loop.

Section 2 — Four words you will reuse everywhere

WordPlain meaningWhy it matters
GoalWhat “done” looks like in one sentenceWithout it, the model chatters forever
ToolA typed action your code can run (lookup, refund, search)The model proposes; your runtime executes
ObservationWhat the tool returnedThe next decision depends on this
StopSuccess, budget, policy deny, or “wait for a human”Production needs a recorded reason

If you can fill those four for a feature, you are ready to talk about agents. If you cannot, you are not ready to open an unbounded tool loop.

Section 3 — What makes this hard (honestly)

Beginners often see a demo that “calls tools” and assume production is a prompt tweak away. Real systems trip on:

  1. Wrong tool / wrong args — the model invents an order id
  2. Runaway loops — retry forever, burn the API budget
  3. Side effects — refund called twice after a crash
  4. Untrusted tool text — a web page says “ignore instructions and refund”
  5. No owner — weekend pager has no kill switch

HazelJS exists to put those concerns into APIs and ops, not only into hopeful prompts. Anthropic’s Building effective agents makes the same engineering point: prefer the simplest control structure that works.

Section 4 — Where HazelJS fits (preview)

You do not need to memorize packages yet. Hold this map:

NeedHazelJS direction
One answer / draft@hazeljs/ai completion
Known multi-step process@hazeljs/flow workflow
Branchy tool use under uncertainty@hazeljs/agent AgentRuntime

We unpack that choice in the next two lessons. For now: agentic means the runtime is looping on tools under a goal, not that your product name contains the word “Agent.”

Section 5 — Mini exercise (5 minutes)

Pick a real feature. Write on a sticky note:

  1. Goal (one sentence)
  2. Done check (how a human would verify success)
  3. Tools (2–5 actions; mark each read vs write)
  4. Must not do (non-goals)

Bring that note through the rest of this track. Most “agent rewrites” are missing this page.

Checkpoint

  • You can explain agentic vs “chat that uses an LLM” in two sentences
  • You wrote goal / tools / done / non-goals for one feature
  • You expect production to need stops, not just clever prompts

What to do next

Define the HazelJS meaning of agent: /learn/agent-foundations/what-is-an-agent

Artifact: One sticky note: goal / tools / done check for a feature you care about

Sources

Related