Let’s Get Certified
Module 05 / 15 · Generative AI fundamentals

Build a grounded request from tokens, context and tools

Connect token costs, retrieval, model lifecycles and agent orchestration to one application request.

An assistant that can book

A travel assistant should explain policy and retrieve available trains. It may book only after the traveler agrees to the itinerary. Which parts should be model decisions and which need application checks?

Tokens, vectors and modalities

A tokenizer splits input into model units that need not equal words. An embedding represents content numerically for similarity search. Chunking creates retrievable passages. A transformer can model sequence relationships, a multimodal model handles more than one modality and a diffusion model can generate an image by iteratively refining noise.

Generative tasks

Use generation when the deliverable is new text, an image, audio or another artifact. Summaries, translations and code drafts need task-specific checks. A fluent response can omit a critical constraint. Decide what evidence a reviewer needs before accepting an output.

Foundation-model lifecycle

Choose lawful, representative pretraining data and a model architecture. Pretraining learns broad patterns. Fine-tuning adapts behavior. Evaluate before deployment, observe real use and feed back reviewed examples. Raw customer feedback can be biased or contain private material.

Token-based economics

For token-metered inference, estimate input tokens multiplied by the applicable input rate plus output tokens multiplied by the output rate. Include retrieval, storage and tool calls when estimating the application. Model-specific rates, caching rules and the length distribution can change the result.

Context engineering

Build the input from the task, current user request, relevant history, retrieved passages and authorized tool results. Allocate the context window to the most useful evidence. Preserve provenance and isolate instructions from quoted data to avoid granting retrieved text operational authority.

Agent coordination

An agent can plan, use a tool and inspect the result. A supervisor can route subtasks to specialists and combine results. MCP standardizes the interface to compatible tools or resources. It does not decide which user may act. Bound tool permissions, memory scope, spend and the number of steps.

Work through the decision

Compare your reasoning

Retrieve policy with citations, make availability a read-only tool and keep a proposed itinerary separate from a purchase. The application checks traveler identity, approval and the actual tool arguments before committing. Retain only the session memory needed for the task.

Change one constraint

For 1,000 requests, an illustrative price is 2 units per million input tokens and 8 per million output tokens. Each request uses 2,000 input and 250 output tokens. What is the inference-only estimate?

Check your answer

Two million input tokens cost 4 units. A quarter million output tokens cost 2 units. Total 6 units, before retrieval or tools. These are sample rates for arithmetic practice.

Revisit the recording

The primer compares attention, language models and adaptation. A token budget, a vector search and model training each change a different part of a request. Gen AI Primer · 1:31:48.

Ground an answer in a manual

In the vehicle-manual demonstration, the model receives a question it cannot reliably answer from its learned parameters. The instructor then supplies the relevant excerpt in the prompt. Try explaining which component changed. The evidence available at inference changed. The model weights stayed the same. In a deployed system, verify that the excerpt applies to the correct vehicle and edition. Watch at 3:38:00.

Separate a proposed booking from execution

The action-group example passes booking information to a function. Draw the boundary at the function call. The model can produce a plausible booking ID and proposed operation. The application still has to resolve the actual user, validate the ID, and check authorization before the booking changes. Watch at 4:57:40.

Sources and further practice

AWS exam objectives · AWS documentation for this case.

From tool request to verified action · Claude Certified Architect – Foundations · Return to the study map.

Knowledge check

Build a grounded request from tokens, context and tools quiz

Answer 6 questions. Check each answer for an explanation.

Worked example · Approving a tool action