AI Agents
LLMs that decide which tools to call in a loop to accomplish a goal.
CurrentadvancedFull course available
Overview
AI agents extend an LLM with the ability to call external tools/functions and observe results in a loop, letting it decide the next step rather than following a fixed script -- useful for multi-step tasks, at the cost of needing careful guardrails since the model is making decisions, not just generating text.
- What it is
- An LLM-driven system that decides which tool to call next, observes the result, and repeats until a goal is met.
- Why it's used
- For tasks that need multiple steps or external actions (searching, calculating, calling an API) that a single generation can't complete alone.
- Where it fits
- Builds on prompt engineering and tool/function calling; this platform's own course includes a hand-written, deterministic agent-loop simulation with a rate limiter and bounded iteration count.
Core concepts
- Tool/function calling
- The agent loop (observe, decide, act)
- Bounding iterations (guardrails against infinite loops)
- Tool-use safety
Example
A hard iteration cap (MAX_STEPS) is a non-negotiable guardrail -- without it, a model stuck in an unproductive loop could call tools indefinitely.
let steps = 0;
while (steps < MAX_STEPS) {
const action = decideNextAction(state);
if (action.type === "done") break;
state = await runTool(action);
steps++;
}Common use cases
- Multi-step task automation
- AI assistants that need to search, calculate, or call APIs
- Customer support automation
Project ideas
- Design (on paper) an agent loop for a task like 'book a meeting,' listing each tool it would need and where the loop must be bounded