Ibnovate Course 2 · The Rising Builders
⏱ 75 minLive session

Session 14 — Build with Generative AI

Duration: 75 min · Format: live online

What you'll learn: by the end, you can write strong prompts using pro patterns, design a chatbot with a system prompt, and use generative AI honestly, safely, and with integrity.

Soft skill focus — Critical thinking

Today you'll also grow critical thinking. A fluent AI answer is not proof it's true — using generative AI well means questioning it and checking it before you rely on it.

Try this: when your study-buddy bot gives an answer, fact-check one important claim against a trusted source and decide whether it's safe to trust.

Think about: When did you decide not to trust the AI, and what made you check?

What you'll need


Hook

Read both of these prompts. Which do you think gets the better result?

Make your guess, then here's the reveal: same AI — wildly different results. The skill isn't in the AI; it's in the asking. Today you'll learn the patterns pros use, build your own chatbot, and — most importantly — use it honestly and safely.


Prompt-engineering patterns

A great prompt goes far beyond one line. Pros stack techniques. Here's the recipe:

A great prompt with Task, Details, Style, and Audience leading to a strong answer

Here are the patterns — try one or two live in your chatbot as you read:

⚠ Watch for lazy prompting: it's tempting to expect the AI to read your mind, then blame it for a bad answer. The fix is yours — add role, context, and format. A vague prompt gets a vague answer.

Quick challenge: take the prompt "write about dogs" and add a role, a format, and an audience to it.


Design a chatbot

A chatbot is a system prompt (its personality + rules) plus a back-and-forth conversation. Here's the flow:

A chatbot with a system prompt persona, a user message, and the AI's reply, looping

⚠ Watch for privacy here: grounding a bot in "your data" must never mean pasting personal or sensitive information (real names, addresses, passwords, other people's data). Ground it in safe text only.

Think it through: what one rule would you put in a study-buddy bot's system prompt so it helps you learn instead of just handing you answers?


Use it responsibly

This is the most important part of the whole module. Generative AI is powerful — which makes using it well a responsibility. Keep all four of these in mind:

⚠ Watch for the academic-integrity line: the boundary is using AI to learn vs passing off AI's work as your own. The first is smart; the second is cheating. When in doubt, disclose how you used it — that's what real teams and judges respect.

Quick check: you used AI to help write a project. What are the two things you must do before you hand it in? (Answer: fact-check it, and disclose/cite that you used AI.)


Activity — Build a study-buddy bot

Start with Path A. If you're ready for code, try Path B too.

Path A — No code (everyone). In a chatbot that supports custom instructions / a "custom GPT" / a Poe bot, set a system prompt. Here's a starter to type in and then adapt:

"You are my Year-8 science study buddy. Quiz me one question at a time, wait for my answer, then explain gently. Never give the full answer first."

Use it for about 5 minutes, then tweak the system prompt until it behaves the way you want. Notice which change makes the biggest difference.

Path B — Python (Builders). With a free API key from Google AI Studio (ask a grown-up), open Colab.

Type and run this in Colab:

import google.generativeai as genai
genai.configure(api_key="YOUR_KEY")          # keep keys private!
model = genai.GenerativeModel("gemini-1.5-flash")

system = "You are a patient study buddy. Explain simply, then ask me one question back."
answer = model.generate_content(system + "\nStudent: How do vaccines work?")
print(answer.text)

⚠ Watch for this: the comment says it all — keep your API key private. A key is like a password; never paste it into chat, a shared doc, or a screenshot.


Check yourself

Answer these, then check yourself against the arrows:

  1. What does a system prompt do? → It sets the chatbot's persona and rules — who it is and how it behaves.
  2. What is "few-shot" prompting? → Giving the AI examples of what you want, so it copies the format and style.
  3. You used AI to help write a project. What must you do?Fact-check it, and disclose/cite that you used AI — never pass it off as fully your own.
  4. True or False: it's fine to paste a friend's home address into a chatbot to plan a visit.False — never share personal or sensitive data with an AI.

Wrap-up


Tips & extra challenges

Vocabulary

Term Meaning
Prompt engineering Writing effective instructions for AI
System prompt Sets the chatbot's persona and rules
Few-shot Prompting with examples
RAG Grounding AI in your own trusted data
Integrity Honest, cited use of AI

Resources

Practice set

Practise on your own to strengthen prompt engineering, chatbots, and responsible use — easy to hard. Answers follow the arrow (→). The Python tasks are for Builders with a grown-up and a free API key.

1. (Easy) Name the four ingredients of a strong prompt from the recipe diagram. → Task, details, style, audience (plus optional role, examples, and output format).

2. (Easy) What does a system prompt do? → It sets the chatbot's persona and rules — who it is and how it must behave — and runs behind every reply.

3. (Medium · prompt-improvement drill) Improve "write about dogs" by adding a role, an audience, and an output format. → e.g. "You are a friendly vet. Write 3 tips on caring for a puppy for a 9-year-old, as a short numbered list."

4. (Medium · prompt-improvement drill) Add a few-shot example to this prompt so the model copies your format: "Turn these facts into flashcards." → e.g. "Format each as 'Q: … / A: …'. Example — Q: Capital of France? A: Paris. Now do these: …"

5. (Medium) A friend wants to plan a surprise party and asks a chatbot, pasting in the guests' home addresses. What's wrong, and what should they do instead? → Sharing personal/sensitive data with an AI is unsafe; keep addresses out and ask only for general planning ideas.

6. (Hard) You used AI to help write a competition project. List the two things you must do before submitting, and why. → Fact-check every important claim (it can hallucinate) and disclose/cite that you used AI (integrity — never pass its work off as fully your own).

7. (Hard · prompt-improvement drill) Rewrite a study-buddy system prompt so it helps you learn rather than handing over answers. → e.g. "You are my science study buddy. Quiz me one question at a time, wait for my answer, then explain gently. Never give the full answer first."

8. (Builder · Python) Fill the blanks so this calls the model with a persona. Why is the comment important?

import google.generativeai as genai
genai.configure(api_key="YOUR_KEY")   # keep keys private!
model = genai.GenerativeModel("gemini-1.5-flash")

system = "You are a ____ that explains simply, then asks one question back."
reply = model.____("How does gravity work?")
print(reply.text)

→ Fill system with a persona (e.g. "patient tutor") and use model.generate_content(system + "\nStudent: How does gravity work?"). The comment matters because an API key is like a password — never paste it into chat, a shared doc, or a screenshot.

9. (Builder · Python · Hard) Ground the model in trusted text so it doesn't invent facts (a tiny RAG). Complete the prompt string:

source = "Our club meets every Tuesday at 4pm in Room 12."
question = "When does the club meet?"
prompt = f"Answer ONLY using this text: {source}\n\nQuestion: {question}"
print(model.generate_content(prompt).text)

→ The instruction "Answer ONLY using this text" grounds the reply in a trusted source, cutting hallucinations. Use only safe, non-personal text as the source.

Going deeper (optional)

Optional enrichment tied to the lesson — no new tools, just the chatbot or Colab you already have open.

Common mistakes & fixes

If it's not working, check these:

What's next

Unit 4 — Build a Web App: with generative AI understood and used responsibly, you'll now learn to build for the web. Next you meet HTML, CSS & JavaScript and start building a real app — beginning with Session 15 — The Web Stack.

Ibnovate · Build · Innovate
Type to search · Esc to close
Welcome back
Sign in to continue building.
Accounts are created by Ibnovate — ask your instructor for your login.
🔒