SaveMyCert
Log in
5 of 5 free questions left today·for unlimited practice
Applications of Foundation Models

Foundation Model Design: Selection, RAG, and Customization (AIF-C01)

14 min readAIF-C01 · Applications of Foundation ModelsUpdated

Designing an application around a foundation model (FM) means making a series of practical choices: which model to use, how to control its responses, how to feed it your own data, and how far to go in customizing it. This lesson covers Task 3.1 of the AIF-C01 exam, the cornerstone of the heaviest-weighted domain. You will learn the criteria for selecting a foundation model, the inference parameters that shape its output, and Retrieval Augmented Generation (RAG), the technique that lets a model answer from current or private data without retraining. You will also learn which AWS services store the embeddings that power RAG, the full cost-and-effort spectrum of customization approaches from prompt engineering to pre-training, and the role of AI agents. These are recognition-level concepts: the exam rewards knowing which approach fits a described need, not building the system yourself.

What you’ll learn
  • Identify the criteria used to select a foundation model, including cost, modality, latency, and customization.
  • Describe how inference parameters such as temperature and output length affect model responses.
  • Define Retrieval Augmented Generation (RAG) and its business applications, including Amazon Bedrock Knowledge Bases.
  • Name the AWS services that store embeddings in vector databases.
  • Compare FM customization approaches by cost and effort, from prompt engineering to pre-training.
  • Explain the role of AI agents and their business applications.

Selecting a Foundation Model: The Criteria That Matter

Choosing a foundation model is the first design decision, and the exam expects you to recognize the criteria that guide it. No single model is best for every job, so you match the model to the need. The main selection criteria are summarized below.

CriterionWhat to consider
CostPrice per token; larger, more capable models usually cost more per request.
ModalityThe data types the model handles, such as text, image, audio, or multi-modal input.
LatencyHow quickly the model responds; real-time chat needs low latency.
Multi-lingualWhether the model supports the languages your users speak.
Model size and complexityLarger models are often more capable but slower and more expensive.
CustomizationHow much the model can be adapted through fine-tuning or other methods.
Input/output lengthThe maximum tokens in and out, which limits how much context and how long an answer can be.
Prompt cachingReusing repeated prompt content to cut cost and latency on similar calls.

The exam pattern is a scenario that stresses one criterion. If a question emphasizes fast responses for a chatbot, latency wins; if it stresses keeping spend low at high volume, cost and a smaller model win; if users write in several languages, multi-lingual support decides. Read for the constraint the scenario highlights and match the criterion.

Inference Parameters: Controlling the Model's Output

Once you pick a model, inference parameters let you steer each response without changing the model itself. Inference is the act of generating an answer from a prompt, and these settings adjust how that answer is produced. The exam focuses on a few key levers.

ParameterEffect on the response
TemperatureControls randomness. Lower values make output more focused and deterministic; higher values make it more diverse and creative.
Top-p (nucleus sampling)Limits word choices to the smallest set whose combined probability reaches p. Lower p means safer, more predictable wording.
Top-kLimits word choices to the k most likely next tokens. Smaller k narrows the options.
Max tokens / output lengthCaps how long the generated answer can be.
Input lengthHow much prompt and context you can send, bounded by the model's context window.

The most tested lever is temperature. To make output more deterministic, consistent, and factual, such as for a support answer or data extraction, lower the temperature. To make output more creative and varied, such as for brainstorming marketing ideas, raise it. Top-p and top-k are alternative ways to control randomness and are usually adjusted at a concept level. Output length matters for both cost and completeness: too low a cap can cut answers off, while a high cap allows longer, more expensive responses. Remember that these settings change behavior per request; they do not retrain or permanently alter the model.

Retrieval Augmented Generation (RAG)

Retrieval Augmented Generation (RAG) is a technique that retrieves relevant information from an external knowledge source and adds it to the prompt, so the model answers from current or proprietary data instead of only what it learned during training. The flow is simple: the user asks a question, the system searches a knowledge source for the most relevant passages, those passages are inserted into the prompt as context, and the model generates an answer grounded in them.

RAG matters because a foundation model's built-in knowledge is frozen at training time and does not include your company's private documents. Without RAG, a model asked about your internal policy either cannot answer or may hallucinate, meaning it produces a confident but wrong answer. By grounding the response in retrieved facts, RAG reduces hallucination and keeps answers current, all without retraining the model.

Business applications are broad: internal knowledge assistants that answer from company wikis, customer-support bots grounded in product manuals, and research tools that cite source documents. On AWS, Amazon Bedrock Knowledge Bases is the managed RAG service. You point it at your documents, and it handles chunking, creating embeddings, storing them, retrieving the relevant pieces at query time, and passing them to the model, so you do not build the retrieval pipeline yourself. For the exam, connect the phrase "answer from current or private data without retraining" directly to RAG, and "managed RAG on AWS" to Amazon Bedrock Knowledge Bases.

Vector Databases: Where Embeddings Are Stored

RAG depends on finding passages by meaning, not exact keywords. To do that, each chunk of your documents is converted into an embedding, a numerical representation of meaning expressed as a vector, and stored in a vector database. When a user asks a question, the question is also embedded, and the database returns the stored chunks whose vectors are closest, meaning the passages most similar in meaning. Vector storage and similarity search are what make retrieval work.

The exam expects you to recognize which AWS services can store embeddings in vector databases. The named options are:

  • Amazon OpenSearch Service — search and analytics engine with vector search capability, a common choice for RAG.
  • Amazon Aurora — the managed relational database, which supports vector storage through PostgreSQL compatibility.
  • Amazon Neptune — the managed graph database, which supports vector search.
  • Amazon RDS for PostgreSQL — managed PostgreSQL, which stores and searches vectors using the pgvector extension.

You do not need to know how to configure these for the exam. The recognition-level point is that vector databases hold embeddings for similarity search, and that on AWS these four services can serve that role. When a question describes storing embeddings to power semantic search or RAG, any of these services is a valid answer, and Amazon Bedrock Knowledge Bases can use such a store behind the scenes as its managed vector database.

Customizing a Foundation Model: The Cost-and-Effort Spectrum

When a base model is not enough, you can customize it, and the approaches form a spectrum from cheap and easy to expensive and involved. The exam loves "which customization approach" questions, so learn the ladder.

ApproachWhat you doCost and effort
Prompt engineering / in-context learningImprove wording and put examples or context in the prompt; no training at all.Lowest
RAGAdd a knowledge source so the model answers from your data; no retraining.Low to moderate
Fine-tuningFurther train the model on your labeled examples to specialize its behavior or style.Higher
Continuous pre-trainingKeep training on large amounts of your unlabeled domain data.Very high
Pre-training from scratchBuild and train a brand-new foundation model.Highest

Start at the top and move down only if you must. Prompt engineering and in-context learning are the cheapest way to customize because they require no training. RAG adds your data without retraining. Fine-tuning trains the model on your examples and costs more. Continuous pre-training and pre-training from scratch are the most expensive. Separately, model distillation creates a smaller, cheaper, faster model that mimics a larger one, trading a little quality for much lower inference cost. If a question asks for the cheapest way to adapt a model, the answer is prompt engineering or in-context learning; if it asks how to reduce ongoing inference cost, think distillation.

AI Agents: Foundation Models That Take Action

An AI agent is an application that uses a foundation model as its reasoning engine and can take actions to complete a goal, not just return text. An agent combines three ingredients: the FM for reasoning, tools it can call (such as looking up an order, querying a database, or triggering an API), and orchestration that decides the steps and chains them together. This lets an agent break a request into steps, call the right tool at each step, and use the results to reach an outcome.

Consider a customer-service example. A shopper asks an agent to change a delivery address. The agent interprets the request, calls a tool to look up the order, calls another tool to update the address, confirms the change, and replies in natural language. A plain chatbot could only describe how to do it; the agent actually does it by using tools and orchestrating the steps.

Business applications include automating customer-service tasks, coordinating multi-step workflows such as booking or IT requests, retrieving and combining information from several systems, and assisting employees with routine operations. For the exam, remember the defining idea: an agent is a foundation model plus tools plus orchestration that takes actions, which sets it apart from a model that only generates a response. The deeper design of multi-agent systems is a Domain 2 concept; here you need the role and the business value.

Putting It Together: Choosing the Right Approach

Task 3.1 questions usually describe a need and ask which design choice fits. A quick worked example ties the pieces together. Suppose a company wants an assistant that answers employee questions from its constantly changing internal HR documents, gives consistent factual replies, keeps cost low, and needs no data-science team.

Work through the decisions. Because the answers must come from current, private documents, the right technique is RAG, not fine-tuning, since RAG adds your data without retraining and stays up to date as documents change. On AWS, Amazon Bedrock Knowledge Bases provides this as a managed service, storing the document embeddings in a vector database such as Amazon OpenSearch Service. To keep replies consistent and factual rather than creative, set a low temperature. For model selection, favor a smaller, lower-cost model with adequate quality and low latency to control spend and keep responses fast. If the assistant also needs to take actions, such as submitting a leave request, add an agent with the right tools.

Notice the order of preference throughout: reach for the cheapest, least invasive option that meets the need. Prompt engineering and RAG come before fine-tuning; fine-tuning comes before continuous pre-training; and pre-training from scratch is almost never the answer for a business application. That instinct, match the constraint in the scenario to the lightest approach that satisfies it, is exactly what the exam rewards.

Tip. Expect scenario questions that map a described need to a design choice. Watch for the trigger "answer from current or private data without retraining," which points to RAG (managed by Amazon Bedrock Knowledge Bases), and "make output more deterministic or factual," which means lowering the temperature. Questions asking for the cheapest way to customize a model want prompt engineering or in-context learning, while a request to store embeddings for semantic search points to a vector database such as Amazon OpenSearch Service, Aurora, Neptune, or RDS for PostgreSQL.

Key takeaways
  • Select a foundation model by matching the scenario's constraint to a criterion: cost, modality, latency, multi-lingual support, model size and complexity, customization, input/output length, or prompt caching.
  • Inference parameters steer each response; lower temperature makes output more deterministic and factual, higher temperature makes it more creative, and max tokens caps answer length.
  • Retrieval Augmented Generation (RAG) retrieves relevant information and adds it to the prompt so the model answers from current or private data without retraining, reducing hallucination.
  • Amazon Bedrock Knowledge Bases is the managed RAG service on AWS; embeddings can be stored in Amazon OpenSearch Service, Amazon Aurora, Amazon Neptune, or Amazon RDS for PostgreSQL.
  • Customization runs cheapest to most expensive: prompt engineering / in-context learning, then RAG, then fine-tuning, then continuous pre-training, then pre-training from scratch.
  • Model distillation creates a smaller, cheaper, faster model from a larger one to reduce inference cost.
  • An AI agent is a foundation model plus tools plus orchestration that takes actions to complete multi-step tasks, unlike a model that only returns text.

Frequently asked questions

What is RAG in AWS?

Retrieval Augmented Generation (RAG) is a technique that retrieves relevant information from an external knowledge source and adds it to the model's prompt, so the foundation model answers from current or proprietary data instead of only what it learned during training. This keeps answers up to date and reduces hallucination, all without retraining the model. On AWS, Amazon Bedrock Knowledge Bases is the managed RAG service: you point it at your documents and it handles chunking, embedding, storing the vectors, retrieving the relevant passages at query time, and passing them to the model. The embeddings can be stored in a vector database such as Amazon OpenSearch Service, Amazon Aurora, Amazon Neptune, or Amazon RDS for PostgreSQL.

What is the cheapest way to customize a foundation model?

The cheapest way to customize a foundation model is prompt engineering, also called in-context learning, because it requires no training at all. You simply improve the wording of the prompt and include instructions, context, or examples so the model performs better on your task. The next step up is RAG, which adds your own data through retrieval but still does not retrain the model. Only after those do you consider fine-tuning, which trains the model on your labeled examples and costs more, followed by continuous pre-training and, most expensive of all, pre-training a new model from scratch. On the exam, when a scenario asks for the lowest-cost or lowest-effort way to adapt a model, choose prompt engineering or in-context learning.

How does temperature affect a model's output?

Temperature is an inference parameter that controls the randomness of a model's responses. A lower temperature makes the output more focused, consistent, and deterministic, which is what you want for factual tasks such as answering support questions or extracting data. A higher temperature makes the output more diverse and creative, which suits brainstorming or generating varied marketing copy. On the exam, when a scenario asks how to make responses more deterministic, predictable, or repeatable, the answer is to lower the temperature; when it asks for more creative or varied output, raise it. Temperature changes behavior per request and does not retrain the model.

Which AWS services store embeddings for vector search?

The AWS services the exam names for storing embeddings in vector databases are Amazon OpenSearch Service, Amazon Aurora, Amazon Neptune, and Amazon RDS for PostgreSQL. A vector database holds embeddings, which are numerical representations of meaning, and finds the closest matches to a query by similarity, which is what powers semantic search and RAG. Amazon OpenSearch Service is a common choice for vector search; Amazon Aurora and Amazon RDS for PostgreSQL support vectors through PostgreSQL and the pgvector extension; and Amazon Neptune, a graph database, also supports vector search. Amazon Bedrock Knowledge Bases can use one of these as its underlying vector store.

What is an AI agent?

An AI agent is an application that uses a foundation model as its reasoning engine and can take actions to accomplish a goal, rather than only returning text. It combines three parts: the foundation model for reasoning, tools it can call such as database lookups or APIs, and orchestration that decides the steps and chains them together. This lets an agent break a request into steps, call the right tool at each step, and use the results to complete a multi-step task. Business applications include automating customer-service actions, coordinating booking or IT workflows, and combining information from several systems. The key distinction is that an agent takes actions through tools, while a plain model only generates a response.

Test yourself on this topic
Practice questions with full explanations.
Practice now

Sign up free to mark lessons complete, bookmark topics and track your exam readiness.