
Day 2: Amazon Bedrock — 5 Ways to Get Better AI Answers
Why does AI give different answers? Day 2 of my Amazon Bedrock series covers 5 simple prompting techniques for AWS Builders using Python & the Playground.
What you'll learn today
- What prompt engineering is, in simple words
- 5 easy techniques anyone can use
- How to use them in the Bedrock Playground and in Python
Time needed: about 15 minutes. Experience needed: only Day 1.
What is prompt engineering?
A prompt is the text you give to an AI. Prompt engineering just means writing that text carefully so you get better answers.
Think of it like ordering food. If you say "give me food," you get anything. If you say "one masala dosa, less oil, with extra chutney," you get exactly what you want. The AI works the same way.
Technique 1: Be specific
Weak prompt:
1
Tell me about AWS.Better prompt:
1
Explain what AWS is in 3 short bullet points for a first-year college student.The second prompt tells the AI the topic, the length, the format, and the audience.
[Screenshot: both answers side by side]
Technique 2: Give the AI a role
1
You are a friendly teacher. Explain what an S3 bucket is using a real-life example.A role changes the tone and style of the answer.
Technique 3: Show an example (few-shot)
Show the AI what you want, then ask your question.
1
2
3
4
5
6
7
8
9
10
Convert each term into a one-line simple meaning.
Term: EC2
Meaning: A virtual computer you rent on the cloud.
Term: S3
Meaning: Online storage where you keep files.
Term: Lambda
Meaning:The AI copies the pattern from your examples.
Technique 4: Control the format
1
List 5 AWS services for beginners as a table with two columns: Service and What it does.You can ask for bullets, tables, JSON, or step-by-step lists.
Technique 5: Set limits
1
Explain Amazon Bedrock in under 50 words, using no technical jargon.Limits stop the AI from rambling.
Try it in the Playground
- Open Amazon Bedrock → Playground → Chat.
- Ask the weak prompt first and note the answer.
- Ask the improved prompt and compare.
Try it in Python
We reuse Day 1's code, now with a system prompt (the role or instructions) and a better question.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import boto3
client = boto3.client("bedrock-runtime", region_name="us-east-1")
response = client.converse(
modelId="amazon.nova-lite-v1:0", # use the model ID shown in your console
system=[{"text": "You are a friendly teacher who explains things simply."}],
messages=[
{
"role": "user",
"content": [{"text": "Explain what an S3 bucket is in 3 bullet points for a beginner. Keep it under 60 words."}],
}
],
inferenceConfig={"maxTokens": 300, "temperature": 0.3},
)
print(response["output"]["message"]["content"][0]["text"])What changed from Day 1?
| Part | What it does |
|---|---|
system | Gives the AI its role and rules |
| Detailed question | Clear topic, format, and length |
temperature: 0.3 | Lower number gives more focused, consistent answers |
A simple prompt formula
Use this whenever you're stuck:
Role + Task + Context + Format + Limit
What I learned / Things that confused me
- [Write your honest experience here, e.g. "My first prompt gave a very long answer until I added a word limit."]
- [Add what surprised you when comparing weak vs better prompts.]
Recap
- Better prompts give better answers
- Be specific, give a role, show examples, set the format, and add limits
- Use the system prompt in Python to set the AI's behavior
Coming up next
Day 3: Embeddings and storing documents in S3. How the AI "understands" your notes, and the first step toward our chatbot. Follow me so you don't miss it!
What's the best prompt you wrote today? Share it in the comments!
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article