
🤖 Domain 2: From AI Answers to Actions
Learn AIP-C01 Domain 2 in simple language: AI agents, tools, model deployment, APIs, enterprise integration, and troubleshooting.
Series: Come Prepare with Me: AWS Certified Generative AI Developer – Professional (4 articles)
- …
- 4🤖 Domain 2: From AI Answers to Actions This article
In our Domain 1 project, we built an assistant that answered questions using company policies.
Now imagine asking an assistant:
“My application is down. Can you check its status and create a support ticket?”
To complete this request, the assistant needs to take actions. It must connect to other systems, use tools, remember what it has done, and handle problems.
Welcome to Domain 2: Implementation and Integration of the AWS Certified Generative AI Developer – Professional (AIP-C01) exam! 🚀
This article explains the concepts. In the next article, we’ll build an IT Service Desk Action Agent.
🗺️ What Does Domain 2 Cover?
Domain 2 represents 26% of the scored exam content and covers five areas:
Area | What we’ll learn |
|---|---|
Agents and tools | How AI can complete tasks |
Model deployment | Where applications and models run |
Enterprise integration | How AI connects to business systems |
Model APIs | How applications communicate with models |
Application development | How to build, test, and troubleshoot the solution |
We’ll use a service desk assistant as our example throughout.
🧠 1. AI Agents: Helping the Model Take Action
An AI agent uses a model, instructions, tools, and application logic to work toward a goal.
For example, our service desk agent could:
- Ask which application is affected.
- Check its status.
- Collect details about the problem.
- Create a ticket.
- Suggest a fix.
- Ask for approval before performing an action.
A workflow follows steps defined by a developer. An agent lets the model choose some of the next steps. Many applications combine both.
🔧 What Is a Tool?
A tool is a function the application allows the agent to use.
For example:
Tool: check_service_status
Input: application name
Output: application statusThe model receives a description of the tool and its expected inputs.
When it needs the tool:
- The model requests a tool call.
- The application checks the request and permissions.
- The application runs the tool.
- The result is returned to the model.
- The model continues or answers the user.
The model requesting an action does not mean the action has happened. The application controls execution.
Check tool inputs, handle errors, and prevent duplicate actions. For example, retrying a request should not create the same ticket twice. This is called idempotency.
💾 Memory and State
An agent needs to remember enough information to complete a task.
- Conversation history: Earlier messages, such as the application name.
- Task state: What has already happened, such as a ticket being created.
- Long-term memory: Selected information saved across conversations.
DynamoDB or AgentCore Memory can support these needs, depending on the design.
Keep users and sessions separate. Information from one user’s conversation should not appear in another’s.
🔄 Common Agent Patterns
Pattern | Simple meaning |
|---|---|
ReAct | Decide, use a tool, observe the result, and continue |
Task decomposition | Break a large task into smaller tasks |
Prompt chaining | Use one step’s output in the next step |
Routing | Send work to the right model or specialist |
Parallel processing | Run independent tasks at the same time |
Aggregation | Combine results from several models or agents |
Evaluator loop | Review an output and improve it when needed |
The exam guide also mentions chain-of-thought approaches for structured problem solving. Evaluate actual results and evidence; a model’s explanation alone does not prove that its answer is correct.
🛑 Limits and Human Approval
An agent should have clear boundaries:
- Maximum steps or tool calls.
- Timeouts and token limits.
- Allowed tools and resources.
- A rule for stopping or escalating.
- Approval before important actions.
A circuit breaker temporarily stops calls to a service that keeps failing.
For example, the agent might suggest restarting an application, but the application must enforce approval before allowing the restart.
💡 Remember: A prompt saying “ask for approval” is not a complete approval system.
🤝 Frameworks and MCP
Strands Agents helps developers build agents with models and tools. AWS Agent Squad is another orchestration option mentioned in the exam guide.
Multiple agents can divide work by specialty, but they also add complexity. Start with the simplest design that meets the requirements.
Model Context Protocol (MCP) provides a standard way for applications to access tools and other capabilities.
An MCP server exposes tools. An MCP client connects to them.
Lightweight tools may use Lambda-based designs, while more complex tools may need containers on ECS. The correct choice depends on execution and connection requirements.
MCP does not automatically provide safe execution or authorization.
🚀 2. Decide Where the Application and Model Run
There are two separate decisions:
- Where does the application or agent run?
- Where does model inference run?
For example, a Lambda function can call a Bedrock model. That does not mean the model itself runs inside Lambda.
Option | What it does |
|---|---|
Bedrock on-demand inference | Provides managed model calls without provisioning model-serving resources |
Bedrock Provisioned Throughput | Provides provisioned capacity for supported models and configurations |
SageMaker AI endpoints | Provide more control over model hosting |
AgentCore Runtime | Hosts agents and tools |
Containers | Package applications or supported model-serving workloads |
🖥️ What Matters When Hosting an LLM?
Large language models can need substantial computing resources. Understand:
- Memory: Space required to load and run the model.
- GPU utilization: How effectively the hardware is used.
- Context length: How much input the model processes.
- Concurrency: How many requests run together.
- Token throughput: How quickly tokens are processed.
- KV cache: Memory used to retain attention information during generation.
- Startup time: Time needed to load the model.
Also understand these optimization techniques:
- Batching: Process requests together.
- Quantization: Use lower-precision representations to reduce resource requirements.
- Parallelism: Spread work across computing resources.
Each technique has tradeoffs in performance, resources, or quality.
🔀 Model Cascades
A model cascade tries one model first and uses another when defined conditions require it.
For example, a smaller model may classify a ticket, while a more capable model handles a complex investigation.
Test the selection rules. Calling multiple models can also increase response time and cost.
🏢 3. Connect AI to Business Systems
A useful assistant may need access to a ticketing platform, CRM, internal API, or document system.
Common connection patterns include:
- Synchronous API: Send a request and wait for the result.
- Webhook: Receive a notification from another system.
- Event-driven integration: React when something happens.
- Queue-based processing: Hold work until a worker processes it.
- Data synchronization: Keep information updated between systems.
For example, EventBridge could route an incident event, and Lambda could create a ticket through an external API.
🔐 Identity and Permissions
Distinguish between:
- The person using the assistant.
- The application’s AWS role.
- The identity used to access an external system.
Identity federation lets users access systems through a trusted identity provider. Role-based access control gives permissions based on a user’s role.
Use least privilege and protect credentials. A user typing “I am an administrator” must not give them administrator permissions.
🌐 Connecting Across Environments
Some systems or data may remain on premises or at the edge.
Check:
- How the environments connect securely.
- What data can leave each location.
- Where processing is allowed.
- Which services and models are available.
The exam guide references AWS Outposts and AWS Wavelength as examples. Their suitability depends on the workload and supported services.
🛠️ Deployment Pipelines and GenAI Gateways
A CI/CD pipeline automates building, testing, and deploying changes.
For an AI application, test code, prompts, tools, model settings, security controls, and expected responses. Keep a way to return to a previous working version.
CodeBuild and CodePipeline can support this process.
A GenAI gateway is a shared entry point for model requests. It can centralize authentication, routing, validation, usage limits, and monitoring.
These controls need configuration; they do not appear automatically because an API exists.
🔌 4. Communicate with Models Through APIs
An API allows application code to send input to a model and receive output.
For supported Bedrock models, understand:
- Converse: A consistent interface for conversational requests.
- ConverseStream: Delivers the response incrementally.
- InvokeModel: Uses the selected model’s request format.
Check the model’s supported features and required inputs.
⏳ Three Ways to Handle Requests
Approach | What the user experiences |
|---|---|
Synchronous | Wait for the completed result |
Queued | Submit work and receive the result later |
Streaming | See output as it is generated |
SQS can hold jobs for workers to process later. This makes the application workflow asynchronous; it does not change the underlying model API.
⚡ Streaming Must Work End to End
The entire path must support incremental output:
Model → Backend → API/network layer → User interface
Depending on the design, delivery may use supported HTTP streaming, server-sent events (SSE), or WebSockets.
Check buffering, integration support, and timeouts. A streaming model response does not automatically reach the browser immediately.
🔄 Failures, Retries, and Routing
Prepare for throttling, timeouts, invalid inputs, and unavailable services.
- Exponential backoff: Wait longer between retries.
- Jitter: Add variation to retry timing.
- Rate limiting: Control request frequency.
- Concurrency limits: Control simultaneous work.
- Fallbacks: Use an approved alternative.
- Validation: Check requests and responses.
- Tracing: Follow a request across services.
Retry temporary failures appropriately. Correct permanent problems, such as invalid input, rather than repeatedly retrying them.
Model routing can be static, using fixed rules, or dynamic, using request content or measured performance.
💻 5. Build and Troubleshoot the Application
Users need clear inputs, progress updates, useful errors, and understandable results.
Relevant development tools include:
- OpenAPI: Defines how an API should be used.
- AWS Amplify: Supports frontend development and integration.
- Amazon Bedrock Flows: Connects prompts, conditions, and processing steps.
- Step Functions: Coordinates tasks, state, and approvals.
- Bedrock Data Automation: Supports document and multimodal processing.
- Amazon Q Developer: Helps with coding, refactoring, tests, and troubleshooting.
Always review and test generated code.
🔍 Follow the Request Through the System
Track:
User request → Model call → Tool call → External system → Final response
Useful measurements include response time, errors, retries, token usage, tool outcomes, and task state.
Use CloudWatch Logs Insights to query configured logs. Use tracing tools such as X-Ray, where supported and instrumented, to follow requests across services.
Avoid logging credentials or unnecessary sensitive information.
When troubleshooting, ask:
- Did the model choose the correct tool?
- Were the inputs valid?
- Did permissions allow the action?
- Did the external system succeed?
- Was the result returned correctly?
- Did the answer match what actually happened?
🧠 Exam Scenario Notes
If the scenario says… | Think about… |
|---|---|
The agent repeats actions | State, stopping rules, and step limits |
Tool arguments are invalid | Input schemas and validation |
Retries create duplicate tickets | Idempotency |
An action needs approval | An enforced approval workflow |
Systems should work independently | Events and queues |
Users need immediate feedback | End-to-end streaming |
Work takes too long for one request | Queued or workflow processing |
Different tasks need different models | Routing or model cascades |
Teams need common access controls | A GenAI gateway |
Local code fails after deployment | Permissions, networking, settings, timeouts, and traces |
Use these as clues. The full scenario determines the best solution.
✅ Domain 2 Review Checklist
Make sure you can explain:
- Agents, tools, memory, and task state.
- ReAct, chaining, routing, parallel work, and multiple agents.
- Human approval and execution limits.
- MCP clients, servers, and hosting.
- Application hosting versus model deployment.
- LLM memory, GPU, startup, and throughput needs.
- APIs, webhooks, events, queues, and synchronization.
- Federation, permissions, and cross-environment connectivity.
- Synchronous, queued, and streaming requests.
- Retries, limits, fallbacks, and idempotency.
- CI/CD, development tools, monitoring, and troubleshooting.
🛠️ Next: Build an IT Service Desk Action Agent
In the next article, we’ll build an agent that can:
- Check a simulated application’s status.
- Ask for missing incident details.
- Create and track a ticket.
- Suggest a fix.
- Require approval before a simulated action.
We’ll put the implementation on GitHub and explain the flow through screenshots and test results.
This article follows the Domain 2 task areas in the official guide. Use the guide alongside these notes to track your preparation.
Preparing for AIP-C01 too? Let’s keep learning one domain—and building one project—at a time! 🚀
🔗 AWS References
Series: Come Prepare with Me: AWS Certified Generative AI Developer – Professional (4 articles)
- …
- 4🤖 Domain 2: From AI Answers to Actions This article
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article