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
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:
- You give them a goal: “Find the status of order ORD-1001.”
- They may look things up (tools): order API, tracking site, ticket system.
- They read the result (observation) and decide the next lookup.
- 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
| Word | Plain meaning | Why it matters |
|---|---|---|
| Goal | What “done” looks like in one sentence | Without it, the model chatters forever |
| Tool | A typed action your code can run (lookup, refund, search) | The model proposes; your runtime executes |
| Observation | What the tool returned | The next decision depends on this |
| Stop | Success, 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:
- Wrong tool / wrong args — the model invents an order id
- Runaway loops — retry forever, burn the API budget
- Side effects — refund called twice after a crash
- Untrusted tool text — a web page says “ignore instructions and refund”
- 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:
| Need | HazelJS 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:
- Goal (one sentence)
- Done check (how a human would verify success)
- Tools (2–5 actions; mark each read vs write)
- 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