A prompt is the instruction and context you send the model. Good prompts are specific, scoped, and testable—not mystical incantations.
Clear task framing
- Role — who the assistant is
- Task — what to do in one sentence
- Constraints — length, tone, format, refusal rules
- Input — user data delimited clearly
Example skeleton
SYSTEM = """You are a support agent for Acme SaaS.
Answer only from PROVIDED_CONTEXT. If unsure, say you do not know.
Tone: concise, friendly. Max 120 words."""
USER = """PROVIDED_CONTEXT:
{retrieved_chunks}
---
Question: {user_question}"""
Iterate with evals
Change one variable at a time; keep a golden set of 20–50 real questions with expected properties (must cite doc X, must refuse Y).
Important interview questions and answers
- Q: Do longer prompts always help?
A: No—noise and contradictions hurt; clarity beats length.
Self-check
- List four prompt components.
- Why keep a golden question set?
Tip: Version prompts in git with PR review—treat them like application code.
Interview prep
- Good prompt parts?
Role, task, constraints, delimited input—specific and testable.
- Golden set?
Fixed questions with expected properties for regression when prompts change.