Lesson 1 of 3 Designing Generative AI Solutions

Translating Requirements into Generative AI Architectures

This lesson explains how a generative AI architecture is built from a chain of decisions, pattern, model, knowledge, integration and hosting, each traceable to a requirement, and how requirements select between the main patterns.

Learning outcomes

After completing this lesson, you will be able to:

  • Identify the requirements specific to foundation models and state them in measurable form.
  • Choose between direct prompting, RAG, agents, workflows and customisation.
  • Choose integration and deployment approaches from timing and coupling.
  • Recognise technical constraints that reshape a design.

Gathering requirements

Requirements for generative AI include the usual functional and non-functional requirements plus several that are specific to FMs. Quality requirements define what a good answer is and how it will be measured, for example 95% factual accuracy on a test set or answers that always cite a source. Knowledge requirements describe the information the model needs: public general knowledge, private documents, live data from business systems, and how often each changes. Interaction requirements describe whether users chat, submit forms, or whether no user is involved at all.

Non-functional requirements include latency (time to first token for chat, end-to-end time for forms), throughput (requests and tokens per minute at peak), cost per request or per month, availability, data sensitivity, residency, and regulatory obligations such as audit trails and human oversight. Writing these down before choosing a model prevents designs driven by whichever model is newest.

Architecture patterns

Direct prompting sends instructions and input to an FM and returns the output. It suits general tasks such as summarising a supplied document, drafting text or classifying input, where everything the model needs is in the prompt. Retrieval Augmented Generation (RAG) retrieves relevant passages from a knowledge store at request time and adds them to the prompt. It suits private or frequently changing knowledge, reduces hallucination and allows citations, without changing the model.

An agent gives the model tools, such as APIs, databases and code execution, and lets it plan and act over several steps; it suits tasks that require live data or actions in other systems. Multi-agent systems divide complex work among specialised agents. Fine-tuning adapts a model's behaviour with labelled examples and suits a consistent style, format or domain vocabulary that prompting cannot achieve reliably, or a smaller model that must match a larger one on a narrow task. Batch generation processes large volumes offline. Patterns combine: an agent may use RAG as one of its tools, and a fine-tuned model may be grounded with RAG.

The following table summarises when each pattern fits.

PatternFits whenMain trade-off
Direct promptingAll needed information is in the promptLimited to the model's knowledge
RAGPrivate, large or changing knowledge; citations neededRetrieval quality limits answer quality
AgentLive data or actions in other systemsLess predictable; needs safeguards
Multi-agentDistinct specialist tasks in one workflowCoordination complexity and cost
Fine-tuningConsistent style or format; narrow task on a smaller modelTraining data, cost and retraining
Batch generationLarge offline volumesNo interactivity

The following diagram matches typical requirements to the pattern that serves each one.

Matching requirements to architecture patterns. Direct prompting suits tasks where everything is in the prompt. RAG suits private or frequently changing knowledge that needs citations. An agent with tools suits live data and actions in other systems. Fine-tuning suits a consistent style or format that prompting cannot achieve, and batch generation suits large offline volumes. Patterns combine.
Most production designs combine two or more of these patterns.
Sort into groups

Choose the architecture pattern

Exam skills 1.1.1

Choose the pattern that fits each requirement.

Log in to try this activity Interactive activities are free with an account.

Integration and deployment choices

The integration pattern follows timing and coupling. Interactive applications call the model synchronously through API Gateway and Lambda, and stream responses for chat. Workloads where callers need not wait use SQS queues or EventBridge events, which decouple systems and smooth bursts. Large offline jobs use Bedrock batch inference. Existing enterprise systems usually integrate through events or APIs rather than direct database access.

The deployment strategy follows volume, model choice and control. Bedrock on-demand suits variable traffic, cross-Region inference raises throughput and availability, Provisioned Throughput guarantees capacity for steady high volume or custom models, and SageMaker AI endpoints host models Bedrock does not offer. Regional choice follows data residency rules. These choices are explained in detail in later modules; at design time, the aim is to match each one to a stated requirement.

The following diagram applies these choices to a bank assistant that reports balances, explains fees from a quarterly fee schedule and freezes lost cards, the scenario analysed in the worked example below.

The bank assistant's design. Customer requests pass a guardrail to an agent. The agent has two action tools in Lambda that run with the customer's identity, get balance and freeze card, where freezing needs confirmation, and a knowledge base tool that answers fee questions from the quarterly fee schedule with citations.
The guardrail applies to the agent's input and output.

Technical constraints that change the design

Several technical constraints frequently reshape an otherwise suitable design, and exam scenarios often hinge on one of them. The context window limits how much text a single request can contain. When the documents to process are larger than the window, the design must split them into chunks and either retrieve only the relevant chunks (RAG) or summarise each chunk and then summarise the summaries, an approach called map-reduce summarisation.

Quotas limit requests and tokens per minute for each model in each Region. If peak demand exceeds the quota, the design must queue requests, spread them across Regions with cross-Region inference or reserve capacity with Provisioned Throughput; simply retrying throttled calls does not create more capacity. Data residency rules restrict which Regions may process data, which also limits cross-Region inference to profiles within an allowed geography. Model availability differs by Region, so a model not offered in the required Region may be reachable only through a cross-Region inference profile.

Finally, latency budgets can rule out the largest models. When a response must start within a few hundred milliseconds, the design uses smaller models, streaming, caching of frequent answers or pre-computation of results before users ask for them.

Scenario questions

Constraints that reshape a design

Exam skills 1.1.1

Decide how a technical constraint changes an otherwise suitable design.

Log in to try this activity Interactive activities are free with an account.
Worked example

Choosing the pattern

A bank wants an assistant that tells customers their current account balance, explains fees from a 300-page fee schedule that changes quarterly, and lets them freeze a lost card. Fee answers must cite the schedule.

Balance and card freezing need live data and an action, so the assistant needs tools: an agent. Fee explanations need a large document that changes quarterly, with citations: RAG through a knowledge base. Freezing a card is a sensitive action, so it needs authentication and confirmation.

The design is an agent with two action tools (get balance, freeze card) implemented in Lambda with the customer's identity, a knowledge base tool for the fee schedule, and a guardrail. Fine-tuning on the fee schedule would be wrong: it would need retraining each quarter and could not cite the source.

Check yourself

Which requirements should be written down, in measurable form, before an architecture is chosen?

Show answer

Quality, knowledge, latency, throughput, cost and compliance requirements, because each one rules patterns and services in or out.

Exam Tips

Remember for the exam

  • Write measurable quality, knowledge, latency, throughput, cost and compliance requirements first.
  • Private or changing knowledge with citations: RAG. Live data or actions: agent with tools.
  • Fine-tuning changes behaviour and style, not up-to-date knowledge.
  • Timing chooses the integration pattern; volume and control choose the deployment option.