Lesson 6 · Generative AI
Building AI Applications
8 min
You'll be able to
- Combine prompting, RAG, and agents into a real app
- Plan the pieces of a generative AI product
- Understand safety, cost, and evaluation
A modern AI application weaves together a model, a retrieval layer, tool calls, and careful prompting — all wrapped in a product with clear input, output, and safety handling.
Blueprint of an AI app
- Interface — chat box, form, or pipeline trigger.
- Orchestration — prompt template + model call.
- Retrieval (optional) — embeddings + vector database for grounding.
- Tools (optional) — APIs and functions the model can call.
- Evaluation & safety — test cases, rate limits, input filtering.
def answer(question, index):
ctx = index.search(question) # retrieve context
prompt = build_prompt(question, ctx)
reply = model.generate(prompt) # generate answer
return reply
# safety: filter inputs, cap tokens, log outputsChallenge
Ship the blueprint
Pick an AI product you'd love to build. Write its interface, its retrieval/tools, and the one evaluation metric you'd optimise.
Knowledge Check
Building AI apps
Which of these is a component of a production AI application?
A production AI app should have rate limits and input filtering.
Answer all questions to submit.