Artificial Intelligence course - Lesson 8 of 10

Lesson 8: Prompt design, structured output, and RAG

Learn AI fundamentals, data, machine learning, model evaluation, neural networks, generative AI, responsible deployment, and a practical capstone.

← All Artificial Intelligence lessons

Lesson 8 of 10

Prompt design, structured output, and RAG

A useful prompt states the task, gives relevant context, sets constraints, and describes the expected output. Ask for a format that your application can validate, and handle invalid or missing fields instead of trusting a model response blindly.

Task: Summarize the supplied support note.
Rules: Use only details in the note. Do not invent dates or promises.
Output: JSON with keys "summary" and "follow_up".
If the note does not answer a question, say "not provided".

Retrieval-augmented generation (RAG) searches an approved document collection and supplies relevant passages as context for a model response. A RAG system still needs source permissions, careful retrieval, citations, and checks that the answer is actually supported by the retrieved text. It does not guarantee correctness.

Try it: Improve a vague prompt such as “tell me about this report” by specifying the audience, source limits, length, and output format.