2. Intelligent Agents and AI Problem FormulationIntroduction and ContextArtificial intelligence becomes useful when it is connected to a task, an environment, and a criterion for success. Algorithms alone do not define an intelligent system. A search procedure, predictive model, recommender, or conversational system becomes part of an AI solution only when it receives information, selects or supports actions, and produces outcomes that can be evaluated. This chapter introduces two closely related foundations. The first is the idea of an intelligent agent: an entity that perceives its environment and acts within it. The second is AI problem formulation: the disciplined process of translating an ambiguous real-world requirement into a formal computational task. These foundations are essential because many AI failures originate not in poor coding or inadequate model complexity, but in unclear objectives, inappropriate data, missing constraints, or an incomplete understanding of the environment. A manager may ask for a system to “improve customer retention.” That request does not yet specify whether the system should predict churn, recommend interventions, optimize incentives, plan communication, or generate personalized messages. Each interpretation requires different data, actions, evaluation criteria, and governance arrangements. Effective AI practice therefore begins before model training: it begins with understanding the agent, the problem, and the decision context. Learning ObjectivesAfter studying this chapter, you should be able to: 1. Explain the concepts of agents, environments, perceptions, actions, states, goals, utility, and performance measures. 2. Distinguish rationality from omniscience and explain how rational behaviour depends on available information and computational resources. 3. Describe important types of task environments and their implications for AI design. 4. Formulate real-world problems as prediction, classification, optimization, recommendation, planning, or generation tasks. 5. Identify decision variables, objectives, constraints, assumptions, stakeholders, and success criteria. 6. Analyse trade-offs among accuracy, cost, fairness, safety, interpretability, and operational feasibility. 7. Recognize common formulation errors and apply best practices to professional AI projects. From Intelligent Behaviour to the Agent ModelAn agent is an entity that perceives its environment through sensors and affects that environment through actuators. In a physical robot, cameras, microphones, and proximity sensors may provide perceptions, while motors and grippers provide actions. In a software system, input records, application programming interfaces, user interactions, and databases function as information channels; recommendations, alerts, approvals, or transactions are possible actions. The agent function maps a history of perceptions to an action: f: P* → A Here, P* represents all possible sequences of perceptions and A represents the set of available actions. The agent function is an abstract description of behaviour. An agent program is its practical implementation on a computer or other platform. This distinction matters because two systems may receive the same information but implement different policies, and therefore make different decisions. A perception is the information received at a particular time. A percept sequence is the complete history available to the agent. An agent need not have access to the complete state of the world. It may operate under partial observability, uncertainty, delays, or noisy measurements. For example, a fraud-detection system cannot directly observe whether a transaction is genuinely fraudulent. It observes features such as location, amount, device, timing, and account history, and estimates the hidden condition. An action is an intervention selected by the agent. In a recommendation system, displaying an item is an action; in a logistics system, assigning a vehicle to a route is an action; in a medical decision-support system, presenting a risk estimate or requesting further examination may be an action. The effect of an action depends on the environment. A route recommendation may change a traveller’s behaviour, while an automated price change may alter demand and competitor responses. Rational AgentsA rational agent selects the action expected to maximize its performance measure, given the percept sequence and the knowledge available to it. Rationality is therefore conditional, not absolute. An agent is not expected to know facts that it could not observe, nor to predict events that were inherently unforeseeable. It should choose the best action supported by its information, objectives, and computational resources. Rationality should not be confused with omniscience. An omniscient agent would know the actual consequences of every action. A rational agent acts under uncertainty and may still experience an unfavourable outcome. For instance, a credit-risk model may correctly estimate that a borrower is likely to repay, yet an unexpected economic shock may produce default. The rationality of the decision must be judged using the information and probabilities available when it was made, not solely by its later outcome. Rational behaviour also requires information gathering when information has value. A delivery agent may choose to inspect traffic conditions before dispatching a vehicle. A diagnostic system may recommend an additional test because the result could change treatment. This is a form of information-seeking action. The cost of acquiring information must be compared with the expected improvement in decision quality. Performance Measures, Goals, and UtilityA performance measure specifies how success is evaluated from the perspective of the external task. It should describe desirable outcomes rather than merely internal activity. For an autonomous vehicle, safety, legality, travel time, passenger comfort, and energy use may all be relevant. For a recommendation system, clicks alone may be inadequate; long-term satisfaction, diversity, retention, and commercial value may also matter. A goal describes a desired condition, such as reaching a destination, approving a legitimate transaction, or assigning staff to required shifts. A performance measure is broader: it evaluates the quality of behaviour over time. An agent may achieve a goal but perform poorly overall. A route planner that reaches every destination but consumes excessive fuel has satisfied a narrow goal while failing a broader performance measure. Utility provides a formal way to represent preferences among possible outcomes. A utility function assigns values to outcomes or sequences of outcomes. It allows an agent to compare alternatives involving trade-offs. For example, a hospital scheduling system may value reduced waiting time, equitable access, efficient use of operating rooms, and clinician workload balance. A weighted utility function can express these preferences, although the weights themselves require careful stakeholder justification. Performance measures and utility are not automatically identical. A performance measure may be defined externally by an evaluator, whereas a utility function is the agent’s internal representation of preferences. In practical AI, both must be examined. Optimizing a poorly selected proxy can create harmful behaviour. If a platform optimizes only viewing time, it may promote sensational or divisive content even when the organizational objective is trustworthy and beneficial engagement. Task Environments and Their ConsequencesThe task environment is the external setting in which an agent operates. A useful description follows the PEAS framework: Performance measure, Environment, Actuators, and Sensors. For an online retail recommender, the performance measure might include relevant purchases, customer satisfaction, margin, diversity, and privacy compliance. The environment includes customers, products, inventory, prices, competitors, and the website. Actuators include ranked product displays, notifications, and promotional offers. Sensors include browsing behaviour, purchase history, product attributes, and feedback. Task environments differ in ways that strongly influence system design. Fully observable versus partially observable. In a fully observable environment, the relevant state is available to the agent. Most real-world business and social settings are partially observable. Missing data, privacy restrictions, sensor noise, and hidden intentions create uncertainty. Deterministic versus stochastic. In a deterministic environment, the next state is completely determined by the current state and action. In a stochastic environment, outcomes involve uncertainty. Demand forecasting, medical diagnosis, and financial decisions are stochastic. Episodic versus sequential. In an episodic task, each decision is relatively independent. Image classification is often treated as episodic. In a sequential task, current actions affect future states and decisions. Inventory management, education, and autonomous navigation are sequential. Static versus dynamic. A static environment does not change while the agent deliberates. A dynamic environment changes continuously or because other agents act. Real-time fraud detection, traffic control, and algorithmic trading require attention to delay and changing conditions. Discrete versus continuous. Discrete environments involve countable states, times, or actions. Chess is discrete. Robot motion, energy consumption, prices, and time are often continuous or approximately continuous. Single-agent versus multi-agent. In a single-agent task, the primary challenge is interaction with the environment. In multi-agent settings, other agents may cooperate, compete, learn, or strategically respond. Marketplaces, auctions, negotiations, and social platforms are multi-agent environments. These properties are not merely labels. Partial observability may require state estimation; stochasticity may require probability models; sequential decisions may require planning or reinforcement learning; and multi-agent interaction may require incentive analysis and strategic reasoning. States, Actions, Goals, and Models of the WorldA state is a representation of the relevant conditions of the environment at a particular time. The phrase “relevant” is important. A state representation need not reproduce every detail of reality; it must preserve the information needed for decision-making. A warehouse state may include inventory levels, open orders, vehicle locations, and staffing capacity, while excluding irrelevant visual details. A state transition model describes how actions change states. In a deterministic model, a transition function may be written as: Result(s, a) = s' where action a applied in state s produces state s'. In an uncertain environment, the model may instead specify a probability distribution over possible successor states. Accurate transition models support planning, simulation, and what-if analysis, but model errors can lead to fragile decisions. The initial state identifies where problem solving begins. The goal test determines whether a state satisfies the required objective. The path cost measures the resources consumed by a sequence of actions. In route planning, the goal may be reaching a destination, while path cost could combine distance, tolls, travel time, and risk. A solution is not simply any sequence reaching the goal; it is generally a sequence that meets constraints and is preferred according to cost or utility. Formulating Real-World Problems as AI TasksProblem formulation is the bridge between organizational intent and computational design. It should begin with the decision or outcome that must improve, not with a preferred algorithm. A useful formulation identifies: - the decision-maker or agent;
- the stakeholders affected by decisions;
- the current and desired states;
- available actions and decision timing;
- observable and unobservable information;
- objectives and performance measures;
- hard constraints that cannot be violated;
- soft preferences that can be traded off;
- risks, ethical requirements, and escalation rules; and
- the data and feedback required for evaluation.
A practical formulation separates the target, the action, and the outcome. A target is what the system estimates, such as probability of churn. An action is what someone does with that estimate, such as offering retention support. An outcome is what eventually happens, such as continued use, cost incurred, or customer satisfaction. Confusing these elements often leads to models that predict well but do not improve decisions. Prediction and ClassificationPrediction estimates an unknown or future value. Demand forecasting, delivery-time estimation, and energy-load prediction are examples. The output may be continuous, categorical, probabilistic, or a distribution over possible outcomes. Classification assigns an observation to one or more categories. Examples include identifying fraudulent transactions, classifying support requests, or determining whether an image contains a defect. A binary classifier has two classes, while multiclass and multilabel problems involve more alternatives or simultaneous labels. The formulation must specify the prediction horizon, unit of analysis, available information at decision time, and cost of errors. In medical screening, a false negative may be more serious than a false positive. In spam filtering, excessive false positives may prevent important communication. Accuracy alone therefore rarely provides an adequate success criterion. OptimizationOptimization selects values for decision variables to maximize or minimize an objective subject to constraints. Examples include allocating budgets, scheduling staff, routing vehicles, and determining production quantities. A general formulation is: maximize or minimize U(x) subject to gᵢ(x) ≤ 0 and hⱼ(x) = 0, where x represents decisions, U is the objective, and g and h represent constraints. Constraints may involve capacity, legal requirements, service levels, safety, fairness, or budget. Optimization is especially appropriate when the central question is “What should we do?” rather than “What is likely to happen?” RecommendationRecommendation systems rank or select items, actions, or information for a user or organization. The task may involve predicting relevance, optimizing a sequence, or balancing immediate response with long-term value. A formulation should include the user’s objective, item availability, exposure effects, diversity requirements, business constraints, and feedback mechanisms. A recommendation is an intervention, not a neutral forecast. Showing an item changes what the user sees and may influence future data. This feedback loop creates risks of popularity reinforcement, filter bubbles, and unfair exposure. Evaluation should therefore consider both immediate response and longer-term user and societal outcomes. Planning and Sequential Decision-MakingPlanning constructs an action sequence that moves an agent from an initial state toward a goal. Examples include production planning, robot navigation, project scheduling, and emergency response. The formulation must specify state variables, actions, transition rules, goals, resources, temporal requirements, and contingencies. When the environment is uncertain or changes in response to actions, planning becomes sequential decision-making. The agent may need to replan as new information arrives. This is common in logistics and operations, where an apparently optimal initial plan can become unsuitable because of delays, demand changes, or equipment failure. GenerationGenerative tasks produce new text, images, code, designs, summaries, or other artefacts. Formulation requires more than describing the desired format. It should define the intended use, source and quality of information, style, factuality requirements, human review, prohibited content, intellectual-property boundaries, and evaluation criteria. For a report-generation system, success may involve factual accuracy, relevance, completeness, readability, citation quality, confidentiality, and time saved. Fluency alone is not sufficient. Generated content may sound plausible while being incorrect, biased, or inappropriate for the decision context. From Business Request to Technical SpecificationA useful workflow has five connected stages. First, clarify the organizational decision: who must decide, when, and with what consequences. Second, describe the environment and the agent’s role, including available actions and feedback. Third, select the task formulation—prediction, classification, optimization, recommendation, planning, generation, or a combination. Fourth, define objectives, constraints, baselines, and evaluation methods. Fifth, assess deployment, monitoring, governance, and the possibility of unintended effects. Consider the request, “Use AI to reduce employee turnover.” Possible formulations include predicting which employees are at risk, identifying factors associated with departure, optimizing retention-program allocation, recommending career interventions, or generating personalized development plans. These are not interchangeable. Prediction may support prioritization but does not establish causation. Optimization requires reliable estimates of intervention effects and costs. Recommendations require employee consent, fairness safeguards, and evaluation of unintended pressure. The formulation should also define the unit and time point of decision. Is the system making one decision per employee per quarter, one per customer interaction, or one per transaction? What information was available at that point? Using information recorded after the decision creates leakage and gives an unrealistic estimate of performance. Detailed Applied Case: AI-Assisted Urban Delivery PlanningBackgroundThis illustrative case concerns a regional retailer delivering groceries from several fulfilment centres to customers. Management wants to reduce late deliveries and fuel expenditure while maintaining service commitments. Situation and ProblemThe initial request is to “build an AI route optimizer.” The operations team reports that late deliveries arise from traffic, inaccurate preparation times, vehicle capacity limits, driver availability, and changing customer time windows. A route that is shortest in distance may not be best if it passes through congestion or causes a driver to miss several delivery windows. Analysis and FormulationThe agent is the delivery-planning system working with dispatchers. Its sensors include order locations, promised time windows, vehicle capacities, driver schedules, road conditions, estimated preparation times, and historical delivery data. Its actuators are route assignments, delivery sequences, dispatch times, and alerts requesting human intervention. The environment is partially observable because future traffic and preparation delays are uncertain. It is dynamic because new orders, cancellations, road closures, and vehicle problems occur during the day. It is sequential and multi-agent: early assignments affect later capacity, while drivers, customers, suppliers, and traffic authorities influence outcomes. The problem combines several AI tasks. A predictive component estimates preparation time and travel time. An optimization component assigns orders to vehicles and sequences stops. A planning component revises routes when conditions change. The objective is not simply to minimize distance. A more suitable utility function balances on-time delivery, fuel, overtime, customer inconvenience, and operational stability. Hard constraints include vehicle capacity, driver working limits, legal requirements, and promised delivery windows where commitments are binding. Soft constraints include preferred workload balance and reduced route changes. The baseline is the existing dispatcher process and a conventional shortest-route method. Evaluation should use historical replay and controlled operational trials, measuring on-time rate, fuel per order, planning time, route changes, and driver acceptance. Approach and SolutionThe organization first deployed travel-time and preparation-time forecasts as decision support rather than fully autonomous routing. Dispatchers reviewed predictions and corrected unusual cases. After data-quality issues were resolved, an optimization model used forecast distributions rather than single point estimates, allowing it to account for uncertainty. A rolling-horizon planner re-optimized only when changes were material, reducing unnecessary disruption to drivers. Governance rules prevented the system from assigning unsafe schedules or systematically overloading particular drivers. An explanation interface displayed the principal reasons for a route recommendation, such as a narrow time window or predicted congestion. Exceptions were escalated to a human dispatcher. Outcome and Learning PointsThe central learning is that the project was not one model but a coordinated agent system. Predictive accuracy was important, yet insufficient. The value came from connecting forecasts to feasible decisions, explicit constraints, operational workflows, and monitoring. The case also demonstrates why AI formulation should begin with the operational objective and not with the label “route optimizer.” Professional and Managerial ImplicationsManagers are responsible for ensuring that AI objectives reflect organizational purpose rather than convenient proxies. They must decide which errors are tolerable, who bears the risk, and when human review is required. Technical teams need domain experts who understand data-generating processes, exceptions, and operational constraints. At the organizational level, AI systems should have an accountable owner, documented objectives, data lineage, version control, monitoring procedures, and an incident-response process. Deployment changes the environment: users adapt, incentives shift, and data distributions may drift. A model that performed well during development may become unreliable after policy, market, or behavioural changes. AI formulation also affects investment decisions. A simple rules-based process may be preferable when the environment is stable and the consequences are low. A sophisticated model may be justified when uncertainty, scale, or complexity creates substantial value. The relevant comparison is not between “AI” and no technology, but between feasible alternatives, including human judgement and existing processes. Challenges, Risks, and Common MistakesOne common mistake is treating a vague business objective as a complete technical specification. “Improve efficiency” does not identify whose efficiency, measured how, or at what cost. A second is optimizing a proxy that is easy to measure but poorly aligned with welfare or strategy. A third is ignoring actions and modelling only outcomes. Prediction without a decision pathway may have little practical value. Other frequent problems include data leakage, selection bias, incomplete representation of affected groups, unstable labels, and evaluation on data that does not reflect deployment. Teams may also underestimate feedback loops. If a fraud model causes certain transactions to receive additional checks, the resulting data no longer represents an untreated population. If a recommendation engine promotes certain products, their increased sales may appear to validate the original recommendation. Uncertainty must be communicated, especially when decisions affect health, employment, credit, education, or public services. A probability is not a certainty, and a high-performing model may still be inappropriate if the action it triggers is unfair or legally impermissible. Human review is not automatically a solution; reviewers require authority, time, training, and meaningful information. Ethical, Governance, and Regulatory ConsiderationsResponsible formulation requires attention to affected persons, not only system users or paying clients. Key questions include whether the data was collected lawfully, whether individuals understand relevant uses, whether sensitive attributes or proxies create discrimination, and whether people can challenge consequential decisions. Fairness cannot be reduced to one universal metric. Different definitions may conflict, and the appropriate assessment depends on the decision, population, legal setting, and harms at stake. Privacy-preserving data practices, access controls, minimization, retention limits, and secure processing are essential. Generative systems require additional controls for confidential information, fabricated content, copyright, provenance, and misuse. Governance should define purpose limitation, accountability, auditability, monitoring, documentation, and procedures for suspension. In high-impact applications, the organization should conduct impact assessments before deployment and maintain a clear record of assumptions, limitations, test results, and human responsibilities. Emerging Directions and Best PracticesModern AI systems increasingly combine predictive models, generative models, optimization, retrieval, tools, and human oversight. Agentic systems can decompose tasks, invoke external tools, and revise plans, but increased autonomy also increases the need for permission boundaries, verification, traceability, and safe failure modes. Useful best practices include: - formulate the decision before selecting the model;
- distinguish prediction from intervention and outcome;
- define measurable objectives, constraints, and acceptable trade-offs;
- establish a realistic baseline and evaluate against deployment conditions;
- include uncertainty, costs, and asymmetric harms in evaluation;
- involve domain experts and affected stakeholders early;
- test for leakage, bias, drift, robustness, and feedback effects;
- design human escalation and appeal processes;
- document data, assumptions, model versions, and limitations; and
- monitor outcomes after deployment, not merely model metrics before release.
Chapter SummaryAn intelligent agent perceives an environment and selects actions according to objectives and available information. Rationality means choosing the action expected to produce the best result under the circumstances; it does not imply perfect knowledge. Agents operate in environments that may be partially observable, stochastic, sequential, dynamic, continuous, and multi-agent. Their design depends on representations of states, actions, transitions, goals, costs, utility, and performance. AI problem formulation translates organizational needs into well-defined computational tasks. Prediction and classification estimate unknown outcomes; optimization selects decisions under constraints; recommendation ranks interventions; planning constructs action sequences; and generation produces new artefacts subject to quality and governance requirements. Strong formulations identify stakeholders, decision points, available information, objectives, constraints, risks, baselines, and success criteria. The most valuable AI systems connect models to feasible actions and responsible operational processes. Key TermsAgent: An entity that perceives an environment and acts upon it. Agent function: A mapping from percept histories to actions. Perception: Information received by an agent through its sensors or input channels. Action: An intervention selected by an agent. Rational agent: An agent that chooses the action expected to maximize its performance measure given available information. Environment: The external setting in which an agent operates. State: A representation of relevant conditions at a particular time. Transition model: A description of how actions change one state into another. Goal: A desired condition that a problem-solving agent seeks to achieve. Utility: A numerical representation of preferences over outcomes or sequences of outcomes. Performance measure: An external criterion used to evaluate an agent’s behaviour. PEAS: A framework describing Performance measure, Environment, Actuators, and Sensors. Prediction: Estimation of an unknown or future value. Classification: Assignment of an observation to one or more categories. Optimization: Selection of decision variables to maximize or minimize an objective under constraints. Recommendation: Ranking or selecting items, information, or actions for a user or organization. Planning: Construction of an action sequence that moves an agent toward a goal. Generation: Production of new content or artefacts such as text, images, code, or designs. Data leakage: Use of information during model development that would not be available at the real decision time. Feedback loop: A process in which system outputs influence later behaviour or data. Review QuestionsShort Answer Questions1. What is the difference between an agent function and an agent program? 2. Why is rationality different from omniscience? 3. Explain the role of a performance measure in agent design. 4. What is meant by a partially observable environment? 5. Distinguish a goal from a utility function. Long Answer Questions1. Explain the PEAS framework using an online retail recommendation system as an example. 2. Discuss how environmental properties such as uncertainty, sequentiality, and dynamism influence AI system design. 3. Compare prediction, classification, optimization, recommendation, planning, and generation as problem formulations. 4. Explain how states, actions, transition models, goals, and path costs are used in problem-solving agents. 5. Describe the process of converting a vague managerial request into a responsible AI technical specification. Analytical / Application Questions1. A bank wants to “use AI to improve lending.” Formulate at least two possible AI problems, identify their actions and outcomes, and state the constraints and risks associated with each. 2. Design a PEAS description for an autonomous hospital appointment scheduling system. Explain whether the environment is observable, deterministic, static, and single-agent. 3. A content platform optimizes only daily viewing time and observes increased user engagement but more complaints about misleading content. Analyse the formulation error and propose a revised performance measure and governance approach. 22. Multiple Choice Questions with AnswersQuestion 1Which statement best describes a rational agent? A. An agent that always obtains the best possible outcome B. An agent that chooses the action expected to maximize its performance given available information C. An agent that has complete knowledge of the environment D. An agent that never makes an incorrect prediction Correct Answer: B. An agent that chooses the action expected to maximize its performance given available information Question 2In the PEAS framework, which item describes how an agent affects its environment? A. Performance measure B. Environment C. Actuators D. Sensors Correct Answer: C. Actuators Question 3A delivery system estimates travel time and then assigns vehicles and sequences stops under capacity constraints. Which formulation best describes the assignment and sequencing component? A. Classification B. Optimization C. Generation D. Image recognition Correct Answer: B. Optimization Question 4Why can a model with high predictive accuracy still fail to create organizational value? A. Accuracy is never relevant to AI systems B. Predictions may not be connected to feasible actions or suitable outcomes C. Accurate models cannot operate in uncertain environments D. Performance measures apply only to robots Correct Answer: B. Predictions may not be connected to feasible actions or suitable outcomes Question 5Which environmental property means that the world may change while an agent is deciding? A. Static B. Episodic C. Dynamic D. Fully observable Correct Answer: C. Dynamic Question 6A system ranks products for a customer while balancing relevance, diversity, and long-term satisfaction. This is primarily a: A. Recommendation problem B. Classification problem C. State-transition problem only D. Pure data-storage problem Correct Answer: A. Recommendation problem Question 7Which example most clearly illustrates data leakage? A. Using customer age recorded before a loan decision B. Using a transaction amount available at purchase time C. Using a later repayment-status field to predict default at approval time D. Using historical training data from previous years Correct Answer: C. Using a later repayment-status field to predict default at approval time Question 8In an AI problem formulation, a hard constraint is best understood as: A. A preference that can always be ignored B. A condition that must not be violated C. A model’s prediction probability D. A measure of user satisfaction only Correct Answer: B. A condition that must not be violated Question 9Why is optimizing only viewing time potentially problematic for a content platform? A. Viewing time cannot be measured B. It may act as a poor proxy and encourage harmful or misleading content C. Utility functions cannot contain business measures D. Dynamic environments cannot contain users Correct Answer: B. It may act as a poor proxy and encourage harmful or misleading content Question 10Which formulation is most appropriate when a system must produce a personalized report subject to factuality, confidentiality, and review requirements? A. Generation B. Binary classification only C. Shortest-path search only D. Unconstrained forecasting Correct Answer: A. Generation
|