Practical building · Module 5
Integration and APIs
Computer use is moving from demo territory into real workflows, but the safe lesson is not which model tops which benchmark.
Previously
Model Context Protocol (MCP)
The Model Context Protocol (MCP) is an open protocol for connecting AI clients to external tools and data sources.
This module
Integration and APIs
Computer use is moving from demo territory into real workflows, but the safe lesson is not which model tops which benchmark.
Next
Practical building practice test
Test recall and judgement against the governed stage question bank before you move on.
Progress
Mark this module complete when you can explain it without rereading every paragraph.
Why this matters
Computer use is impressive but not magic.
What you will be able to do
- 1 Connect an agent to an external API and handle authentication safely.
- 2 Design rate limiting and retries that do not melt production.
- 3 Return clear errors and keep logs that support debugging.
Before you begin
- Core concepts completed or equivalent understanding
- Basic confidence with workflow and integration terms
Common ways people get this wrong
- Rate limit collapse. Without backoff, one busy hour becomes a self inflicted outage.
- API drift. A version bump can break behaviour silently. Monitor and test against real responses.
3.5.2 Computer use. Agents that see and click
Computer use is moving from demo territory into real workflows, but the safe lesson is not which model tops which benchmark. The safe lesson is when UI automation is appropriate and when it is reckless.
In practice, computer use is best treated as a fallback when no reliable API exists. If an API is available, use the API. UI automation should be the controlled exception, not the default integration path.
Stage 3 Assessment
You now move from guided building to evidence based checking. This quiz verifies that you can wire tools safely, handle failures cleanly, and choose integration patterns that remain supportable in production.
Summary
In this stage, you have built:
A complete ReAct agent with tools for calculation, search, and more
Multi-agent systems using Supervisor and Swarm patterns, and compared the design questions that matter when picking a framework
Visual workflows with n8n for no-code AI automation
An MCP server that connects to a client, and learned how open protocol governance affects interoperability decisions
Robust API integrations with proper authentication and error handling
Computer use capabilities and what they mean for the next generation of agents
Mental model
Integration is a contract
APIs are promises. Robust agents handle timeouts, errors, and version changes without drama.
-
1
Agent
-
2
API boundary
-
3
External service
-
4
Limits and retries
-
5
Result
Assumptions to keep in mind
- Failures are expected. Timeouts and 500s are normal. Design for them.
- Data is validated. Treat external responses as untrusted. Validate before use.
Failure modes to notice
- Rate limit collapse. Without backoff, one busy hour becomes a self inflicted outage.
- API drift. A version bump can break behaviour silently. Monitor and test against real responses.
Check yourself
Quick check. Integration and APIs
0 of 4 opened
Where should you store API keys by default
In environment variables or a secret manager, not hard coded in code.
What is a sensible retry strategy for rate limits
Bounded retries with backoff and jitter, respecting server headers where available.
Scenario. An API fails intermittently. What do you log to make it debuggable
Request id, endpoint, status code, timing, and a safe summary of inputs and outputs, without leaking secrets.
Why should monitoring include cost signals
Because usage spikes and runaway loops can turn into a billing incident quickly.
Module 3.1-3.2: Agent Building Quiz
0 of 5 opened
What is the purpose of the to_prompt_format method in a Tool class?
Correct answer: To format the tool for inclusion in agent prompts
The to_prompt_format method formats the tool's name, parameters, and description so it can be included in the agent's prompt, helping the LLM understand what tools are available.
In the Supervisor pattern, what is the supervisor's main role?
Correct answer: Route requests to specialised agents
The supervisor's main role is to route requests to the most appropriate specialised agent and synthesise their responses. It coordinates but does not do the specialised work itself.
What happens when an agent tries to use a tool that does not exist?
Correct answer: A helpful error message is returned
Good agent implementations return a helpful error message listing available tools. This allows the agent to correct its mistake in the next iteration.
Why do we use JSON for Action Input in the ReAct pattern?
Correct answer: Because it provides structured, parseable parameters
JSON provides structured, parseable parameters that can be directly passed to Python functions. This is more reliable than trying to parse free-form text.
What is the main advantage of the Swarm pattern over Supervisor?
Correct answer: Agents can hand off directly without central bottleneck
In the Swarm pattern, agents hand off directly to each other. This avoids the supervisor as a central bottleneck and allows more natural peer-to-peer collaboration.
Module 3.3-3.5: Integration Quiz
0 of 5 opened
What protocol does MCP use for communication?
Correct answer: JSON-RPC 2.0
MCP uses JSON-RPC 2.0 for communication between clients and servers, with transport details defined by the current specification.
What is the main benefit of MCP over custom integrations?
Correct answer: Reduced number of total integrations needed
MCP reduces integrations from N apps x M tools to N + M implementations. Each app implements MCP once, each tool implements MCP once.
What is n8n best suited for?
Correct answer: Visual workflow automation with AI
n8n is a visual workflow automation platform with native AI capabilities. It lets you build AI-powered workflows using a drag-and-drop interface.
Why should API keys be stored in environment variables?
Correct answer: They stay out of version control and are easier to rotate
Environment variables keep secrets out of source code and version control. They can be easily changed without code modifications, making key rotation simpler.
What is exponential backoff?
Correct answer: Increasing wait time between retry attempts
Exponential backoff means increasing the wait time between retry attempts (e.g., 1s, 2s, 4s, 8s). This prevents overwhelming servers during outages.
Artefact and reflection
Artefact
An integration checklist you can reuse for real projects.
Reflection
Where in your work would connect an agent to an external api and handle authentication safely. change a decision, and what evidence would make you trust that change?
Optional practice
Store a secret in an environment variable and read it safely.