AI Foundations
Module 04
Foundation
The Order Assistant Agent: ThreadCo's most-requested feature: a chatbot that looks up an order number, checks its status, and gives the customer a real answer -- without staff involvement. This requires an agent that can query the order database as a tool. This module builds the pattern.

Agents & Tools

An AI agent is an LLM given the ability to take actions -- calling tools, reading files, browsing the web, executing code -- in pursuit of a goal. Agents represent the shift from AI as a conversational assistant to AI as an autonomous worker.

What Makes an Agent

An agent needs four components: a reasoning model (LLM), a set of tools it can invoke, a memory system (context window + optional external store), and an execution loop that runs until the task is complete or a stop condition is met.

Tool Use

Tools are functions the model can call at runtime. The model decides when to call them based on their descriptions. Common tools: web search, code execution, file read/write, database query, API calls. The model never executes tools itself -- your application does.

The Agentic Loop

User prompt -> LLM reasons -> emits tool_use block -> app executes tool -> returns tool_result -> LLM continues reasoning. This loop repeats until the model emits a final text response with no more tool calls.

Human-in-the-Loop

For any action that is irreversible -- sending emails, modifying databases, deploying code -- require human confirmation before execution. Agents with unchecked write access are a significant operational risk.

!
Minimal Footprint Principle

Always give agents the minimum permissions needed to complete the task. An agent that can read files does not need write access. An agent that queries a database does not need to be able to delete rows. Scope is everything.