
Patterns for Building Generative AI Applications on Amazon Bedrock
With generative AI, we are introduced to a new, exciting and powerful primitive for building software. Learn how you can build generative AI applications without deep machine learning expertise. We cover foundational patterns, considerations, and practices learned from our experience working with early adopters.
1
2
3
4
5
6
7
8
9
10
11
12
Context:
{Generative AI on AWS}
{AWS Machine Learning Blog}
{AWS Documentation}
{Well-Architected Framework}
{AWS Reference Architectures}
Instruction:
You are an expert AWS Solutions Architect.
Provide me with expert insights on {question}.
Summarize insights and recommendations based only on the Context.
If the Context does not provide the answer, say "I don't know".
{placeholders}
are template placeholders and you replace them with actual data.- Prevent hallucination by letting the model say “I don’t know”
- Provide a level of explainability by asking to cite sources
- RAG Pipeline to process data from your knowledge sources
- RAG Runtime to process user prompts using Bedrock

0
to mitigate randomness in the output for evaluation.


- Instruction:
What is the current weather in Sydney in celsius?
- Output:
get_weather(location = "Sydney", units = "C")
1
2
3
4
5
6
7
8
9
10
11
<function>
<function_name>get_weather</function_name>
<function_description>Returns the current weather for a given location</function_description>
<required_argument>location (str): Name of city or airport code</required_argument>
<optional_argument>units (str): Temperature units, either "F" for Fahrenheit or "C" for Celsius, default "F"</optional_argument>
<returns> weather (dict): - temperature (float): Current temperature in degrees - condition (str): Short text description of weather conditions </returns>
<raises>ValueError: If invalid location provided</raises>
<example_call>
get_weather(location="New York", units="F")
</example_call>
</function>
Any opinions in this post are those of the individual author and may not reflect the opinions of AWS.