Module · AI Engineer
Agent Engineering
Tool calling, agent loops and the guardrails that keep them in check.
Tool Deep-Dive Available
View full architecture diagrams, CLI cheatsheets, and production gotchas.
Open Autonomous AI Agents Hub ↗TOPIC 01
Function Calling and Tool Definitions
Declare callable tool interfaces for LLMs using OpenAPI and JSON schema specs.
Function Calling and Tool Definitions
An AI Agent is an LLM embedded in a stateful control loop with the capability to perceive its environment, invoke external tools, and inspect execution feedback.
The Tool Schema Contract
Language models do not execute functions directly; they emit a structured request containing the tool name and validated arguments. The client runtime runs the tool and returns the observation back to the model.
{
"type": "function",
"function": {
"name": "query_database",
"description": "Execute a readonly SQL query against the customer inventory table",
"parameters": {
"type": "object",
"properties": {
"query": { "type": "string", "description": "Valid SQL SELECT statement" }
},
"required": ["query"]
}
}
}The ReAct Pattern (Reason + Act)
Modern agents operate via the ReAct framework:
- Thought: The model analyzes the current goal and past observations.
- Action: Emits a function call with parameters.
- Observation: Receives terminal output or API response.
- Repeat / Final Answer: Continues until the objective is accomplished or error recovery kicks in.
TOPIC 02
Agent Guardrails
Cap how long an agent loop may run and decide what happens when a tool call fails.
Agent Guardrails
An agent is a loop — think, call a tool, look at the result, repeat. Left unbounded, that loop can spin forever, burning tokens on the same failed step. Guardrails are the simple settings that bound it: a maximum number of iterations and a fixed policy for what to do when a call errors.
What you'll practice
- Bound an Agent Loop — guided · beginner
A command you'll meet
echo max_iterations=10 > agent.yamlOpen any task below to get the full step-by-step walkthrough — every command is explained, and the lab validator checks what you actually built.
TOPIC 03
Planning & Memory
How an agent decides what to do next, and what it remembers between the steps.
What you'll practice
- Design a Planning Loop — challenge · advanced
- Define an Agent Memory Store — practice · intermediate
A command you'll meet
cat ~/agents/planner.jsonAn agent without a plan is a very slow script. Open the task below for the full walkthrough.
Hands-On Tasks in This Topic (2)
Design a Planning Loop
The agent loop is plan, act, observe, repeat - with a hard ceiling. Write the loop configuration that keeps a run bounded and observable.
Define an Agent Memory Store
Short-term memory is the current task, long-term memory is what the agent learned. Define both, plus the rule that decides what is worth keeping.