Sub topic 1
Why a prompt set should start from real customer questions
Prerequisites
This chapter assumes you:
- Understand how AI assistants and AI search features answer questions.
- Can read simple Python scripts.
- Know what counts as personal data, such as names, email addresses, and phone numbers.
Why real questions beat assumptions
A prompt set is a list of questions you send to an AI assistant to measure its answers. If your team writes the questions, they reflect what your team thinks customers ask. Real questions reflect what customers actually type. Results built on real questions tell you more about the answers your customers will see.
Where real questions live
Real questions appear in several places:
- Support tickets and chat logs
- Sales call notes and emails from prospects
- Internal site search queries
- Community forums and social posts
- Product reviews
Each source shows a different slice of demand. Support tickets show problems. Search queries show what people look for, often in fewer words.
Removing personal data first
Personal data must be removed before anyone else reads the questions. A question such as "Why was my invoice sent to [email protected]?" contains an email address. The following script replaces email addresses and phone-like numbers with placeholders:
import re
EMAIL = re.compile(r"[\w.+-]+@[\w-]+\.[\w.-]+")
PHONE = re.compile(r"\+?\d[\d\s().-]{7,}\d")
def scrub(text):
text = EMAIL.sub("[EMAIL]", text)
return PHONE.sub("[PHONE]", text)Regular expressions catch only obvious patterns. Review a sample by hand before you trust the output.
Cleaning, normalising and deduplicating
Customers often ask the same question in slightly different ways. Normalising makes spacing and capitals consistent, so matching questions compare equal:
import re
EMAIL = re.compile(r"[\w.+-]+@[\w-]+\.[\w.-]+")
PHONE = re.compile(r"\+?\d[\d\s().-]{7,}\d")
def scrub(text):
text = EMAIL.sub("[EMAIL]", text)
return PHONE.sub("[PHONE]", text)
def normalise(text):
return re.sub(r"\s+", " ", text).strip().lower()
def dedupe(questions):
seen = {}
for q in questions:
cleaned = scrub(q)
seen.setdefault(normalise(cleaned), cleaned)
return list(seen.values())
print(dedupe([
"Can I move my plan?",
"can I move my PLAN?",
"Email me at [email protected]",
]))The output is ['Can I move my plan?', 'Email me at [EMAIL]']. The script keeps the first wording it sees, so the set keeps natural customer phrasing.
Exercise
The script treats "Reset password?" and "reset password" as duplicates. Why does it keep only one of them, and which wording does it keep?
Show answer
Normalising lowercases the text and collapses spaces, so both produce the same key. The dedupe function keeps the first wording it sees, which is "Reset password?" because it appears first in the input.