Imagine telling a robot:
Move forward, turn right, and wave.
Instead of writing a separate program for every instruction, what if an AI-powered application could understand the request, create an action plan, validate it, and communicate with the robot through cloud services?
That is an interesting use case for combining AI agents, serverless architecture, and IoT messaging on AWS.
Inspired by the topic discussed in Building a Serverless Multi-Agent Robotics Platform on AWS — Lessons from AWS Community Day Shenzhen, this article explores a practical reference architecture for building such a system.
The design and code snippets are illustrative examples, not a claim that a complete robotics platform has been deployed or tested.
Why combine AI agents with serverless robotics?
A robotics application needs more than a language model. It must interpret requests, manage tasks, communicate with devices, track execution, handle errors, and enforce safety rules.
A useful architecture separates these responsibilities instead of putting everything inside one application.
For example:
- An intent agent interprets the user's request.
- A planning agent proposes a sequence of actions.
- A safety layer checks whether those actions are permitted.
- An execution component sends approved commands.
- Event handlers track the robot's actual status.
AWS managed services can support the application and communication layers without requiring you to operate every supporting server yourself.
1. Architecture overview
Here is the proposed architecture:
User / Web Application
|
v
Amazon Cognito + API Gateway
|
v
AWS Lambda — Request Handler
|
v
Agent Orchestration
(Strands Agents + Amazon Bedrock)
|
+--> Intent Interpretation
|
+--> Action Planning
|
+--> Safety Validation
|
v
Approved Command Tool
|
v
AWS IoT Core
|
v
Robot Device
|
v
Status and Telemetry Events
|
v
AWS Lambda --> Amazon DynamoDB
|
v
Amazon CloudWatch
Amazon Bedrock provides foundation-model access, while Amazon Bedrock AgentCore can provide managed capabilities for deploying and operating agent workloads. Strands Agents can be used to define agent behavior and tool interactions.
The exact integration depends on the selected AgentCore components and the requirements of the robot.
2. Choose AWS services for specific responsibilities
| AWS service | Purpose |
|---|---|
| Amazon Bedrock | Natural-language understanding and action planning |
| Strands Agents | Agent workflows and tool use |
| Amazon Bedrock AgentCore | Managed agent runtime and supporting capabilities |
| Amazon API Gateway | Application API endpoints |
| AWS Lambda | Request handling, validation, and event processing |
| Amazon Cognito | User authentication |
| AWS IoT Core | Device connectivity and messaging |
| Amazon DynamoDB | Session, task, and command state |
| Amazon CloudWatch | Logs, metrics, and operational monitoring |
| AWS Step Functions | Optional orchestration for durable multi-step workflows |
You do not need every service in the first version. Start with the smallest architecture that can demonstrate a complete and safe command lifecycle.
3. Create specialized agents
A multi-agent system is most useful when responsibilities are clearly separated.
Intent agent
The intent agent converts a natural-language request into a structured action proposal.
For example:
{
"robot_id": "robot-001",
"action": "turn_right",
"duration_ms": 500
}
This is an example application schema, not an AWS-defined robot command format.
Planning agent
For a multi-step task, the planning agent can propose an ordered list of supported actions.
For example:
- Move forward.
- Turn right.
- Stop.
- Report the result.
The planner should use a known capability registry instead of assuming that every robot supports the same operations.
Safety validator
The safety validator checks the proposed actions against deterministic application rules.
It should verify:
- The user is authorized to control the selected robot.
- The requested action is supported.
- Parameters are within configured limits.
- The device is in an acceptable state.
- Human approval is provided when required.
Its decision might be ALLOW, REJECT, or REQUIRE_APPROVAL.
Important: AI-generated plans are proposals, not authorization to control physical hardware. Enforce safety rules in trusted application code and the robot's local controller.
Execution coordinator
The execution component sends approved commands, tracks their status, and handles failures.
Give it access only to specific, validated tools. Avoid giving an AI agent unrestricted permission to publish arbitrary commands to robot devices.
4. Connect the robot using AWS IoT Core
AWS IoT Core can support MQTT-based communication with compatible robot devices.
One possible topic structure is:
robots/robot-001/commands
robots/robot-001/status
robots/robot-001/telemetry
robots/robot-001/events
A command might look like this:
{
"command_id": "cmd-1001",
"robot_id": "robot-001",
"action": "move_forward",
"duration_ms": 1000
}
The robot-side controller should validate the message before acting on it. It should reject expired or duplicate commands, enforce local limits, and report the actual execution outcome.
Do not assume that successful message delivery means the physical action completed.
For a reliable implementation, define:
- Command IDs and duplicate detection.
- Acknowledgements and execution status.
- Timeouts and bounded retry behavior.
- Device authentication and least-privilege IoT policies.
- Behavior during network disconnection.
Cloud-based AI is suitable for high-level planning and coordination. Time-critical motor control and emergency stopping should remain local to the robot.
5. Store task state in DynamoDB
Amazon DynamoDB can store the state needed to track a robotics workflow.
For example:
| Entity | Example data |
|---|---|
| Robot | ID, supported actions, connection status |
| Session | Session ID, user ID, selected robot |
| Task | Task ID, action sequence, current step |
| Command | Command ID, approval state, execution result |
A command lifecycle could be:
REQUESTED
|
v
VALIDATED
|
v
APPROVED
|
v
SENT
|
v
COMPLETED
Other outcomes can include REJECTED, FAILED, and EXPIRED.
Use application-level state-transition checks and conditional writes where appropriate to avoid conflicting updates.
For high-volume sensor telemetry, choose a storage design based on data volume and query requirements rather than placing every sensor reading into the same table as session state.
6. Build a simple capability validator
Before connecting an AI agent to a real robot, define exactly which actions each device supports.
Here is a small Python example:
ROBOT_CAPABILITIES = {
"robot-001": {
"move_forward",
"turn_right",
"turn_left",
"stop",
}
}
def validate_action(robot_id, action):
capabilities = ROBOT_CAPABILITIES.get(robot_id)
if capabilities is None:
return False, "Unknown robot"
if action not in capabilities:
return False, "Unsupported action"
return True, "Action is supported"
allowed, message = validate_action(
"robot-001",
"turn_right",
)
print(allowed, message)
This is a minimal illustration, not a production safety system. A real implementation also needs authentication, authorization, parameter validation, device health checks, movement limits, and local safety controls.
The key idea is to validate every proposed action before it reaches the command interface.
7. Handle failures before scaling
Robots and cloud services can fail independently. A robust system must account for both.
Robot offline: Mark the robot unavailable and report the status to the user.
Duplicate command: Use unique command IDs and device-side duplicate detection.
Agent timeout: Apply execution deadlines and bounded retries.
Partial task completion: Record completed steps and determine whether the task can safely resume.
Out-of-order events: Use command IDs, timestamps, and sequence checks to reject stale updates.
Emergency stop: Ensure that protective stopping does not depend on an AI model or a working cloud connection.
For workflows involving multiple durable steps, retries, and recovery branches, AWS Step Functions may be useful. A simpler workflow can use Lambda and event-driven processing.
8. Secure and monitor the platform
Security should be part of the architecture from the beginning.
Use least-privilege IAM permissions, unique device identities, restricted IoT policies, and server-side authorization. Require explicit approval for high-impact actions where appropriate.
Maintain an audit trail showing who requested a task, what was proposed, which checks passed, which command was sent, and what the robot reported.
Use Amazon CloudWatch to monitor:
- API and Lambda errors.
- Agent latency and invocation counts.
- Device connectivity.
- Command acknowledgement and completion rates.
- Safety rejections and failed tasks.
- Estimated cost per completed task.
Remember that serverless does not automatically mean free. Model inference, agent runtime, Lambda, messaging, storage, and monitoring can all contribute to the total cost.
9. Build it in stages
I would approach implementation incrementally:
Stage 1: Connect one simulated or test robot and implement a few deterministic commands.
Stage 2: Add an API and authentication.
Stage 3: Introduce an AI agent to translate natural-language requests into structured proposals.
Stage 4: Add deterministic validation and an explicit approval workflow.
Stage 5: Persist command state and process device status events.
Stage 6: Add monitoring, error recovery, and additional agents only where they provide measurable value.
Stage 7: Expand to multiple robots with device-specific permissions, concurrency limits, and capability discovery.
This approach makes it easier to test the entire request-to-execution lifecycle before adding more complexity.
Final thoughts
A serverless multi-agent robotics platform is not simply a chatbot connected to a robot. It is a system that combines AI reasoning, cloud services, device communication, state management, observability, and physical safety.
AWS provides building blocks for these responsibilities through Amazon Bedrock, Strands Agents, Amazon Bedrock AgentCore, AWS Lambda, AWS IoT Core, and DynamoDB.
My main takeaway is this:
Let AI plan the action. Let trusted software authorize it. Let the robot's local controller enforce physical safety.
Start with one robot, a small set of supported actions, and a clear validation process. Once that workflow is reliable, expand toward more sophisticated agents and multi-robot coordination.

Top comments (0)