Source-linked AI summary

Agent Design Pattern Catalogue: A Collection of Architectural Patterns for Foundation Model based Agents

Yue Liu, Sin Kit Lo, Qinghua Lu, Liming Zhu, Dehai Zhao, Xiwei Xu, Stefan Harrer, Jon Whittle

arXiv:2405.10467v4cs.AIcs.SE

TL;DR

Practitioners lack systematic architectural guidance for designing goal-seeking foundation-model agents amid reasoning, explainability, and accountability challenges. The paper analyzes 18 patterns and presents a catalogue intended to guide agent design and development.

  • Problem

    Practitioners lack a holistic architecture view and face reasoning, explainability, and accountability challenges when designing goal-seeking agents.

    Source: §1 · pp. 1–2, §2 · p. 3
  • Method

    The paper analyzes 18 agent-design patterns, examining their forces, solutions, and trade-offs.

    Source: §1 · p. 2, §6 · p. 34
  • Results

    The paper presents a catalogue of 18 patterns as holistic guidance for foundation-model agent architecture design and trade-off analysis.

    Source: §1 · p. 2, §2 · p. 3
  • Takeaways & Limitations

    The catalogue offers architects a pool of patterns to select from according to application scenarios and accessibility requirements.

    Source: §1 · p. 2

    Pattern benefits and drawbacks, mostly software quality attributes, still require quantification into fine-grained metrics and rubrics.

    Source: §5.3 · p. 34

Abstract

from arXiv · show

Foundation model-enabled generative artificial intelligence facilitates the development and implementation of agents, which can leverage distinguished reasoning and language processing capabilities to takes a proactive, autonomous role to pursue users' goals. Nevertheless, there is a lack of systematic knowledge to guide practitioners in designing the agents considering challenges of goal-seeking (including generating instrumental goals and plans), such as hallucinations inherent in foundation models, explainability of reasoning process, complex accountability, etc. To address this issue, we have performed a systematic literature review to understand the state-of-the-art foundation model-based agents and the broader ecosystem. In this paper, we present a pattern catalogue consisting of 18 architectural patterns with analyses of the context, forces, and trade-offs as the outcomes from the previous literature review. We propose a decision model for selecting the patterns. The proposed catalogue can provide holistic guidance for the effective use of patterns, and support the architecture design of foundation model-based agents by facilitating goal-seeking and plan generation.

1 Introduction

Foundation-model agents can pursue broad user goals by generating and orchestrating executable tasks, but practitioners lack systematic architectural guidance for designing them. The paper presents 18 patterns and a decision model to guide agent design amid reasoning, explainability, and accountability challenges.

1 Introduction

  • FM-based agents can derive executable tasks from broad user goals, while human feedback can revise goals, plans, and intermediate results.Users may also refine plans or goals during execution based on early outcomes.Source: §1 · p. 1
  • Design challenges include uncertain long-term plans, underspecified instructions, limited explainability, and accountability intertwined across agents and other entities.Small deviations in dependent plan steps can affect overall success; ambiguous goals or limited context can also lead to underspecification.Source: §1 · pp. 1–2
  • The catalogue presents 18 patterns to guide agent design and development and specifies collaboration schemes between agents.Its scope is goal-seeking agents that generate plans, rather than AI acting on behalf of another entity.Source: §1 · p. 2
  • The FM-agent ecosystem guide covers human and agent feedback for reasoning certainty and explainability, plus cooperation schemes with different accountability processes.The ecosystem is presented as a guide for agent design and development.Source: §1 · p. 2
  • The paper analyzes pattern contexts, addressed issues, benefits, trade-offs, real-world uses, and relationships, and proposes a model to structure pattern selection.It also reports experiences applying patterns in research projects.Source: §1 · p. 2

2 Background & Related Work

Prior work describes architectures and components for AI and FM-based agents, but the paper identifies a lack of holistic architecture design guidance. It presents 18 patterns for goal-seeking and plan generation as a basis for trade-off analysis.

2 Background & Related Work

  • Prior agent architectures often focus on selected components or schemes, including memory, reflection, tool use, planning, and multi-agent collaboration.Related work also includes designs for compound AI systems, hierarchical artificial societies, and FMware.Source: §2 · p. 3
  • The paper identifies a lack of holistic architecture design and presents 18 patterns for goal-seeking and plan generation to support trade-off analysis.It notes that component lists may omit software elements’ relationships and properties.Source: §2 · p. 3
  • Figure 2 depicts the FM-based agent ecosystem with architectural patterns annotated in gray boxes.The caption identifies the figure as an ecosystem view of FM-based agent systems.Source: Figure 2 · p. 4

3 Methodology

The methodology combines a systematic literature review with an additional review of grey literature and real-world applications. The combined findings yield 18 patterns and a pattern-oriented reference architecture.

3 Methodology

  • The systematic literature review selected and quality-assessed studies, included 57 for synthesis, and informed a pattern-oriented reference architecture.The review used preset selection criteria and forward and backward snowballing.Source: §3 · p. 4
  • An additional review examined grey literature and real-world applications to identify known uses of the included patterns.The review scrutinized official websites and documents.Source: §3 · p. 5
  • Combining the systematic review and additional review findings, the paper reports 18 extracted patterns.The additional review followed the systematic literature review findings.Source: §3 · pp. 4–5

4 Pattern Catalogue for Foundation Model-based Agents

The catalogue organizes reusable patterns for foundation model-based agents and maps how goal capture, prompt refinement, planning, reflection, and tool or agent cooperation fit together. Its first three patterns address goal interpretation and standardized prompt and response handling.

4 Pattern Catalogue for Foundation Model-based Agents

  • The catalogue uses an extended pattern template and maps patterns across an agent ecosystem, while simplified diagrams omit detailed component interactions.The ecosystem description traces patterns from goal capture and planning through reflection, tool use, cooperation, and evaluation.Source: §4 · pp. 5–6

4.1 Passive Goal Creator

  • Passive goal creation analyzes dialogue input with relevant memory, then sends determined goals and context for prompt refinement and downstream task completion.Users may still face reasoning uncertainty when context is unclear or ambiguous and prompts lack standard requirements.Source: §4.1 · pp. 6–7

4.2 Proactive Goal Creator

  • Proactive goal creation supplements prompts and memory with detector-captured multimodal surroundings to anticipate goals, including gestures or interface layouts.It can support accessibility, but tool-enabled capture may raise agent cost and limited context may increase communication overhead.Source: §4.2 · pp. 7–8

4.3 Prompt/Response Optimiser

  • The optimiser refines prompts and responses against predefined content and format constraints, supporting standardisation, goal alignment, interoperability, and adaptation.Template maintenance can be time-consuming and error-prone, while ambiguous input and dependence on context engineering can hinder appropriate outputs.Source: §4.3 · pp. 9–10
  • Ambiguous input and dependence on context engineering can hinder appropriate prompts or responses, while changing requirements may make template maintenance time-consuming and error-prone.Requirement changes may necessitate modifying multiple templates.Source: §4.3 · p. 10

4.4 Retrieval Augmented Generation (RAG)

The catalogue presents retrieval-augmented generation (RAG) for supplying agents with knowledge beyond model training, including local data, and one-shot querying for generating a plan in a single model interaction. These patterns trade resource or interaction costs against limits in data coverage, task complexity, and reasoning detail.

4.4 Retrieval Augmented Generation (RAG)

  • RAG retrieves internal or online facts to address knowledge gaps, and its summary highlights knowledge updatability and privacy for on-premise implementations.The described pipeline indexes data, retrieves relevant material for a query, then reranks and filters it before producing a response.Source: §4.4 · pp. 10–11
  • RAG avoids pretraining or fine-tuning the served model, but maintaining and updating parameterized knowledge adds computation and storage costs.The agents still mainly rely on their training data, which can affect generated-content quality and accuracy in specific domains.Source: §4.4 · pp. 11–12

4.5 One-Shot Model Querying

  • One-shot querying asks the foundation model once to generate a multi-step plan from user goals and constraints, with a holistic explanation but no detailed reasoning steps.The pattern is presented as suitable for tasks that do not require complex action plans.Source: §4.5 · pp. 12–13
  • For complex tasks, one-shot querying may oversimplify requirements; its single interaction may also limit detailed explanations and be constrained by context-window size.The pattern is motivated in part by time and interaction costs, including fees for commercial model calls.Source: §4.5 · pp. 12–13

4.6 Incremental Model Querying

These sections describe three planning patterns: incremental querying develops a plan through multiple model interactions, while single-path and multi-path generators organize intermediate steps into one route or several choices. Their trade-offs include interaction overhead, flexibility, and the complexity of accommodating user preferences.

4.6 Incremental Model Querying

  • Incremental model querying builds a plan step by step through repeated foundation-model queries, with human feedback and adjustable query counts during the process.It can split context across prompts and support iterative refinement, but multiple interactions may increase planning time and commercial-model costs.Source: §4.6 · pp. 13–14

4.7 Single-Path Plan Generator

  • A single-path generator creates a linear plan with one subsequent step at each stage, prioritizing tasks toward the user’s goal.It can provide a coherent route and prune unnecessary steps, but may limit customization or oversimplify tasks requiring multifaceted approaches.Source: §4.7 · p. 15

4.8 Multi-Path Plan Generator

  • A multi-path generator offers choices at each intermediate step, allowing user preferences to shape subsequent steps and the eventual plan.It supports multiple directions for complex tasks, while task decomposition and multiple plans may increase communication overhead.Source: §4.8 · p. 17

4.9 Self-Reflection

Self-reflection lets an agent review and refine its own plan and reasoning, while cross-reflection uses other agents or foundation models to provide feedback. Both seek to improve plans and reasoning, with cross-reflection adding dependencies on reflective agents and multi-agent accountability concerns.

4.9 Self-Reflection

  • Self-reflection iteratively reviews an agent’s reasoning and generated content, backtracks to check potentially misleading intermediate results, and refines the plan.Reflection results can be saved in memory for continuous learning; evaluation quality depends on the agent’s competence, and the pattern adds complexity and expertise requirements.Source: §4.9 · pp. 17–18
  • Self-reflection can support reasoning certainty and explainability, while memory and prompt updates are described as supporting more reliable outputs with fewer reflection steps.The paper also describes self-evaluation as avoiding the communication overhead of other reflection patterns.Source: §4.9 · p. 18

4.10 Cross-Reflection

  • Cross-reflection sends an agent’s logged outputs and reasoning steps to another reflective agent for review and refinement suggestions, potentially repeating until confirmation.Multiple reflective agents may be queried for more comprehensive responses; their performance constrains response quality and reliability.Source: §4.10 · p. 19
  • Cross-reflection can provide multiple reasoning outputs and explanations, and reflective agents can be updated without disrupting system operation.The pattern raises concerns about fairness, communication overhead, and accountability when multiple agents are involved.Source: §4.10 · pp. 19–20

4.11 Human Reflection

Human reflection lets users or experts review and iteratively refine an agent’s plan, while voting-based cooperation lets agents select feedback and return it for response refinement. The patterns address preference alignment and fair decision-making, with different limitations around feedback, communication, and decision rights.

4.11 Human Reflection

  • Human reflection presents the agent’s plan and reasoning logs for user or expert review, then incorporates comments iteratively until the plan is approved.Reviewers can indicate which intermediate steps to update or replace.Source: §4.11 · p. 20
  • Human feedback can align plans with preferences and tailor outcomes to users’ needs, but ambiguous feedback, limited emotional understanding, skewed information, and repeated-round overhead remain concerns.Users or experts can also contest abnormal agent outcomes.Source: §4.11 · p. 21

4.12 Voting-based Cooperation

  • Voting-based cooperation lets agents submit reflective suggestions as choices, with a coordinating agent collecting votes and returning the result for response refinement.The voting procedure and participating agents’ identities can be managed to support vote traceability and verifiability.Source: §4.12 · p. 22
  • Voting schemes can record procedures and outcomes for auditing, but centralised decision rights may compromise the vote and voting adds communication overhead.Votes may use equal head-counting or role-based weights.Source: §4.12 · p. 22
  • The paper describes agent voters as tending toward uniform choices, whereas human voters showed diverse preferences across 24 urban projects [56].This finding is reported by Yang et al. [56].Source: §4.12 · p. 22

4.13 Role-based Cooperation

Role-based cooperation assigns agents different responsibilities and finalizes decisions according to those roles; debate-based cooperation iteratively exchanges arguments and feedback toward consensus. Both organize collaboration among agents, but debate depends on reasoning capability and can incur privacy, coordination, and scalability costs.

4.13 Role-based Cooperation

  • Role-based cooperation assigns agents roles and coordinates them hierarchically, with planners decomposing goals, assigners allocating tasks, and workers completing tasks using domain expertise.A creator role may establish a new agent when none is available.Source: §4.13 · p. 23
  • Role assignments clarify responsibilities and support accountability; inactive agents can be replaced by agents of the same role, while cooperation adds communication and service costs.New or created roles can extend the workflow and system capability.Source: §4.13 · p. 24

4.14 Debate-based Cooperation

  • Debate-based cooperation has agents exchange initial responses, evidence, and directions in iterative discussion, ending after a preset number of rounds or when consensus is reached.Agents may use shared memory or access one another’s memory during debate.Source: §4.14 · pp. 24–25
  • Debate preserves arguments and evidence for explainability and is described as supporting adaptability and critical thinking, but its effectiveness relies on agents’ reasoning, argument, and evaluation capabilities.The paper also identifies possible data-privacy constraints, communication and computation overhead, and coordination complexity as agent numbers grow.Source: §4.14 · p. 25

4.15 Multimodal Guardrails

Multimodal guardrails verify and process foundation-model inputs and outputs against specified requirements, while a tool/agent registry helps agents discover and select external services. The catalogue also notes guardrail costs and registry centralization risks.

4.15 Multimodal Guardrails

  • Multimodal guardrails act between a foundation model and other components, checking incoming information and model responses against predefined requirements and processing risky or sensitive content.They can use examples or reference-free evaluation and monitor text, audio, and video.Source: §4.15 · pp. 26–27
  • Guardrails can filter inappropriate context, validate responses, and be configured to align foundation-model behavior with organizational policies, ethical standards, and legal requirements.The catalogue describes adaptability across models and customized requirements.Source: §4.15 · p. 27
  • Developing high-quality multimodal guardrail data and processing multimodal inputs in real time can require substantial resources, and complex guardrails can be difficult to explain.Source: §4.15 · p. 27

4.16 Tool/Agent Registry

  • A tool/agent registry catalogs external agents and tools by attributes such as capability, price, and context window, allowing an agent to select and assign them to decomposed tasks.The registry may be implemented through a coordinator agent or a blockchain-based smart contract.Source: §4.16 · p. 28
  • The registry can make services easier to discover and compare, but it may introduce vendor lock-in, a single point of failure, manipulation risk, and maintenance overhead.The paper characterizes the registry’s metadata structure as lightweight and scalable.Source: §4.16 · p. 28

4.17 Agent Adapter

An agent adapter translates between an agent’s messages and external-tool interfaces, while an agent evaluator tests agent behavior against scenario-specific requirements and metrics. The catalogue notes maintenance needs for adapters and dependence on test cases and rubrics for evaluation.

4.17 Agent Adapter

  • An agent adapter converts agent messages to tool-required formats, invokes services, and returns execution results to the foundation model for further analysis.It may retrieve manuals or tutorials to learn tool interfaces; fine-grained interface descriptions can improve agent understanding and performance.Source: §4.17 · pp. 29–30
  • The adapter can support interoperability and use of new tools while reducing the need to manually develop compatible interfaces, but it requires maintenance and evaluation.It may also need memory or an external data store to record historical tool interfaces.Source: §4.17 · p. 30

4.18 Agent Evaluator

  • An agent evaluator tests responses and reasoning at design time and runtime using scenario requirements, metrics, expected outputs, and context-specific test cases.Evaluation results can reveal boundary cases and near-misses for further tuning or risk mitigation.Source: §4.18 · pp. 30–31
  • Evaluation results help developers compare actual with expected behavior and decide whether to adapt agents or define customized metrics, but quantified quality rubrics are difficult and evaluation quality depends on test cases.Source: §4.18 · p. 31

5 Lessons Learned From the Pattern Catalogue

This section presents a pattern-selection model, reports pattern applications in research projects, and discusses integration, regulatory alignment, and evaluation.

5.1 Decision Model

  • The decision model maps design decisions to alternative pattern solutions, allows complementary patterns, and has no prescribed application sequence.It highlights strengths and trade-offs while omitting common attributes of alternatives and centralizing shared attributes of complements.Source: §5.1 · p. 32
  • Pattern choices cover goal elicitation and context, plan generation and reflection, agent cooperation, safeguards, tool interoperability, and pre-release evaluation.Options include proactive or passive goal creation, retrieval-augmented context, single- or multi-path plans, several reflection approaches, multimodal guardrails, registries, and adapters.Source: §5.1 · pp. 32–33

5.2 Pattern Application

  • Applications span a bespoke-agent platform and examples including Universal Task Assistant29, Prompt Sapper, guardrail analysis [73], and evaluation guidance [74].The examples apply patterns to mobile-interface task completion, requirement elicitation and prompt refinement, guardrail design, and system- or component-level evaluation.Source: §5.2 · p. 33

5.3 Discussion

  • The catalogue can complement responsible-AI patterns, runtime input/output logging for accountability, and multi-agent collaboration designs.The discussion also describes social-learning models, debate-based imitative learning, and blockchain smart contracts for voting-based cooperation.Source: §5.3 · p. 33
  • The authors identify mapping the catalogue to regulatory requirements as future work, while recording agent creation and operation information for auditing.They also note that generated workflows require inspection against domain specifications.Source: §5.3 · pp. 33–34
  • Pattern benefits and drawbacks still require quantification through fine-grained metrics and rubrics to support agent evaluation and validate pattern effectiveness.The authors also describe exploring real-time workflow-exception handling, including task dependencies and external-tool API version matching.Source: §5.3 · p. 34

6 Conclusion

The paper presents 18 patterns with their forces, solutions, and trade-offs as holistic guidance for foundation model-based agent architecture. Future work will examine their integration with existing patterns and further architecture decisions.

6 Conclusion

  • The catalogue scrutinizes the forces, solutions, and trade-offs of 18 patterns to guide foundation model-based agent design and development.The authors frame it as holistic guidance for architects.Source: §6 · p. 34
  • Future work will study applying the catalogue with existing patterns to preserve agent trustworthiness.Source: §6 · p. 34
  • The authors also plan to explore architecture decisions related to foundation model-based agents.Source: §6 · p. 34
Loading 2405.10467v4…