Skip to content

Part VI — AI Agents

Learn how to design and operate AI agents that can reason about goals, use tools, maintain state, and execute tasks reliably within enterprise systems.

AI Agents Banner

Overview

A conventional LLM application typically responds to a request. An AI agent can go further: it can decide what information it needs, select an available action, call a tool, inspect the result, and determine what to do next.

A simplified execution loop looks like this:

Goal
  ↓
Reason and plan
  ↓
Select an action
  ↓
Call a tool
  ↓
Observe the result
  ↓
Update state
  ↓
Continue, revise, or finish

This Part focuses on the engineering foundations of an individual agent: its reasoning and execution model, tools, memory, communication, evaluation, security, and runtime. The emphasis is on building agents as dependable software components—not simply connecting an LLM to a collection of APIs.

The progression is deliberate:

Understand the agent
        ↓
Plan and reason
        ↓
Use tools
        ↓
Maintain memory
        ↓
Communicate
        ↓
Evaluate and observe
        ↓
Secure and deploy

The material is intended for software and backend engineers, AI engineers, cloud engineers, and solution or enterprise architects.

What you will learn

By working through this Part, you will learn to:

  • Explain the architecture and execution lifecycle of an AI agent.
  • Design planning, task-decomposition, reasoning, reflection, and self-correction patterns.
  • Build tools and understand manual and framework-assisted tool calling.
  • Select memory models and design storage, retrieval, compression, and optimisation strategies.
  • Apply message-passing, shared-memory, event-driven, and publish-subscribe communication patterns.
  • Coordinate agent interactions and reason about negotiation and conflict resolution.
  • Evaluate agent behaviour and task completion.
  • Instrument agent runs with logs, traces, metrics, debugging, cost monitoring, and alerts.
  • Apply authentication, authorisation, secrets management, privacy controls, sandboxing, guardrails, and risk management.
  • Design agent runtimes and production deployments that account for concurrency, latency, failures, and scaling.

Learning path

Part VI is organised into six engineering areas. Follow the chapters in sequence; each area builds on the concepts introduced earlier.

flowchart TD
    A["01 · Agent Fundamentals"] --> B["02 · Agent Memory"]
    B --> C["03 · Agent Communication"]
    C --> D["04 · Agent Observability"]
    D --> E["05 · Agent Security"]
    E --> F["06 · Agent Deployment"]
    F --> G["Enterprise Agent Architecture"]

01 — AI Agent Fundamentals

Start with the agent execution model: how an agent interprets a goal, reasons about possible actions, plans work, invokes tools, and responds to results. The later chapters move from core concepts into practical tool integration, design patterns, and enterprise architecture.

Chapter Status
01. AI Agent Fundamentals ✅
02. Tool Calling & Function Calling ✅
03. Building & Orchestrating Tools ✅
04. ICL & Manual Tool Calling ✅
05. LangChain Built-in Agents ✅
06. AI Agent Design Best Practices ✅
07. Enterprise AI Agent Architecture ✅
08. Planning & Task Decomposition ✅
09. Agent Reasoning ✅
10. Reflection & Self-Correction ✅

An agent's execution is often iterative rather than strictly linear:

                  ┌──────────────┐
                  │     Goal     │
                  └──────┬───────┘
                         ↓
                  ┌──────────────┐
                  │   Reason     │
                  └──────┬───────┘
                         ↓
                  ┌──────────────┐
                  │    Plan      │
                  └──────┬───────┘
                         ↓
                  ┌──────────────┐
                  │ Select Tool  │
                  └──────┬───────┘
                         ↓
                  ┌──────────────┐
                  │ Execute Tool │
                  └──────┬───────┘
                         ↓
                  ┌──────────────┐
                  │   Observe    │
                  └──────┬───────┘
                         ↓
                  ┌──────────────┐
                  │ Evaluate     │
                  └──────┬───────┘
                         └──────→ Continue, revise, or finish

The focus is on observable reasoning behaviour and system decisions, not exposing private model reasoning.

02 — Agent Memory

An agent needs access to relevant context while it works. Some information is temporary and belongs to the current task; other information may need to persist across interactions. This section examines the memory models and engineering patterns used to manage that distinction.

Chapter Status
01. Agent Memory Overview ✅
02. Short-Term Memory ✅
03. Long-Term Memory ✅
04. Working Memory ✅
05. Episodic Memory ✅
06. Semantic Memory ✅
07. Memory Storage Patterns ✅
08. Memory Retrieval Patterns ✅
09. Memory Compression ✅
10. Memory Optimization ✅

The chapters move from memory concepts and types to the practical concerns of storing, retrieving, compressing, and managing context. The aim is to treat memory as an explicit part of agent architecture—not as an unlimited conversation history.

03 — Agent Communication

Agents may need to exchange information with other agents or services. This section introduces the communication patterns that support those interactions, while keeping the focus on the communication foundations of an individual agent system.

Chapter Status
01. Agent Communication Overview ✅
02. Message Passing ✅
03. Shared Memory ✅
04. Event-Driven Agents ✅
05. Publish-Subscribe Pattern ✅
06. Agent Coordination ✅
07. Agent Negotiation ✅
08. Conflict Resolution ✅
Agent A
   │
   │ Message or event
   ▼
Communication layer
   ├── Agent B
   ├── Agent C
   └── External service
          │
          ▼
        Results

These patterns prepare you for the broader collaboration and orchestration architectures explored in Part VII.

04 — Agent Observability

An agent run can involve multiple model calls, tool invocations, state changes, retries, and decisions. A final response alone does not tell an operator what happened along the way. Observability makes that execution inspectable and measurable.

Chapter Status
01. Agent Observability Overview ✅
02. Agent Logging ✅
03. Agent Tracing ✅
04. Agent Monitoring ✅
05. Agent Metrics ✅
06. Agent Debugging ✅
07. Agent Evaluation Metrics ✅
08. Agent Cost Monitoring ✅
09. Agent Alerting ✅
10. Agent Evaluation ✅

Key signals include run outcomes, model and tool latency, errors, retries, token usage, cost, and relevant state transitions. Together, logs, traces, and metrics help teams understand behaviour, investigate failures, and operate agents against defined service expectations.

05 — Agent Security

An agent may access enterprise data and invoke tools that change business systems. Its security boundary therefore extends beyond the model prompt: identity, permissions, data access, tool execution, and runtime isolation all matter.

Chapter Status
01. Agent Security Overview ✅
02. Prompt Injection ✅
03. Tool Security ✅
04. Agent Authentication ✅
05. Agent Authorization ✅
06. Secrets Management ✅
07. Data Privacy ✅
08. Agent Sandboxing ✅
09. Agent Guardrails ✅
10. Agent Risk Management ✅

The objective is controlled, auditable autonomy. Security controls should be enforced at the relevant boundaries—especially before sensitive data is accessed or a tool performs a consequential action.

06 — Agent Deployment

The final section moves from agent design to the runtime and operational architecture needed to run agents reliably. It covers execution, scaling, resilience, and production deployment.

Chapter Status
01. Agent Deployment Overview ✅
02. Agent Runtime & Execution ✅
03. Agent Scaling & Resilience ✅
04. Production Agent Deployment ✅

Production design must account for concurrent requests, long-running executions, model and tool latency, timeouts, retries, failure recovery, queue-based processing, backpressure, rate limits, and resource isolation.

A simplified deployment view:

Client
  ↓
API / Agent Gateway
  ↓
Agent Service and Runtime
  ├── Model gateway
  ├── Tool services
  ├── Memory services
  └── Execution state
  ↓
Logs · Traces · Metrics
  ↓
Enterprise systems

Bringing the pieces together

The six areas form a connected engineering system. Planning and tools determine what an agent can do; memory and communication provide context and interaction; evaluation and observability help establish whether it behaves as expected; security constrains what it is allowed to do; and the runtime makes execution dependable.

flowchart TD
    U["User or Trigger"] --> G["Agent Gateway"]
    G --> I["Identity and Access Controls"]
    I --> A["AI Agent"]
    A --> P["Planning and Reasoning"]
    A --> M["Memory"]
    A --> T["Tools and Services"]
    P --> X["Agent Runtime"]
    M --> X
    T --> X
    X --> E["Evaluation"]
    X --> O["Logs, Traces and Metrics"]
    E --> S["Policy and Guardrails"]
    S --> D["Enterprise Systems"]

How Part VI fits into the handbook

Part V focuses on retrieving and grounding knowledge. Part VI builds on that foundation by introducing agents that can use retrieval, tools, memory, and APIs as part of a goal-directed execution loop.

Part V · Advanced RAG
        ↓
Grounded knowledge
        ↓
Part VI · AI Agents
        ↓
Intelligent task execution
        ↓
Part VII · Agentic AI & Multi-Agent Systems
        ↓
Autonomous collaboration and orchestration
        ↓
Part VIII · AI Engineering Frameworks & Tooling
        ↓
Framework and protocol implementations

Scope boundary: Part VI concentrates on the foundations and engineering of individual agents. Part VII expands into autonomous workflows, multi-agent collaboration, supervision, Agentic RAG, enterprise agent platforms, and agent communication protocols such as A2A. Framework-specific implementation belongs in Part VIII.

Chapter Navigation

⬅️ Previous: Part V — Advanced Retrieval-Augmented Generation

📚 Current: Part VI — AI Agents

➡️ Next: Part VII — Agentic AI & Multi-Agent Systems

Start learning

Begin with 01. AI Agent Fundamentals, then follow the six sections in order.

The goal: Design AI agents that can reason, plan, use tools, maintain memory, communicate, evaluate their results, operate securely, and run reliably as enterprise software.


Enterprise AI Engineering Handbook

Building Production-Grade Enterprise AI Systems — One Chapter at a Time.