Agent Architecture and Program Types in AI: A Worked Warehouse Example and Exam Traps

Separate architecture, program and agent function, then compare four program types through one fully worked warehouse routing problem.

KnowledgeGate Team

Exam prep & CS education

Updated 25 Oct 20266 min read

Agent architecture, agent program and agent function describe different layers. The same warehouse robot can host four program types; expected-utility routing, learning and messages show how those layers change its behaviour. For the wider syllabus, use the NET CS Exam category.

Agent architecture, agent function and agent program are different layers

An agent receives percepts through sensors and affects its environment through actuators. Its function is the abstract mapping f: P* -> A, where P* contains finite percept sequences and A is the action set.

A program implements that mapping on a machine or software architecture. Hence, agent = architecture + program.

R1 has a camera, position sensor, wireless receiver, processor, wheels and gripper. Its program receives p0 = (position=(1,1), east_clear=true, teammate_collision_risk=0.30) and returns SOUTH.

Layer

Question it answers

Architecture

What can sense, compute and act?

Program

How is the next action computed?

Function

Which action corresponds to every possible percept history?

A rational agent chooses the best expected action from available evidence. It does not know the future with certainty. The Intelligent and Rational Agents in AI guide develops PEAS determinants, Bayesian belief updates and coordination payoffs; R1's warehouse trace instead isolates architecture, the four program types and utility-based routing.

Data-flow figure for robot R1 showing camera and position sensors feeding the agent program, which sends the action SOUTH to the wheels.

PEAS and environment properties determine the required design

PEAS specifies the performance measure, environment, actuators and sensors. For our warehouse task:

  • Performance: +10 for delivery at goal G, -1 per move and -20 for a collision.

  • Environment: a 2 by 3 grid shared by cooperative robots R1 and R2.

  • Actuators: NORTH, SOUTH, EAST, WEST, WAIT and SEND.

  • Sensors: current cell, whether an adjacent cell appears clear and a teammate message.

The task is partially observable because R1 sees nearby cells only, stochastic because shortcut collision probability is 0.30, and sequential because actions change later states. It is dynamic because R2 moves, discrete because cells and actions are countable, and multi-agent because both robots affect each other. This pushes the design beyond a current-percept-only rule.

Multi-agent does not automatically mean cooperative. R1 and R2 cooperate here because they share the delivery performance measure. Give them separate rewards for reaching one exclusive dock first, and the same grid becomes competitive.

Four agent program types use different decision information

Program type

Information used

Internal state

Decision rule

Warehouse action

Simple reflex

Current percept

No

IF east_clear THEN EAST

EAST

Model-based reflex

Percept plus stored model

Yes

IF teammate_collision_risk >= 0.25 THEN SOUTH

SOUTH

Goal-based

State, actions and goal

Usually

Search for a sequence reaching G=(1,3)

Plan to G

Utility-based

Outcomes, probabilities and utility

Usually

Maximise expected utility

Compare two routes

A model-based reflex agent can remember an unseen obstruction without having a goal. A goal-based agent compares future states without ranking their desirability. A utility-based agent trades route length against collision risk.

All four can run on R1, so they are not four robot bodies. A model-based update may be state_t = update(state_(t-1), action_(t-1), percept_t). Check whether action depends only on percept_t, or also on stored state, a goal or utility.

Worked example: calculate route utility and break-even risk

The top row is S=(1,1), (1,2), G=(1,3). The bottom row is (2,1), (2,2), (2,3).

The shortcut is EAST, EAST, so it costs two moves. Its second east edge has collision probability 0.30, and the collision outcome includes both move costs.

  • Shortcut success: 10 - 2 = 8.

  • Shortcut collision: -20 - 2 = -22.

  • EU(shortcut) = 0.70(8) + 0.30(-22) = 5.6 - 6.6 = -1.0.

The safe detour is SOUTH, EAST, EAST, NORTH. It has four moves and zero collision probability, so its utility is 10 - 4 = 6. Since 6 > -1.0, the utility-based program selects the detour:

(1,1) -> (2,1) -> (2,2) -> (2,3) -> (1,3)

For collision probability p:

EU(shortcut) = (1-p)8 + p(-22) = 8 - 30p

Set it equal to 6: 8 - 30p = 6, so p = 2/30 = 1/15, approximately 0.0667. At p=0.05, utility is 8 - 30(0.05) = 6.5, so the shortcut wins. At p=0.30, it is 8 - 9 = -1.0, so the detour wins. These results belong to this performance measure, not every utility agent.

A 2 by 3 warehouse grid comparing the two-move shortcut at collision risk 0.30 against the four-move safe detour to goal G.

Learning agents and multi-agent messages change the policy

A learning agent separates four roles. The performance element chooses a route. The critic reports utility such as 8, -22 or 6. The learning element updates collision probability. The problem generator proposes safe exploration.

Learning is an overlay, not simply a fifth mutually exclusive program type. It can improve a reflex, model-based, goal-based or utility-based program.

After 10 shortcut attempts with 3 collisions, p_hat = 3/10 = 0.30. Then 8 - 30(0.30) = -1.0, so R1 prefers the detour. This estimate is not the only learning method.

R2 can send collision_risk=0.30; R1 stores it and recomputes the route. Alternatively, a central coordinator assigns both routes. Architecture, program, performance measure and protocol remain separate.

Common traps in architecture and program-type questions

  • Agent function is source code: false. The function is an abstract mapping; the program implements it.

  • Architecture is the policy: false. Architecture supplies the sensing, computation and action machinery.

  • Model-based means goal-based: false. Stored state does not prove that the agent searches for a goal.

  • A goal test represents cost and risk: false. It says whether a target state has been reached, not how alternatives are ranked.

  • Rational means omniscient: false. Rational action uses available evidence; omniscience would require the actual future outcome.

Simple reflex can be sufficient in a fully observable, static task. Learning does not prove utility reasoning, and communication does not prove cooperation. Classify cooperation by the performance measure and program type by percept-to-action logic.

How exams test agent architecture and program types

Expect definition matching, action traces and expected utility. Threshold 0.25 with stored risk 0.30 produces SOUTH; utilities -1.0 and 6 select the detour.

In an assertion-reason question, "The critic evaluates behaviour" is true, but "The critic selects every external action" is false. Selection belongs to the performance element.

Cue in the question

Likely program type

Current percept only

Simple reflex

Stored state or world model

Model-based reflex

Desired end state

Goal-based

Ranked outcomes or expected value

Utility-based

For the surrounding unit, use the UGC NET Computer Science syllabus areas guide. The UGC NET Computer Science high-yield topics guide helps prioritise revision. Once each classification cue is clear, practise by deriving the action from the available percept, stored state, goal or utility.

The short version and the next useful step

Simple reflex reacts. Model-based reflex remembers. Goal-based plans towards a target. Utility-based compares preferences under trade-offs. Learning updates behaviour from feedback.

Architecture provides the machinery, the program computes actions, and the agent function describes the complete percept-history-to-action mapping. As a final check, recompute the shortcut at p=0.10: 8 - 30(0.10) = 5. The safe route still wins because its utility is 6.

For a structured route through Artificial Intelligence and Multi Agent Systems within the wider syllabus, continue with NTA-UGC-NET Paper - 2. If you need only this concept, redraw the grid, trace all four program types and explain why the break-even risk is 1/15.