LRLearning RoadmapRead, build, evaluate
Modules

Module 05: AI Agents and Tool Calling

Module 05: AI Agents and Tool Calling Goal Build agents that use tools safely, validate actions, preserve state, support human confirmation, and create audit logs. Core Topics Tool

modules/05-ai-agents/README.md1 min read

Module 05: AI Agents and Tool Calling

Goal

Build agents that use tools safely, validate actions, preserve state, support human confirmation, and create audit logs.

Core Topics

  • Tool calling.
  • Function calling.
  • Agent loops.
  • Planning.
  • Memory and state.
  • Workflows.
  • Human-in-the-loop.
  • Multi-agent systems.
  • Model Context Protocol.
  • Agent evaluation.
  • Agent security.

Basic Agent Flow

User -> LLM -> Tool Selection -> Tool Execution -> Observation -> LLM -> Final Response

Production Agent Flow

User -> Authentication -> Authorization -> Intent -> Policy Check -> Agent -> Tool -> Validation -> Human Confirmation -> Execution -> Audit Log

Study Tasks

  • Build a calculator tool.
  • Build a database read tool.
  • Build a write tool that requires confirmation.
  • Add schema validation for tool inputs and outputs.
  • Add role-based tool authorization.
  • Add audit logs.
  • Add agent evaluation cases.
  • Add retry and failure handling.

Project

Build projects/05-erp-ai-agent/.

Safety Rules

  • Read operations may execute after validation and authorization.
  • Write operations require validation, preview, user confirmation, idempotency, execution, and audit.
  • Destructive operations require stronger confirmation and rollback planning.
  • Tool permissions must not rely on model behavior alone.

Tips

  • Prefer deterministic workflows when the process is predictable.
  • Use agents when flexible planning and tool selection are truly needed.
  • Keep tools narrow and well-typed.
  • Test malicious or ambiguous user requests.

Completion Checklist

  • Can explain agent vs workflow trade-offs.
  • Can implement tool calling.
  • Can secure tool execution.
  • Can require confirmation for writes.
  • Can evaluate agent task success.