Machine Learning pathway increased my salary by 40%
Fundamentals of AI Agents and Multi-Agent Architectures
An agent is not a smarter chatbot. It is a bounded operator that plans, acts through tools, observes results and stops when a condition is met. Everything that goes wrong in production can be traced to one of those four words being undefined.
This chapter sets out the anatomy of an AI agent as an engineering object: perception, reasoning, planning, action, memory and stopping conditions. It then explains how multiple agents are composed — sequential pipelines, supervisor hierarchies, peer networks and event-driven choreography — and what each composition costs in latency, token spend, coordination failure and auditability. It distinguishes autonomous, semi-autonomous and human-supervised operation as permission models rather than product categories, and sets out the lifecycle controls an HR function needs before a single agent touches an employee record.
What this covers
- Who this is for
- HR technology architects, automation engineers and technical product managers who must specify or review an agent design, plus HR leaders who need to interrogate a vendor's architecture claims in plain language.
- What it assumes
- Chapter 01, or equivalent familiarity with HR systems and processes. No coding required; the design concepts are expressed in terms of permissions, tools, states and evidence.
- What you will be able to do
- Write a one-page agent specification — goal, scope, tools, memory, stopping conditions, oversight, evidence — and choose a composition pattern that matches the process rather than the demonstration.
- Reading time
- About 24 minutes, including the knowledge check and question bank.
The anatomy of an agent
An agent has six identifiable components, and a design that omits any of them will behave unpredictably in production. Perception is how the agent receives its input: a user message, an uploaded document, a webhook payload from the HRIS, a scheduled trigger. Reasoning is the model's interpretation of that input against instructions and context. Planning is the decomposition of a goal into steps. Action is the invocation of tools. Memory is what the agent retains across steps and across sessions. And the stopping condition is the rule that ends execution — success, failure, escalation or a hard limit.
Most enterprise pilots specify the first two well and the last four badly. Planning is left implicit, so the agent improvises a sequence of five tool calls where one would do, or sequences a write before a read that would have shown the write was unnecessary. Memory is left to the model's context window, so a long case silently drops the earliest details. Stopping conditions are left to the prompt, so an agent that cannot complete a task loops until a token limit truncates it — which, in a system with write tools, is the moment incidents happen.
The corrective discipline is to treat an agent as an operational unit with a written specification. The specification states the goal in one sentence, the scope it may act on, the tools it may call with their permission level, the memory it may read and write, the conditions under which it must stop or escalate, the human approval points, and the evidence it must produce. A specification that fits on one page is reviewable by legal, risk and a works council; one that runs to forty pages is a symptom of undefined scope.
- Perception: the input channels an agent accepts — messages, documents, events, records.
- Reasoning: interpretation against instructions, policy context and retrieved evidence.
- Planning: decomposition of the goal into a bounded sequence with a maximum depth.
- Action: typed tool calls, each with an explicit permission level and side-effect classification.
- Memory: scoped persistence — session-only, case-scoped or long-term profile.
- Stopping condition: explicit success, failure, escalation and hard-limit rules.
If the agent's goal, tools, limits and stopping conditions cannot be stated on one page, the agent is doing too much. Split it, or resolve the ambiguity in the process before automating it. Ambiguity in the process always reappears as ambiguity in the prompt, and the prompt is the worst place to hold a policy decision.
Autonomous, semi-autonomous and supervised operation
Autonomy is routinely described as a product feature. In practice it is a permission model, and it should be set per action rather than per agent. The same agent that may read an employee record without asking may not write to it without a human committing; it may draft a policy answer but not send it to a works council; it may propose a shortlist but not reject a candidate. Splitting autonomy by action is what allows an HR function to gain the benefit of automation on reversible steps while retaining control of consequential ones.
Four permission levels cover most HR designs. Read permits retrieval only. Recommend permits the agent to produce a proposal that a human acts on. Act-with-approval permits the agent to prepare and stage a transaction that a human commits. Act permits the agent to commit within a defined envelope — value, class, jurisdiction — with after-the-fact review. Full autonomy over consequential employment decisions is not on that ladder, because accountability for those decisions cannot be delegated under current employment and data protection law in most jurisdictions.
An agent's permission level must be enforced by the platform, not by instruction. Telling a model not to write to payroll is a preference; removing the write tool is a control. The distinction matters for audit: a regulator asks what the system could do, not what it was asked to prefer. This is why tool scoping, identity and policy enforcement — covered in Chapters 30 and 31 — are architectural requirements rather than hardening steps.
- Read-only
- Retrieval and interpretation with no side effects. The lowest-risk starting point for any agent programme.
- Recommend
- The agent produces a proposal with its reasoning; a human decides and acts. Appropriate for screening, shortlisting and policy interpretation.
- Act with approval
- The agent stages a transaction; a human reviews and commits. Suitable for onboarding provisioning, payroll corrections and case closures.
- Act within an envelope
- The agent commits autonomously inside explicit limits — amount, jurisdiction, decision class — with sampling review afterwards.
Tool calling and enterprise API access
A tool is a declared capability with a name, typed inputs, typed outputs, a permission level and a side-effect classification. The quality of the tool surface determines both what the agent can achieve and what damage a mistake can cause. A retrieval tool is idempotent and reversible. A write to an employee record is neither. A payroll adjustment is a financial transaction. A message send is externally visible and irreversible. Those differences must be visible in the design, not discovered in an incident review.
Well-designed tool surfaces are narrow and semantic. Instead of exposing a general SQL query tool against the HRIS, expose 'get_employee_leave_balance(employee_id, period)' and 'list_pending_leave_requests(manager_id)'. Instead of a generic HTTP client, expose specific endpoints with validation. Narrow tools constrain what a compromised or confused agent can do, make evaluation tractable, and produce audit records that a human can read without a database background.
Tool design also determines cost and reliability. Every tool call is latency and spend, and each round trip is a chance to derail. Agents that succeed consistently tend to have few tools, precise descriptions and deterministic validation of arguments before the call executes. Where a tool can be made idempotent with a request key, it should be — retries are normal in agent execution, and a non-idempotent write tool turns an ordinary retry into a duplicate payment.
- Narrow semantic tools outperform generic database or HTTP access on safety and on evaluation tractability.
- Classify every tool: read, compute, stage, commit, notify — and assign permissions per class, not per agent.
- Validate arguments deterministically before execution; never rely on the model to enforce a range or an enum.
- Make write tools idempotent with request keys so retries cannot duplicate effects.
- Log tool name, arguments and outcome — not the full prompt — as the primary audit record.
Agent memory and contextual awareness
Memory in agent systems is not a single store. Session memory holds the current conversation and is discarded at the end. Case memory holds the artefacts of a specific process instance — the documents, the decisions, the tool results — and is retained for the audit period because it is the evidence. Long-term profile memory holds durable facts about a person or an organisation, and is where most privacy risk lives because it accumulates and is rarely reviewed.
The HR design constraint is that memory must be entitlement-scoped and purpose-limited. If an agent serving a line manager retrieves from a long-term store that includes details from an employee's medical leave case, the agent has just become a disclosure channel. Memory design therefore has to answer three questions separately for each tier: who may write, who may read, and how long it survives. Most implementations answer only the first.
Context engineering is the practice of assembling the right context at the right moment rather than maximising what fits. For an HR query, that usually means: the asker's identity and entitlements, the applicable policy documents, the employee's relevant record fields, and the prior state of the case — and nothing else. More context is not better; irrelevant context increases cost, latency and the probability of the model reasoning from the wrong evidence.
- Session memory
- Conversation-scoped context; discarded at the end of the interaction. Safe for drafts, unsafe as evidence.
- Case memory
- Process-scoped evidence store retained for the audit period. Must be immutable once the case closes.
- Profile memory
- Durable facts about a person or organisation. Highest privacy risk, requires purpose limitation and review.
- Context assembly
- Runtime selection of identity, policy, record and case context within a token budget — an engineering control, not a prompt trick.
Composition patterns and when each is justified
Sequential pipelines run agents in a fixed order — extract, classify, retrieve, draft, verify — with an explicit state between each step. They are the easiest to evaluate and audit, the cheapest to run, and the right default for HR document and case processing. Hierarchical designs add a supervisor that decomposes a goal and assigns subtasks to workers, which suits open-ended requests such as 'prepare everything for this new hire's first day'. Peer networks let agents address one another directly; they buy flexibility and cost predictability and auditability, and are rarely justified inside a governed HR process.
Two further patterns matter in practice. Event-driven choreography has agents react to domain events — employee hired, case opened, payroll cycle closed — without a central orchestrator, which fits loosely coupled enterprise architectures but makes end-to-end reasoning about a case much harder. Deliberative debate, where multiple agents argue and a judge selects, can improve quality on judgement tasks such as summarising conflicting evidence, at a multiple of the cost and with a new failure mode: consensus on a confidently wrong answer.
The selection rule is unglamorous. Use a sequential pipeline when the process has known stages. Use a supervisor only when the request is genuinely open-ended and the subtasks cannot be enumerated. Use choreography when the enterprise already runs on events and the process is naturally distributed. Avoid peer networks and debate in HR unless you can state precisely what control they improve and what the cost ceiling is.
- Sequential pipeline: deterministic order, explicit state, easiest to audit — default for HR casework.
- Supervisor–worker: dynamic decomposition for open-ended goals; adds coordination cost and non-determinism.
- Peer network: flexible, hard to trace, unpredictable spend — weak fit for governed processes.
- Event choreography: fits existing enterprise event buses; weakens case-level end-to-end reasoning.
- Debate and judge: quality upside on ambiguous judgement, several times the cost, and a consensus-on-error failure mode.
- Hybrid: deterministic orchestration owner with agent steps inside each state — usually the best enterprise answer.
Task decomposition, delegation and typed handoffs
Multi-agent quality is decided at the handoffs. When one agent passes work to another, it passes an artefact: a structured object with defined fields, provenance and a confidence indicator. If the handoff is loose prose, the receiving agent must re-interpret, and re-interpretation is where factual drift enters. A shortlisting agent that receives 'candidate looks strong for the role' cannot verify anything; one that receives a structured assessment with criterion-level scores and sources can.
Typed handoffs also make evaluation possible. Each artefact can be checked independently against a rubric, so a failing case can be localised to the agent that produced the defective artefact rather than attributed vaguely to 'the system'. This is the practical argument for narrower agents: they create checkpoints. The corresponding cost is that each checkpoint is a place where an error can be caught but also a place where the process can stall.
Delegation also needs limits: maximum depth, maximum fan-out, and a budget per case. Without them, a supervisor can spawn eleven workers on a leave-balance question. With them, the failure is bounded and the cost is predictable. Set the depth and budget from the process's real complexity, not from the platform's default, and revisit when the evaluation set shows the failure is systematic rather than incidental.
- Define the artefact schema for each handoff: fields, types, required provenance, confidence.
- Validate every artefact before the next agent consumes it; fail closed to a human rather than forward.
- Assign one agent accountable for each artefact, so defects have an owner.
- Cap delegation depth, fan-out and token spend per case in the orchestrator, not the prompt.
- Log artefacts as part of the case record — they are the audit trail and the debugging tool.
Agent lifecycle management
An agent has a lifecycle that most programmes manage informally and then regret: specification, build, evaluation, controlled pilot, production, monitoring, change and retirement. Each stage needs a gate and an artefact. Specification produces the one-page contract. Evaluation produces a versioned test set with a pass threshold. Pilot produces measured baseline and tail data. Production requires an owner, a change log, a monitoring dashboard and a kill switch.
Change management is the stage that fails most often. A prompt tweak, a model upgrade, a new tool, a policy document restructure — each is a behavioural change and each should trigger the evaluation suite before release. Treating prompt edits as configuration rather than as code is the single most common cause of silent degradation in production estates.
Retirement matters as much as launch. Agents accumulate: the pilot that answered leave questions, the experiment that summarised appraisals, the tool nobody documented. A register with owner, purpose, tool surface, data touched and review date keeps the estate governable. Without it, the enterprise cannot answer the simplest security question — what automation is currently able to act on employee data — and that is a finding in its own right.
- Every agent has a specification artefact, an evaluation set, an owner and a register entry.
- Prompt and model changes are behavioural changes and pass through the same gate as code.
- Monitoring covers quality distribution, escalation rate and cost per case — not uptime alone.
- A tested kill switch is a launch requirement, not a contingency plan.
- Retirement is planned: decommission, revoke credentials, archive the case evidence.
Tracing, logging and evaluating agent behaviour
An agent run is a distributed trace, and it should be instrumented like one. A single case may span a retrieval call, three tool invocations, two model calls and a human approval; without a correlation identifier attached to all of it, the only artefact is a conversation transcript that cannot be replayed. The trace is what allows an incident to be investigated, an evaluation failure to be localised, and a cost overrun to be attributed.
What to record is a governance decision as much as an engineering one. Record the tool name, the validated arguments, the outcome and the duration; record the model and prompt version, the token counts and the assembled context reference. Do not record full prompts and completions by default when they contain personal data — store references to the case artefacts and redact where content must be retained for debugging. Teams that log everything create a second, unmanaged personal data store with its own retention exposure.
Evaluation is the other half. Production tracing tells you what happened; an evaluation set tells you whether it was acceptable. The two together close the loop: sampled traces feed new cases into the set, failures become permanent regression cases, and every model, prompt or tool change is measured against them before release. Without the loop, quality management becomes anecdotal.
Cost belongs in the same trace. Tokens per step, retries per case, verification calls and escalation time together produce the true cost per completed case — the number that decides whether an agent remains in production a year later. Teams that track only aggregate spend cannot tell whether an expensive month was high volume or a pathological case class.
- Propagate one correlation identifier across orchestrator, agents, tools and record changes.
- Log tool names, validated arguments, outcomes and durations — not raw personal content by default.
- Record model, prompt and index versions with each run so behaviour is reproducible.
- Feed sampled production traces into the evaluation set and keep every failure permanently.
- Attribute token, retrieval, retry and escalation cost per case, not per month.
- Alert on behaviour change — escalation rate, refusal rate, retry clustering — not only on errors.
If you can answer five questions from the trace, it is sufficient: who asked, what the agent saw, what it decided, what it did, and what it cost. Every additional field should earn its retention risk.
Applying the fundamentals
The scenarios below are constructed to illustrate design choices; they are not reports of specific deployments.
A retail group with 26,000 employees wanted an agent to handle 'my payslip looks wrong' queries. The naive design was a single agent with read access to payroll and the ability to raise a correction. The design adopted split it into three: a query-understanding agent, a payroll retrieval and reconciliation agent that compared the payslip against the cycle record, and a drafting agent that produced an explanation with the differing line items cited. Corrections went to a payroll specialist with the reconciliation attached. The result was fewer escalations to payroll because explanations arrived with evidence, and a measured reduction in duplicate tickets.
A financial services firm wanted appraisal-cycle support. Their first design was a supervisor agent coordinating writing, evidence-gathering and calibration agents on open-ended requests — which produced inconsistent narratives and unpredictable spend. The redesign used a sequential pipeline: evidence gathering from objectives and feedback, then a structured draft with mandatory sections, then a consistency check against the calibration rubric, then human editing. Quality became measurable, cost became predictable, and the manager retained authorship.
Failure modes in agent design
The most common failure is the unbounded loop: an agent that cannot satisfy its goal retries variants until a limit truncates it. In read-only systems this is a cost problem; with write tools it becomes a duplicate-action problem. The fix is a hard step and spend cap in the orchestrator plus an explicit 'cannot complete' path that escalates with what was attempted.
The second is over-broad tooling, usually introduced to reduce integration work. A generic connector that can query any HR table gives the agent reach and gives the security team a permanent finding. The third is confident fabrication on policy: an agent that answers a leave question from general knowledge rather than from the indexed policy corpus, in a jurisdiction where the rule differs. Grounding, citation requirements and refusal behaviour are the controls, and they must be tested on adversarial questions.
The fourth is stale context: an agent that retrieves the superseded version of a policy because versioning sits with the document owner, not the platform. The fifth is authority confusion, where employees believe the agent speaks for the company on a matter it does not decide. Tone, disclaimers and escalation language are part of the control set, not the copywriting.
- Unbounded loops — cap steps, spend and depth; provide an explicit cannot-complete escalation path.
- Over-broad tools — narrow interfaces, least privilege, per-tool side-effect classification.
- Fabrication — require grounded retrieval with citations and a tested refusal behaviour.
- Stale context — corpus versioning with effective dates, and retrieval that respects them.
- Authority confusion — make the agent's role and escalation path explicit in its responses.
- Unmanaged multi-agent cost — budget per case and monitor the distribution, not the mean.
Key takeaways
An agent is defined by its loop, its tools and its limits. Autonomy is a per-action permission level enforced by the platform, not a property of a product. Multi-agent composition is a cost-benefit decision: specialisation buys testability and control, and charges coordination, latency and token spend.
The enterprise-ready pattern is a deterministic skeleton with probabilistic tissue — orchestration owning state, retries, evidence and timers, with agent steps inside states and typed artefacts at every handoff. Chapters 07 and 12 build that pattern in full.
- Six components must be specified: perception, reasoning, planning, action, memory, stopping condition.
- Autonomy is set per action: read, recommend, act with approval, act within an envelope.
- Tool surfaces are the primary security boundary; narrow, typed and idempotent by default.
- Memory must be entitlement-scoped and purpose-limited; case memory is the audit evidence.
- Sequential pipelines are the default for HR; supervisors only for genuinely open-ended goals.
- Typed handoff artefacts make multi-agent quality measurable and defects assignable.
5 questions to test the model
Which component is most often missing from an agent specification, and most often causes incidents?
An agent may retrieve payroll data but must have a human commit any correction. Which permission level is this?
Why prefer narrow semantic tools over a generic HRIS query tool?
A supervisor agent design produces inconsistent quality and unpredictable spend on appraisal support. What is the most likely remedy?
What makes case memory different from session memory in an HR agent design?
Questions this page answers
How do I know if I need one agent or several?
What is an 'agent envelope'?
Should the agent or the workflow engine own state?
How large should a tool surface be?
What does 'typed handoff' mean in practice?
How much memory should an HR agent have?
What is the risk of agent-to-agent conversation without a schema?
How do we test an agent before production?
What is a reasonable spend cap per case?
Does a bigger model solve reliability problems?
Can agents use RPA bots as tools?
How do agents interact with the HRIS without breaking it?
What governance artefact should exist per agent?
How do we prevent a multi-agent system from becoming unmaintainable?
What is the role of prompts if tools and orchestration carry the control?
How should we handle multilingual employees?
What changes when an agent must work across jurisdictions?
How do we retire an agent safely?
What is the single most valuable design habit?
What comes next in the course?
What does Read-only mean in Fundamentals of AI Agents and Multi-Agent Architectures (Autonomous, semi-autonomous and supervised operation)?
What does Recommend mean in Fundamentals of AI Agents and Multi-Agent Architectures (Autonomous, semi-autonomous and supervised operation)?
What does Act with approval mean in Fundamentals of AI Agents and Multi-Agent Architectures (Autonomous, semi-autonomous and supervised operation)?
What does Act within an envelope mean in Fundamentals of AI Agents and Multi-Agent Architectures (Autonomous, semi-autonomous and supervised operation)?
What does Session memory mean in Fundamentals of AI Agents and Multi-Agent Architectures (Agent memory and contextual awareness)?
What does Case memory mean in Fundamentals of AI Agents and Multi-Agent Architectures (Agent memory and contextual awareness)?
What does Profile memory mean in Fundamentals of AI Agents and Multi-Agent Architectures (Agent memory and contextual awareness)?
What does Context assembly mean in Fundamentals of AI Agents and Multi-Agent Architectures (Agent memory and contextual awareness)?
What does The anatomy of an agent explain about Fundamentals of AI Agents and Multi-Agent Architectures?
What does Autonomous, semi-autonomous and supervised operation explain about Fundamentals of AI Agents and Multi-Agent Architectures?
What does Tool calling and enterprise API access explain about Fundamentals of AI Agents and Multi-Agent Architectures?
What does Agent memory and contextual awareness explain about Fundamentals of AI Agents and Multi-Agent Architectures?
What does Composition patterns and when each is justified explain about Fundamentals of AI Agents and Multi-Agent Architectures?
What does Task decomposition, delegation and typed handoffs explain about Fundamentals of AI Agents and Multi-Agent Architectures?
What does Agent lifecycle management explain about Fundamentals of AI Agents and Multi-Agent Architectures?
What does Tracing, logging and evaluating agent behaviour explain about Fundamentals of AI Agents and Multi-Agent Architectures?
What does Applying the fundamentals explain about Fundamentals of AI Agents and Multi-Agent Architectures?
What does Failure modes in agent design explain about Fundamentals of AI Agents and Multi-Agent Architectures?
What does Key takeaways explain about Fundamentals of AI Agents and Multi-Agent Architectures?
Which risks or limitations apply to The anatomy of an agent in Fundamentals of AI Agents and Multi-Agent Architectures?
Sources and standards
- NIST AI Risk Management Framework (AI RMF 1.0)
Govern, Map, Measure, Manage framing used for agent risk classification.
- NIST AI 600-1 — Generative AI Profile
Risk catalogue including confabulation, information integrity and human-AI configuration.
- ISO/IEC 42001:2023 — AI management system
Lifecycle and role requirements that map onto the agent lifecycle in this chapter.
- Model Context Protocol specification
Standard interface for exposing tools and context to models; capability and version detail changes frequently — verify before design decisions.
- LangGraph documentation — stateful agent orchestration
Reference implementation of durable, stateful agent graphs with checkpointing.
- Microsoft AutoGen — multi-agent conversation framework
Peer and supervisor conversation patterns; useful for understanding coordination trade-offs.
- CrewAI documentation
Role-based agent collaboration with task delegation; compare against pipeline patterns.
- OWASP Top 10 for Large Language Model Applications
Prompt injection, excessive agency and supply-chain risks referenced in the failure-mode section.
Continue through the chapters
The programme continues with the HR technology landscape, operating models, foundation models, memory and knowledge engineering, then orchestration, integration and deployment.
Continue this lesson with a subscription
Multi-Agentic AI HR Tech Automations is part of the paid catalogue. You have read the free preview. A subscription opens the rest of this lesson, the classroom slides and the assessment questions.
- The full lesson for this topic and every other catalogue topic
- Every classroom slide deck and worked example
- All assessments, with a verifiable certificate on completion
The Free-To-Learn library stays open to everyone and is not affected by this.
