К основному содержимому
#Architecture

[2/3] A Prompt Pattern Sequence Approach to Apply Generative AI in Assisting Software Architecture Decision-making (Рубрика Architecture)

#Architecture #GenAI #AI #ML #Software #Engineering #SystemDesign #DistributedSystems #Project

Продолжим рассмотрение whitepaper на тему использования Gen AI в архитектуре, начатый в первом посте, рассмотрением паттернов промтинга.

1) Software architect persona pattern Это паттерн, расширяющий паттерн персоны, где суть в том, чтобы AI генерировал контент релевантный для архитектора, то есть он был точный и адресовал те проблемы, с которыми сталкиваются архитекторы. Это достигается путем создания запросов, которые четко определяют роль архитектора программного обеспечения, цели и ограничения в отношении целевого проектного решения. Вот шаблон промпта от авторов

You are [Persona’s Name] in the role [Role]. Your main goal is [Main Goal]. You cannot [Limitations/Constraints]. В качестве примера промпта приводится следующий You are a Senior Software Architect specializing in cloud-based solutions.Your main goal is to optimize system scalability and performance. You cannot propose solutions that significantly increase operational costs.

2) Architectural project context Авторы предлагают задавать контекст проекта через три ключевых фактора

  • Операционные, такие как доступное время разработки
  • Организационные, такие как размер команды
  • Финансовые, такие как бюджет проекта Эти факторы напрямую влияют на осуществимость и направление архитектурных решений, что требует паттерна, который эффективно интегрирует эти элементы в процесс принятия решений. Интересно, что авторы тут рассматривают проектный подход реализации больших архитектурных изменений. Вот шаблон промпта от авторов

Given a development timeline of [Time], a team of [Team Size], and a budget of [Budget], determine if the proposed architecture [Architecture Description] is feasible and can meet the project requirements without compromising on quality. В качестве примера промпта приводится следующий Given a development timeline of 6 months, a team of 10 developers, and a budget of $500k, determine if implementing a microservices-based architecture for our e-commerce platform is feasible and can deliver the required scalability and performance within these constraints. Как по мне, такое описание контекста проекта кажется слишком убогим, хотелось бы посомтреть как выглядит output LLM, если ей скормить полноценное описание:)

3) Quality attribute question pattern Для проектирования качественной архитектуры нужно правильно определить функциональные и нефункциональные требования, а также выделить желаемые атрибуты качества. Дальше уже можно выбирать архитектурные паттерны, тенологиии и все остальное. В этом паттерне авторы предлагают научить AI-ассистент задавать вопросы живым архитекторам как раз для выделения этих ключевых атрибутов качества. Вот так выглядит шаблон промпта

You are [Role] responsible for [Description Project]. Your primary focus is to design an architecture that excels in [List Of The Quality Attribute]. Your task is [Decision-making Process]. You should ask [Clarify Doubts]. [Recommendations]. Additionally, provide a [Comprehensive Prompt].

В качестве примера промпта приводится следующий

Уou are an experienced software architect responsible for creating a credit card processing system for a medium-sized financial institution. Your primary focus is to design an architecture that excels in scalability, security, and performance. Your task is to carefully navigate through the decision-making process of the credit card processing system architecture step by step. You should ask any necessary questions to clarify doubts about the quality attributes of the new system. Avoid making any architectural decisions until all questions are answered. Additionally, provide a comprehensive prompt that includes all the data collected in the previous steps, along with an explanation of the rationale behind each architectural decision-making.

Продолжение обзора паттернов и их совместного использования в следующем посте.

#Architecture #GenAI #AI #ML #Software #Engineering #SystemDesign #DistributedSystems #Project