Principles of Agentic Systems
local graph
Chapter 2 — Principles of Agentic Systems
Section titled “Chapter 2 — Principles of Agentic Systems”In the previous chapter, we introduced the basics of generative AI, learned about types of generative AI models, and briefly discussed LLM-powered AI agents. In this chapter, we will discuss the basic principles of agentic systems, starting with a brief discussion about the concept of agency and autonomy, followed by a discussion about intelligent agents and their characteristics. We will also discuss various agentic system architectures as well as multi-agent systems through the lens of the travel booking assistant example that we discussed in the previous chapter.
The main topics discussed in this chapter are as follows:
- Understanding self-governance, agency, and autonomy
- Reviewing intelligent agents and their characteristics
- Exploring the architecture of agentic systems
- Understanding multi-agent systems
By the end of this chapter, you will have an overview of the basics of intelligent agents and the most critical aspects of agentic system architecture that must be considered while building an intelligent agentic system.
Technical requirements
Section titled “Technical requirements”You can find the code files for this chapter at the book’s companion GitHub repository and follow the README file in the repository to set up your development environment.
Understanding self-governance, agency, and autonomy
Section titled “Understanding self-governance, agency, and autonomy”The captivating aspect of agentic systems lies in the intricate decision-making processes they employ, which provide valuable insights into how choices are optimized within specific contexts. These systems often challenge our conventional understanding of accountability and responsibility.
Agentic systems act as the driving force behind innovation and technological advancements in various fields, including robotics, AI, and systems engineering. The development and deployment of these systems have catalyzed the exploration and creation of new forms of automation and intelligent behaviors. Let’s discuss some of the areas where agentic systems are making headway:
- Robotics: In the field of robotics, agentic systems have paved the way for the design and implementation of autonomous robots capable of navigating complex environments, performing intricate tasks, and adapting to changing conditions. These robots, equipped with decision-making capabilities and agency, have found applications in areas such as manufacturing, exploration, search and rescue operations, and healthcare. For instance, robots with agentic behavior can autonomously navigate through disaster zones, assess potential risks, and make decisions to assist in rescue efforts, demonstrating intelligent and adaptive behavior.
- AI: In AI, agentic systems have been instrumental in the development of intelligent agents and decision support systems. These systems leverage advanced algorithms, machine learning techniques, and knowledge representation methods to analyze data, reason about complex scenarios, and provide intelligent recommendations or automated decision-making capabilities. Agentic AI systems have been applied in domains such as finance, healthcare, transportation, and marketing, enabling more efficient and effective decision-making processes.
- Systems engineering: In the field of systems engineering, agentic systems have facilitated the design and implementation of complex, distributed, and adaptive systems. These systems often consist of multiple interacting components or subsystems, each exhibiting agentic behavior and decision-making capabilities. Such systems are found in areas such as power grids, transportation networks, and cyber-physical systems, where intelligent and autonomous decision-making is crucial for efficient operation, resource allocation, and fault tolerance.
Central to the idea of agentic systems are the concepts of self-governance, agency, and autonomy. Let’s discuss each of these concepts in the subsequent sections to understand what they are and explore the critical role they play within an agentic system architecture.
Self-governance
Section titled “Self-governance”Agentic systems are artificial and human systems that possess self-governance, adaptability, and interaction. Self-governance refers to the ability of a system or entity to govern or control itself autonomously, without external direction or control. In the context of agentic systems, self-governance implies that the system can make its own decisions, set its own goals, and regulate its behavior based on its internal rules, models, and decision-making algorithms. Basically, they operate according to their rules and internal states, and execute a change of behavior, if necessary, due to a change of the environment or the objectives. Such systems interact with the environment or other systems in a way that is meaningful to them and, through these interactions, become influenced.
Some key aspects of self-governance in agentic systems are as follows:
- Self-organization: The ability to organize and structure its own internal processes, resources, and behavior without external intervention
- Self-regulation: The capability to monitor and adjust its own actions and outputs based on feedback from the environment or internal states, to ensure it operates within desired parameters or constraints
- Self-adaptation: The ability to modify its behavior, strategies, or decision-making processes in response to changes in the environment or its own internal conditions, to achieve its goals more effectively
- Self-optimization: The ability to continuously improve its performance, efficiency, or decision-making capabilities through learning, experience, or evolutionary processes
- Self-determination: The ability to set its own objectives, priorities, and courses of action based on its internal decision-making processes, without being entirely controlled by external forces
Self-governance in agentic systems is often enabled by the integration of various technologies, frameworks, and methodologies such as machine learning, knowledge representation, reasoning, and decision-making algorithms. These allow the system to process information, learn from data and experiences, and make autonomous decisions based on its acquired knowledge and the current context.
Agency
Section titled “Agency”Agency is described as the capability of an individual, or any other entity, to act independently and make choices. In the context of human and artificial systems, agency encompasses the following key elements:
- Decisional authority: This refers to the power or ability to act and perform actions according to a chosen alternative or course of action. Systems with agency possess the autonomy to evaluate different options and select the most appropriate action based on their internal decision-making processes, rather than being solely driven by external forces or predetermined rules.
- Intentionality: Agency implies the existence of intentions, goals, or objectives that guide the actions and behavior of the system. Agentic systems are not merely reactive; they have a sense of purpose and can pursue specific objectives, adjusting their actions and strategies as necessary to achieve those goals.
- Responsibility: Agency is closely tied to the concept of responsibility, which is the answerability or accountability for the outcomes and consequences of one’s actions. Systems with agency are considered responsible for their decisions and the impact of their actions on the environment or other entities they interact with.
In most cases, AI agency involves the system’s ability to make decisions autonomously based on its internal programs, models, and the data it processes. These decisions can have a significant impact on the functioning of the system itself or its interactions with the environment.
Let’s go back to our travel booking assistant example from the previous chapter, which is responsible for booking flight tickets and perhaps even making hotel reservations. In this case, the system would exhibit agency by analyzing various factors, such as the availability of flights between two cities, the price of the tickets, and any other restrictions given by the user such as preferred seat class and so on, and then making decisions on how to optimally look for flights and hotels that meet those criteria so that it minimizes the overall cost of travel for the customer. The system would be responsible for the outcome of its decisions, which would impact the overall travel plan and the cost of travel for the customer.
Autonomy
Section titled “Autonomy”Autonomy is closely related to the concept of agency but focuses more specifically on the degree of independence an entity or system possesses. It can be broken down into several aspects:
- Operational autonomy: This refers to the ability of a system to perform a specific task or set of tasks without direct human intervention or control. A system with operational autonomy can execute its functions independently, relying on its own internal processes, decision-making algorithms, and environmental sensing capabilities.
- Functional autonomy: This aspect of autonomy involves the system’s ability to make choices and take action to achieve set targets or objectives, modulated by the environment or context in which it operates. Functionally autonomous systems can adapt their behavior and decision-making processes in response to changing conditions or stimuli, enabling them to pursue their goals more effectively.
- Hierarchical autonomy: This aspect relates to the amount of decisional authority or decision-making power awarded to a system within a larger framework or organizational structure. Systems with higher hierarchical autonomy have greater latitude in making decisions that impact their subsystems or broader operations, while systems with lower hierarchical autonomy may have more constraints or oversight from higher-level entities.
In AI and robotics, autonomy is a key concept that refers to the extent to which a system can perform tasks and make decisions without the need for continuous human intervention.
In our travel booking assistant example, the system would have operational autonomy to carry out tasks such as booking flights or hotels, managing reminders, and retrieving travel information with little or no human input. It would also possess functional autonomy, allowing it to interpret user commands, adapt to individual preferences, and make decisions that align with the user’s goals and context. The level of hierarchical autonomy granted to such a system might depend on factors such as user privacy preferences or the system’s access to sensitive data and resources.
Note that autonomy in AI and robotic systems does not necessarily imply a complete absence of human oversight or control. Often, these systems operate within well-defined boundaries and constraints set by their designers or operators, while still exhibiting a significant degree of autonomy. In our travel booking example, the chatbot requests additional information, such as travel dates, locations, name, and address, from the user to make flight bookings. It then cross-references this data with available flights, suggesting options that match the user’s preferences. If any detail is missing or unclear, the chatbot prompts the user for clarification, ensuring accuracy while still operating autonomously within the boundaries set by its programming.
The concepts of self-governance, agency, and autonomy in AI systems are often accompanied by ethical considerations, particularly regarding the level of autonomy granted to these systems and the potential risks and implications of their decisions. As AI systems become more advanced and capable of independent decision-making, ensuring their alignment with human values and ethical principles becomes crucial.
Example of agency and autonomy in agents
Section titled “Example of agency and autonomy in agents”Let’s illustrate the concept of agency and autonomy with a simple algorithm for the travel booking assistant. Note that this algorithm doesn’t necessarily use AI just yet, but it would help understand the concepts. Our travel booking assistant algorithm may look as follows.
Algorithm 1: Travel booking assistant algorithm with agency and autonomy
Require: Agent name N
Ensure: Initialized TravelAgent object A with agency and autonomy
1: Initialize A ← CreateTravelAgent(N)
2: Initialize A.goals ← empty list
3: Initialize A.knowledge_base ← empty dictionary
// Agency: Ability to act on behalf of a user
4: function SetGoal(G)
5: A.goals.Append(G) // Agency: Defining objectives
6: function UpdateKnowledge(K, V)
7: A.knowledge_base[K] ← V // Agency: Acquiring information from an API, and scoring
// Autonomy: Ability to operate independently
8: function MakeDecision(Options)
9: best_option ← max(Options, key =score) // Autonomy: Independent decision-making
10: return best_option
11: function BookTravel(Departure, Destination)
12: Output “Agent A.name is booking travel to Destination”
// Agency: Execute action on behalf of user
13: SetGoal(“Book flight from Departure to Destination”)
14: UpdateKnowledge({Departure, Destination})
// Autonomy: Book travel independently by finding best flight
15: MakeDecision()
// Implement booking logic here and store into A
16: Output A
Here is how the algorithm works, demonstrating the abilities of agency and autonomy:
- We start by naming our agent; we call it
TripPlanner. - Next, we initialize a new
TravelAgentobject with the nameN = "TripPlanner"; this represents the creation of an entity capable of both agency and autonomy. - We then set up a list to store the goals for the agent. This relates to agency, as goals represent the intentions or desired outcomes the agent will work towards on behalf of the user. This is indicated by
A.goals ←empty list. - Next, we initialize an empty dictionary (also known as a map or key-value pairs) to store the agent’s knowledge. This is crucial for both agency (acting on behalf of users) and autonomy (independent operation), as it will contain information the agent uses to make decisions.
- Steps 4 and 5 in the algorithm indicate the definition of a function that adds a new goal
Gto the agent’s list of goals. This is akin to the agent taking on objectives on behalf of the user. This is indicated byA.goals.Append(G). Think of this as the piece of code that will receive the user’s chat message, such as “Book me a flight from San Diego to Seattle.” Here, the goal is to book a flight from San Diego to Seattle. - Steps 6 and 7 in the algorithm indicate the definition of a function that updates the agent’s knowledge base with a new key-value pair (map or dictionary). This represents agency through the acquisition of information that will be used to act on behalf of the user. It also supports autonomy by providing the agent with information it can use to make independent decisions. This operation is represented as
A.knowledge_base[K] ← V. In our case, this function uses several travel-related APIs (in theory) to get flight options between two cities, thus forming the knowledge into a knowledge base. This is also a place where each of these flight options will be scored; for example, late flights get low scores, and early flights get higher scores. - Steps 8 through 10 define a function that does a few different things. It takes a list of options and selects the best one based on some scoring criteria. This is an example of autonomy in the algorithm since the agent independently evaluates options and makes a decision without direct human intervention.
- Finally, steps 10 through 15 demonstrate how all of these components work together, starting from setting the goal of flight booking using the departure and destination cities, updating the knowledge base using a flight lookup API, and then scoring the available flights. Subsequently, it uses the
MakeDecisionfunction to find the best possible flight as per the highest score and performs the flight booking for the user.
A Python implementation of the BookTravel function from the algorithm is shown in the following code snippet:
1 def book_travel(departure: str, destination: str):2 self.set_goal(f"Book flight from {departure} to {destination}")3 self.update_knowledge(departure, destination)45 try:6 best_flight = self.make_decision()7 booking_confirmation = f"BOOKING_#12345"8 self.knowledge_base['booking_confirmation'] = \9 booking_confirmation10 print(f"Booking confirmed: {booking_confirmation}")11 except Exception as e:12 print(f"Booking failed: {str(e)}")1314 if __name__ == "__main__":15 agent = TravelAgent("TripPlanner")16 agent.book_travel("SAN", "SEA")17 print("\n----------- Final Agent State: -----------")18 print(f"Name: {agent.name}")19 print(f"Goals: {agent.goals}")20 if 'booking_confirmation' in agent.knowledge_base:21 print(f"Booking Confirmation: \22 {agent.knowledge_base['booking_confirmation']}")The output of this code when the agent is initialized to book a flight from SAN (San Diego) to SEA (Seattle) looks as follows:
1 Agent TripPlanner is booking travel from SAN to SEA2 Goal set: Book flight from SAN to SEA3 Knowledge updated with 3 flight options4 Decision made: Selected flight JetBlue5 Booking confirmed: BOOK-JetBlue-TRIPPLANNER6 ----------- Final Agent State: -----------7 Name: TripPlanner8 Goals: ['Book flight from SAN to SEA']9 Booking Confirmation: BOOK-JetBlue-TRIPPLANNERFor the full implementation of the trip planner agent, refer to the Chapter_02.ipynb Python notebook in the GitHub repository.
In this code snippet, the book_travel function takes a departure city code (such as SAN or SEA, which are airport codes) and subsequently calls other functions to set the goal, update its knowledge base, and then make a decision on which flight to choose and book that flight. Note that our agent, although has some functionality of agency and autonomy, is not intelligent. It cannot take plain text messages from a user and decipher what the user intends to do to set its goals, update its knowledge base, and then perform the actions; rather, it needs the airport codes. However, as we saw in our example, a user (or customer) may simply express their intentions in plain language such as “ Book me a flight from San Diego to Seattle”.
In its current form, given any such user input (message), the agent is incapable of determining what the departure and destination cities are, what the user is asking for, or even what the string of input text even means. This is where generative AI steps in, as we will see in the subsequent chapters. For now, let’s continue with our discussion by looking at the characteristics of agents.
Reviewing intelligent agents and their characteristics
Section titled “Reviewing intelligent agents and their characteristics”An intelligent agent is a complex, self-governed entity that perceives its environment and takes action to achieve certain goals or objectives. These agents can range from basic systems that strictly adhere to a predefined set of rules to highly advanced systems with the ability to learn and adapt from experience. Intelligent agents are characterized by several key attributes:
- Reactivity: Reactive agents respond to changes and events occurring in their environment in real time. They continuously monitor their surroundings and adjust their behavior accordingly. This reactivity allows agents to adapt to dynamic conditions and respond appropriately to stimuli, ensuring their actions remain relevant and effective.
- Proactiveness: An ideal intelligent agent should not merely react to events but also exhibit proactive behavior. Proactive agents anticipate future needs, challenges, or opportunities, and take the initiative to plan and act accordingly. They are goal-oriented and actively pursue strategies to achieve their objectives, rather than simply reacting to circumstances as they arise.
- Social ability: Many intelligent agents operate in multi-agent systems, where they interact and cooperate with other agents or humans to achieve common goals that require collaborative effort. Social ability encompasses communication, coordination, and negotiation skills, enabling agents to work together effectively and leverage collective intelligence or resources.
With these key characteristics, intelligent agents demonstrate remarkable versatility and efficiency across a wide spectrum of domains and scenarios. Their capabilities enable them to excel in tasks ranging from simple, automated processes to highly complex, dynamic decision-making situations that demand real-time adaptation and environmental responsiveness. In addition to these core characteristics, intelligent agents may possess other advanced capabilities:
- Learning and adaptation: Intelligent agents have the ability to learn from experience and adapt their behavior over time. They can acquire new knowledge, refine their decision-making processes, and improve their performance through techniques such as machine learning, reinforcement learning, or evolutionary algorithms.
- Reasoning and planning: Intelligent agents may employ reasoning and planning capabilities to analyze complex situations, formulate strategies, and make informed decisions. They can leverage techniques such as knowledge representation, logical inference, and planning algorithms to navigate through intricate problem spaces and determine optimal courses of action.
- Autonomy and self-governance: Intelligent agents often exhibit a degree of autonomy and self-governance, allowing them to make decisions and take actions independently without constant human intervention or supervision. This autonomy enables agents to operate efficiently in dynamic environments or scenarios where continuous human control is impractical or impossible.
With these characteristics, intelligent agents can be versatile and efficient in a wide range of domains, from simple, automated tasks to highly complex, dynamic decision-making situations. They find applications in areas such as robotics, decision support systems, virtual assistants, gaming, and simulations, among others.
Exploring the architecture of agentic systems
Section titled “Exploring the architecture of agentic systems”Agentic systems, designed for executing complex goals in an autonomous way, can be implemented using a good variety of architectural patterns. In general, these patterns define the structure and the behavior that allows the system to perceive, reason, learn, and act upon the environment in an effective way. Three main architectural patterns for agentic systems are deliberative, reactive, and hybrid architectures. Let’s discuss them in detail.
Deliberative architectures
Section titled “Deliberative architectures”Also known as knowledge-based or symbolic architectures, rely on the use of explicit representations of knowledge and reasoning mechanisms to reach decisions. They typically follow a sense-plan-act cycle, where they first perceive information about the environment, then make a plan of action according to that perception and the knowledge base, and finally execute such plans of action.
The key advantage of deliberative architectures is their ability to handle tasks that involve complex reasoning, such as planning, problem-solving, and decision-making. These architectures leverage techniques such as rule-based reasoning, constraint satisfaction, and heuristic search to navigate through intricate problem spaces and formulate appropriate courses of action.
One of the critical components of a deliberative architecture is the knowledge base that stores symbolic representations of the environment, goals, constraints, and domain-specific knowledge. This knowledge base is typically encoded using formal language or logic, enabling the system to perform logical inference and reasoning. The sense-plan-act cycle in deliberative architectures typically involves the following steps:
- Sensing: The agent perceives and acquires information about the environment through various sensors or input mechanisms.
- Knowledge updating: The perceived information is used to update the agent’s internal knowledge base, ensuring that it maintains an accurate representation of the current state of the environment.
- Planning and reasoning: Based on the updated knowledge base, the agent employs reasoning techniques and algorithms to formulate plans and make decisions. This may involve techniques such as constraint satisfaction, logical inference, search algorithms, or heuristic-based planning.
- Plan execution: Once a plan or course of action has been determined, the agent executes the corresponding actions in the environment, potentially modifying the environment or achieving specific goals.
The following figure depicts a deliberative architecture of an agentic system with a sense-plan-act cycle:

Figure 2.1 – Deliberative architecture of an agentic system
Deliberative architectures excel in handling tasks that require complex reasoning, planning, and decision-making in well-defined environments. They can effectively handle uncertainty and ambiguity through techniques such as probabilistic reasoning, fuzzy logic, or belief revision mechanisms.
However, deliberative architectures also have some disadvantages. One significant challenge is the computational cost associated with maintaining and reasoning over complex knowledge bases, which can limit real-time responsiveness in dynamic environments. Additionally, the explicit representation of knowledge can be challenging in domains where knowledge is difficult to formalize or constantly evolving.
To address these limitations, deliberative architectures are often combined with reactive or behavior-based components in hybrid architectures, allowing both complex reasoning and rapid response to environmental changes.
Despite their limitations, deliberative architectures remain a crucial component in many intelligent systems, particularly in domains where complex decision-making, planning, and reasoning are essential, such as robotics, decision support systems, and intelligent tutoring systems.
Reactive architectures
Section titled “Reactive architectures”Reactive architectures, also known as behavior-based or stimulus-response architectures, aim to provide immediate responses to stimuli from the environment. Unlike deliberative architectures, reactive architectures do not rely on explicit models of the world or complex reasoning processes. Instead, these systems directly map perceptions onto actions, typically using simple condition-action rules or neural networks as depicted in the following figure:

Figure 2.2 – Reactive architecture of an agentic system
Some of the key properties and characteristics of reactive architectures include the following:
- Speed and responsiveness: Reactive architectures are designed to react rapidly to changes in the environment. By directly coupling perceptions to actions, they can bypass time-consuming deliberative reasoning processes, enabling swift and timely responses.
- Robustness and fault tolerance: These architectures are generally robust and less susceptible to noise or incomplete information. Their simple, standalone nature makes them less prone to catastrophic failures, as individual components or behaviors can compensate for or mitigate the effects of faulty or missing input, especially when used within a deliberative architecture.
- Handling uncertainty: Reactive architectures can effectively handle uncertainty in dynamic environments. Their ability to respond directly to environmental stimuli allows them to adapt and adjust their actions based on the current situation, without relying on precise or complete models of the entire world.
- Parallel and distributed processing: Reactive architectures often employ parallel and distributed processing using multiple reactive modules, where multiple modules operate simultaneously and independently. This decentralized approach enables efficient handling of complex tasks and provides inherent scalability and modularity.
- Emergence of complex behavior: Despite the simplicity of individual behaviors or rules, the interaction and coordination of multiple reactive components can lead to the emergence of complex, intelligent-like behavior at the system level.
While reactive architectures offer advantages in terms of speed, robustness, and handling uncertainty, they also have limitations as highlighted:
- Lack of long-term planning: Reactive architectures generally lack the ability to plan ahead or reason about long-term consequences. Their focus is on immediate responses to environmental stimuli, making it difficult to pursue complex, multi-step goals or strategies.
- Limited reasoning and abstraction: These architectures may struggle with tasks that require abstract reasoning, generalization, or the manipulation of symbolic representations. They are primarily designed to operate at a lower, stimulus-response level.
- Limited learning capabilities: Many reactive architectures lack the ability to learn from experience or adapt their behavior over time. Their fixed set of rules or behaviors may not be suitable for dynamic environments or tasks that require continuous learning and adaptation.
Despite these limitations, reactive architectures are widely used in applications where real-time responsiveness, robustness, and ability to handle uncertainty are essential, such as in robotics, video games built with AI, and control systems. Additionally, reactive architectures often serve as components within more complex hybrid architectures, complementing deliberative or learning-based systems to achieve desired levels of performance and adaptability.
Hybrid architectures
Section titled “Hybrid architectures”Researchers have recognized the strengths and limitations of both deliberative and reactive architectures, leading to the development of hybrid architectures that aim to exploit the advantages of both approaches. Such hybrid architectures typically employ a layered structure, consisting of the following:
- A reactive layer for fast and low-level responses. The reactive layer is responsible for handling real-time interactions with the environment, providing rapid and situationally appropriate responses to external stimuli. This layer is designed to be highly responsive, fault-tolerant, and capable of handling uncertainty, leveraging the strengths of reactive architectures.
- A deliberative layer for high-level reasoning and planning. The deliberative layer is dedicated to higher-level reasoning, planning, and decision-making processes. This layer can maintain a more comprehensive representation of the environment, goals, and constraints, enabling it to formulate complex strategies, reason about abstract concepts, and plan long-term courses of action.
The interaction between these two layers is crucial for enabling agentic systems to respond effectively to dynamic environmental contexts while maintaining the capability to plan actions and reason about them. The reactive layer can provide real-time feedback and situational awareness to the deliberative layer, informing its decision-making processes. Conversely, the deliberative layer can guide and influence the reactive layer’s behavior by providing high-level plans, goals, and constraints.
To achieve complex goals and leverage the strengths of both layers, hybrid architectures often employ the following techniques:
- Task decomposition: Break down complex tasks into subtasks that can be handled by the appropriate layer, with the reactive layer handling low-level, time-critical tasks and the deliberative layer focusing on higher-level planning and coordination
- Multiplan selection: The deliberative layer can generate multiple potential plans or strategies, and the reactive layer can dynamically select and execute the most suitable plan based on the current environmental conditions
- Planning with external modules: The deliberative layer can incorporate external modules or specialized algorithms for tasks such as path planning, resource allocation, or scheduling, leveraging domain-specific knowledge and techniques
- Reflection and refinement: The deliberative layer can reflect on the outcomes of executed plans, learn from experience, and refine its reasoning and planning processes accordingly, enabling continuous improvement and adaptation
- Memory-augmented planning: The deliberative layer can maintain a memory or history of past experiences, decisions, and outcomes, enabling it to leverage this knowledge in future planning and reasoning processes
By combining the strengths of both deliberative and reactive approaches, hybrid architectures seek to balance responsiveness and reasoning, enabling the development of more robust, autonomous, and adaptable agentic systems. These architectures leverage the power of both approaches, providing the ability to respond rapidly to dynamic environments while maintaining the capability for complex planning, reasoning, and decision-making.
The design and implementation of effective hybrid architectures remain an active area of research, as researchers strive to develop architectures that can seamlessly integrate and coordinate the deliberative and reactive components, enabling the creation of highly capable and intelligent agentic systems.
Selecting the appropriate architectural pattern for an agentic system is contingent upon the specific requirements of the application, encompassing factors such as task complexity, environmental uncertainty, and the necessity for real-time responsiveness. Deliberative architectures excel in scenarios that demand intricate reasoning and decision-making processes, while reactive architectures thrive in dynamic environments that necessitate swift and adaptive responses. Hybrid architectures strike a harmonious balance by judiciously leveraging the strengths of both paradigms, resulting in the development of more capable and adaptable agentic systems that can seamlessly navigate the complexities of their operating environments.
Understanding multi-agent systems
Section titled “Understanding multi-agent systems”Multi-agent systems (MASs) represent an important subfield of the broader area of distributed artificial intelligence. They consist of several intelligent agents that interact, cooperate, and coordinate with each other to execute tasks and achieve collective goals. Each agent in a MAS is typically autonomous, capable of perceiving its environment through sensors, possessing a reasoning mechanism to make decisions, and acting upon those decisions to meet its design objectives. The collective behavior and interactions of these agents enable MASs to tackle complex problems that single-agent systems struggle with due to the inherent limitations of individual agents.
Examples of MASs can be found in various domains, demonstrating their applicability and effectiveness in solving complex problems:
- Supply chain management and logistics: MASs can be used to optimize supply chain operations by coordinating the activities of different agents representing suppliers, manufacturers, distributors, and retailers. Each agent can make decisions based on its local knowledge and constraints, while collaborating with other agents to ensure efficient resource allocation, inventory management, and transportation planning.
- Traffic control and transportation systems: MASs have been employed in managing traffic flow and optimizing transportation networks. Agents can represent individual vehicles, traffic lights, or traffic management centers, working together to reduce congestion, coordinate traffic signals, and find optimal routes for vehicles based on real-time traffic conditions.
- Robotics and manufacturing: In manufacturing environments, MASs can coordinate the activities of multiple robots or automated systems. Each robot or agent can be responsible for specific tasks, such as assembly, welding, or material handling, while communicating and coordinating with other agents to ensure efficient and synchronized operations.
- Environmental monitoring and resource management: MASs can be used for monitoring and managing natural resources, such as water distribution networks, forestry management, or wildlife habitat conservation. Agents can represent different stakeholders, environmental sensors, or decision-making entities, collaborating to make informed decisions about resource allocation, conservation efforts, or mitigation strategies.
- Distributed sensor networks: MASs are well suited for applications involving distributed sensor networks, such as environmental monitoring, surveillance, or disaster response. Each sensor node can be represented as an agent, collecting and processing local data, while coordinating with other agents to fuse information and provide a comprehensive understanding of the monitored area or phenomenon.
- Intelligent virtual environments and simulations: MASs can be used to create intelligent virtual environments and simulations, where agents represent various entities or actors within the simulated world. These agents can interact, make decisions, and exhibit complex behaviors, enabling realistic simulations of social systems, economic models, or military operations, among others.
The key advantages of MASs lie in their ability to distribute problem-solving capabilities, leverage the collective intelligence and specialization of individual agents, and exhibit robustness and fault tolerance through decentralized decision-making. Additionally, MASs can facilitate the integration of heterogeneous components, enabling the development of flexible and scalable systems capable of addressing complex, dynamic problems that would be challenging for monolithic, centralized approaches.
Definition and characteristics of MASs
Section titled “Definition and characteristics of MASs”A MAS is a system comprising multiple autonomous agents that can interact, collaborate, and cooperate to achieve shared goals. These agents can be software programs, robots, or even humans equipped with specialized capabilities and goals. Interaction among agents is a necessary component, enabling them to work together efficiently, share information, and divide tasks based on their strengths and areas of expertise. Key characteristics of MASs include the following:
- Autonomy: Each agent within a MAS is self-governing, making self-contained decisions based on its perception of the environment and its objectives. Agents operate independently without centralized control, exhibiting autonomous behavior.
- Interaction: Agents in a MAS communicate with each other through defined protocols, enabling them to share information, negotiate tasks, and coordinate their actions. This interaction can take various forms, such as cooperation, coordination, or competition, depending on the nature of the problem and the agents’ goals.
- Adaptability: MASs possess the flexibility to adapt and change their behavior in response to changes in the environment or changes in the individual agents’ goals. This adaptability makes MAS capable of handling dynamic situations, making them flexible and robust during operation.
- Distributed control: Unlike centralized systems, MASs employ distributed control, where decision-making and control are distributed among the individual agents. This distributed control contributes to the system’s resilience, as failures or malfunctions in one agent do not necessarily affect the entire system’s functionality.
- Scalability: MAS architectures are inherently scalable, allowing for the addition or removal of agents as needed. This scalability enables the system to grow or shrink in complexity and capabilities, making it suitable for a wide range of applications.
- Heterogeneity: Agents within a MAS can be heterogeneous, meaning they can have different architectures, capabilities, and goals. This heterogeneity allows the integration of diverse components and the leveraging of specialized expertise, contributing to the overall system’s effectiveness.
- Decentralized data and knowledge: In a MAS, data and knowledge are decentralized and distributed among the individual agents. This decentralization enhances robustness, as there is no single point of failure, and agents can operate based on their local knowledge and perceptions.
A MAS’s ability to distribute problem-solving capabilities, leverage collective intelligence, exhibit robustness, and integrate heterogeneous components makes them well suited for addressing complex, dynamic problems that are challenging for traditional, centralized approaches.
Interaction mechanisms in MASs
Section titled “Interaction mechanisms in MASs”Interaction mechanisms in MASs play a crucial role in enabling effective communication, collaboration, and coordination among the agents within the system. The general classification of the basic interaction mechanisms in a MAS can be presented into three main types:
- Cooperation: Cooperation can be defined as agents working together towards a common goal or objective. It is particularly important in situations where no single agent, acting alone, can accomplish the objective.

Figure 2.3 – Cooperation in a MAS
A prime example of cooperation in MAS is disaster rescue operations, where multiple drones, robotic agents, and humans need to cooperate and collaborate to locate and rescue victims effectively. A MAS relies on agents cooperating by pooling their knowledge, resources, and efforts to accomplish tasks that are too complex for one agent. Agents may cooperate by dividing tasks, combining their specialized expertise, or complementing each other’s abilities to tackle complex problems more efficiently.
- Coordination: Coordination deals with managing interdependencies that arise from the actions and activities of agents within the system. Coordination is essential when agents share resources and have overlapping responsibilities or conflicting actions.

Figure 2.4 – Coordination in a MAS
Coordination mechanisms in MAS may include strategies such as task scheduling, resource allocation management, and conflict resolution. For example, in a manufacturing setting, agents representing different robots on production lines may need to coordinate their actions to ensure efficient use of shared resources, prevent interference, and maintain overall production efficiency.
- Negotiation: Negotiation is the process through which agents reach agreements on how to share resources, divide tasks, or resolve conflicts. It involves agents making offers, counteroffers, and compromises, even when their interests may initially conflict.

Figure 2.5 – Negotiation in a MAS
Negotiation mechanisms in MAS enable agents to find mutually beneficial solutions by exchanging proposals, evaluating alternatives, and reaching consensus. This is particularly useful in situations where agents have limited or conflicting resources, different preferences, or competing goals. Negotiation can involve various techniques, such as auctions, voting protocols, bargaining strategies, or game-theoretic approaches, depending on the specific requirements and constraints of the problem domain.
These interaction mechanisms – cooperation, coordination, and negotiation – are fundamental to the effective functioning of MAS. They enable agents to work together, leverage their collective capabilities, and resolve conflicts or interdependencies that may arise during their interactions. The choice and design of appropriate interaction mechanisms are crucial for enabling efficient and robust multi-agent systems that can tackle complex problems and adapt to dynamic environments.
In the context of our travel assistant example, MASs can play a vital role in facilitating efficient coordination and negotiation among various entities involved in the travel industry network. In such a scenario, agents can represent different stakeholders, such as airlines, hotels, car rental companies, tour operators, or travel agencies, and utilize negotiation mechanisms to optimize various aspects of the travel booking operations.
For example, consider a MAS where agents represent airlines, hotels, and other relevant parties involved in the travel industry. These agents can engage in negotiation processes to determine flight schedules, room availability, pricing, and other travel-related decisions, aiming to achieve the highest efficiency for the overall travel booking operations.
The negotiation process can unfold as follows:
- Agents representing airlines can propose available seats, flight schedules, and pricing for their routes.
- Agents representing hotels can evaluate these proposals based on their room availability, expected occupancy rates, and demand forecasts, and negotiate with the airline agents for the most suitable flight schedules that align with their check-in and check-out times.
- Travel agency agents can then negotiate with both airline and hotel agents, taking into account customer preferences, budget constraints, and their specific requirements for travel dates and accommodations.
- Transportation agents (for example, car rental companies or shuttle services) can also participate in the negotiation process, offering ground transportation services and proposing pickup/drop-off schedules and associated costs to the other agents involved.
Throughout the negotiation process, agents can utilize various strategies and algorithms to evaluate proposals, generate counteroffers, and find mutually acceptable agreements. These strategies may involve techniques such as auctions, bargaining protocols, game-theoretic approaches, or optimization algorithms tailored for travel industry operations. For example, agents may employ multi-attribute utility functions that consider factors such as travel time, cost, comfort, and customer preferences to evaluate and rank various proposals. They can then engage in iterative negotiations, adjusting their offers and counter offers based on their respective utility functions and constraints.
Moreover, the distributed nature of MAS allows decentralized decision-making, where each agent can make decisions based on its local knowledge and constraints, while still collaborating and coordinating with other agents to achieve global optimization goals. The negotiation mechanisms in MAS for our travel and hospitality example not only facilitate efficient coordination among various entities but also provide the flexibility and adaptability to handle dynamic changes in demand, supply, pricing changes, or other operational factors, ultimately leading to a more resilient and responsive system that caters to customer demands.
To illustrate a MAS for our travel booking assistant example, we will introduce some new functionalities. In addition to booking flights, we now want our system to find hotels at the destination and create an appropriate travel package for the customer. The algorithm for such a MAS system could look like the following:
Algorithm 2: Multi-agent system for travel booking assistant
Require: Sets of Airline Agents A = {A1, A2,…, An} and Hotel Agents H = {H1, H2,…, Hm}
Ensure: Initialized TravelBookingSystem S with Travel Agency Agent TA
1: Initialize S with A, H, and TA
2: function RequestTravelPackage(departure, destination, dates)
3: for each Ai in A do
Algorithm 2: Multi-agent system for travel booking assistant
4: available_flights ← Ai.GetAvailableFlights(departure, destination, dates)
5: for each Hj in H do
6: available_rooms ← Hj.GetAvailableRooms(destination, dates)
7: packages ← TA.CompilePackages(available_flights, available_rooms)
8: return packages
9: function BookTravel(selected_package)
10: flight_booking ← selected_package.airline.BookFlight()
11: room_booking ← selected_package.hotel.BookRoom()
12: if flight_booking and room_booking are successful then
13: return CreateBooking(flight_booking, room_booking)
14: else
15: return FailureNotification()
16: function UpdateDynamicPricing()
17: for each Ai in A do
18: Ai.UpdateFlightPrices()
19: for each Hj in H do
20: Hj.UpdateRoomPrices()
21: while True do
22: if NewTravelRequest() then
23: request ← GetTravelRequest()
24: packages ← RequestTravelPackage(request.departure, request.destination, request.dates)
25: selected_package ← TA.PresentOptionsToCustomer(packages)
26: if selected_package is not null then
27: booking ← BookTravel(selected_package)
28: if booking is successful then
29: NotifyCustomer(booking, “Booking confirmed”)
30: else
31: NotifyCustomer(“Booking failed”)
32: if TimeToUpdatePricing() then
33: UpdateDynamicPricing()
34: Output S
Here is a breakdown of the key components of this algorithm:
- The first step is to clearly define a set of agents: in this case a flight agent, a hotel agent, and a travel agency agent. The flight and hotel agents are responsible for airlines and hotel-related actions, and the travel agency agent is responsible for creating travel packages based on the best options available.
- Steps 2 through 8 show how the travel agent interacts with multiple airline and hotel agents to compile travel packages. It finds appropriate flight schedules and hotel availability in the destination city and subsequently uses that data to create packages.
- Steps 9 through 15 demonstrate the coordination between the selected airline and hotel agents to confirm the flight and hotel booking according to the chosen package.
- Steps 16 through 20 show how each airline and hotel agent independently updates its pricing.
- The main loop from steps 21 through 33 ties everything together, showing how the system handles travel requests and periodically updates pricing across all agents.
This example algorithm demonstrates a combination of coordination and cooperation between agents:
- Cooperation, since all the agents work towards a common goal of booking the travel itinerary for the user
- Coordination, since the travel agency agent needs input from both the flight agent and the hotel agent to build a travel package, and then subsequently book the best travel package
The full Python code related to this algorithm can be found in the Chapter_02.ipynb Python notebook in GitHub repository. Keep in mind, just like before, our MAS is not very intelligent since it still needs discreet input, that is, departure city code and arrival city code, to operate successfully, and lacks the ability to comprehend or infer values and actions from user messages or text.
Summary
Section titled “Summary”In this chapter, we explored the intriguing world of agentic systems and intelligent agents, delving into the core concepts of agency, autonomy, and the characteristics that define an ideal agent. We studied various architectural patterns for designing and implementing such systems, including deliberative, reactive, and hybrid approaches. Additionally, we examined MASs, where multiple agents collaborate and coordinate to achieve collective goals through mechanisms such as cooperation, coordination, and negotiation.
The knowledge gained from this chapter provides a solid foundation for developing intelligent and autonomous systems capable of operating effectively in complex, unpredictable environments. You should now be able to decide which agentic system architecture best suits any particular use case, and be able to craft a mental model of a MAS that gives you the foundation of your agentic system. In the next chapter, we will dive deeper into the essentials of an agentic system, further strengthening our ability to build efficient systems.
Questions
Section titled “Questions”- What are the key characteristics of intelligent agents?
- What are the main types of architectural patterns for intelligent agents?
- How do deliberative and reactive architectures differ in their strengths and weaknesses?
- What is a multi-agent system (MAS) and what are its key characteristics?
- What are the main interaction mechanisms in MASs?
- In what domains are MASs commonly applied?
Answers
Section titled “Answers”- Key characteristics of intelligent agents include reactivity, proactiveness, social ability, autonomy, and the capability to learn and adapt.
- The main architectural patterns for intelligent agents are deliberative (knowledge-based), reactive (behavior-based), and hybrid architectures.
- Deliberative architectures excel in complex reasoning and planning but may struggle with real-time responsiveness in dynamic environments. Reactive architectures are well suited for dynamic environments requiring rapid responses but lack long-term planning and abstract reasoning capabilities.
- A multi-agent system (MAS) consists of multiple intelligent agents that interact, cooperate, and coordinate to achieve collective goals. Key characteristics include autonomy, interaction, adaptability, distributed control, scalability, heterogeneity, and decentralized data and knowledge.
- The main interaction mechanisms in MASs are cooperation (working towards a common goal), coordination (managing interdependencies), and negotiation (reaching agreements).
- MASs find applications in domains such as supply chain management, traffic control, robotics, environmental monitoring, distributed sensor networks, and intelligent virtual environments.