
Architecting a Voice-Enabled Airline Booking Agent with Amazon Bedrock, MCP, and S3 Vectors
Production blueprint for an autonomous airline booking agent on AWS: orchestrating voice intents via Alexa, tool execution with Lambda Action Groups and DynamoDB, real-time weather retrieval via Model Context Protocol (MCP), and cost-efficient RAG using S3 Vector Store and Claude 3.5 Haiku.
Most customer service chatbots in the airline industry still rely on rigid intent trees. When a passenger asks: "I want to book a flight to Miami next Friday, but first check if it is raining there and whether I can bring my French Bulldog into the cabin," traditional bots fall apart. They either route the caller to a human queue or fail completely because they cannot chain structured database actions, dynamic web tool calls, and unstructured policy retrieval in a single conversational turn.
Building an autonomous agent to handle this workflow on AWS requires more than calling an LLM endpoint. It demands a deterministic orchestration runtime, safe tool boundaries, cost-efficient vector retrieval, and low-latency voice integration.
This article walks through the architecture, trade-offs, and engineering decisions behind airline-agent , a production-ready conversational agent built with Amazon Bedrock Agents, Anthropic Claude 3.5 Haiku, Model Context Protocol (MCP), Amazon S3 Vectors, and Alexa Skills Kit, fully provisioned with Terraform.
1. System Context & End-to-End Topology
The solution serves two entry points: voice commands through Amazon Echo Dot (Alexa) and programmatic HTTP requests via a serverless web gateway.

Ingress Flow & Session Persistence
- Voice Ingress: The passenger speaks to Alexa ("Alexa, abre Asistente de Aerolínea"). The Alexa Skill delegates the raw transcript to the entry-point Lambda ( lambdas/skill/handler.py ).
- Session Continuity: The handler inspects incoming requests for a
session_id. If omitted, it generates a persistent UUIDv4 to preserve conversation memory across turns in the Bedrock session store.
- Agent Invocation: The Lambda calls Bedrock's
InvokeAgentruntime API using streaming chunks, accumulating the response buffer and formatting it back into Alexa Speech Synthesis Markup Language (SSML) or clean JSON for HTTP clients.
2. Agent Orchestration: The ReAct Loop in Bedrock
At the center of the system is an Amazon Bedrock Agent powered by Claude 3.5 Haiku via a Cross-Region Inference Profile (
us.anthropic.claude-haiku-4-5-20251001-v1:0 ).Rather than hardcoding state machines, the agent uses the ReAct (Reason + Act) pattern. Given a user goal, the model plans steps, selects tools, inspects outputs, and iterates until the request is fulfilled.

To ensure deterministic tool execution without prompt drift, tool contracts are declared via strict OpenAPI 3.0 schemas:
-
reservar-vuelo.json: Requirespassenger_name,departure_date,flight_number, andseat_class( agent/schemas/reservar-vuelo.json ).
-
consultar-reserva.json: Requires an alphanumericreservation_idto query booking status ( agent/schemas/consultar-reserva.json ).
3. Tool Interoperability with Model Context Protocol (MCP)
A common design flaw in early agent architectures is coupling every tool directly to cloud-provider-specific SDKs. If a team wants to share a tool between an internal Claude desktop environment, a local developer CLI, and an AWS Lambda agent, they must write multiple wrappers.
To solve this, the weather lookup uses the open Model Context Protocol (MCP) specification:
[Bedrock Agent] │ ▼ (OpenAPI Action Group)[Lambda: consultar-clima] (MCP Client) │ ▼ (JSON-RPC 2.0 over HTTPS Function URL)[Lambda: mcp-weather-server] (MCP Server) │ ▼ (HTTP GET)[wttr.in Weather API]- Protocol Decoupling: The server Lambda ( lambdas/mcp-weather-server/handler.py ) implements standard JSON-RPC 2.0 endpoints for
tools/listandtools/call.
- Client Bridge: The client Lambda ( lambdas/consultar-clima/handler.py ) translates Bedrock's action group event structure into an MCP
tools/callpayload, sending it over an authenticated AWS Lambda Function URL.
- Portability: The exact same weather server can be registered in any MCP-compliant host without code changes.
4. Cost-Efficient RAG: S3 Vector Store vs. OpenSearch
Airline policy documentation (baggage allowance, cancellation rules, pet transport) changes infrequently but must be retrieved with high precision.
Standard RAG architectures on AWS typically deploy Amazon OpenSearch Serverless (AOSS) as the vector database. While powerful for millions of documents with hybrid search, AOSS requires a minimum capacity allocation of 2 OpenSearch Compute Units (OCUs) for indexing and 2 OCUs for search, translating to an idle baseline cost of approximately $175/month even if zero queries are processed.
For this agent, we adopted the Amazon S3 Vector Store native integration with Bedrock Knowledge Bases:

- Zero Idle Cost: S3 Vectors charges strictly per vector stored and per query executed. For small to medium document corpuses (< 50,000 vectors), storage costs are pennies per month.
- Vector Specifications: Embeddings are generated using Amazon Titan Embeddings G1 - Text v2 (
amazon.titan-embed-text-v2:0) configured for 1,024 dimensions, float32 precision, and cosine similarity distance.
- Automated Ingestion Pipeline: Instead of triggering ingestion jobs manually via CLI scripts, an S3
ObjectCreatedevent triggers a lightweight sync Lambda that invokesbedrock:StartIngestionJob, ensuring policies are updated in near real-time.
5. Production Hardening: Security, Observabilidad & Guardrails
Transitioning an agent from a demo to production requires hardening the perimeter against prompt injections and safeguarding customer data.
1. Bedrock Guardrails (PII Masking & Safety): Airline reservations naturally handle customer names, credit card tokens, and passport identifiers. A Bedrock Guardrail intercepts both user inputs and agent responses, masking sensitive PII with CloudWatch audit trails and enforcing strict topic boundaries (blocking off-topic questions, political commentary, or attempts to override system prompts).2. Distributed Tracing & Observability: Every agent turn generates multiple sub-calls. We enabled Bedrock Model Invocation Logs exporting to Amazon CloudWatch Logs with structured JSON, alongside AWS X-Ray active tracing on all Lambda functions. This allows engineers to inspect the exact input tokens, reasoning trace, tool execution latency, and output tokens for every transaction.3. Zero-Trust IAM & Least Privilege: The Bedrock execution role is locked down to invoke only the specific Lambda ARNs registered in its action groups (reserva,consultar-reserva,consultar-clima). Action group Lambdas have zero internet access, communicating only with DynamoDB and internal endpoints.
6. Architecture Decision Records (ADRs)
Key architectural trade-offs made during the design of this system:
Architecture Decision Record: Vector Storage Engine
Architecture Decision Record (ADR-01: S3 Vector Store vs. OpenSearch Serverless):
- Context: Knowledge Base retrieval requires vector indexing for airline policies. Budget constraints require minimal operational and idle infrastructure overhead.
- Decision: Adopt Amazon S3 Vector Store configured with Titan Embed v2.
- Rejected Alternatives:
- OpenSearch Serverless (AOSS): Incurred an idle cost of ~$175/month due to 4 minimum OCUs, unsustainable for low-traffic domain bots.
- Amazon Aurora PostgreSQL (pgvector): Required managing VPC endpoints, connection pooling, and continuous database compute instances.
- Trade-Off Accepted: Slightly higher query latency (150ms vs. 40ms in warm AOSS), acceptable for conversational voice turnarounds.
Architecture Decision Record: Tool Protocol Standard
Architecture Decision Record (ADR-02: Model Context Protocol for External Tooling):
- Context: Weather forecasting tools need to be shared across diverse internal environments (developer local test harnesses and cloud agents).
- Decision: Expose external tools via an MCP Server Lambda using JSON-RPC 2.0 over HTTPS.
- Rejected Alternatives:
- Direct Third-Party API Call inside Action Group: Tightly coupled the agent to the proprietary API format of wttr.in, requiring schema modifications whenever the third-party endpoint changed.
- Trade-Off Accepted: Adds a lightweight intermediate client Lambda invocation (~15ms overhead) in exchange for total protocol portability.
Architecture Decision Record: Voice-to-Agent Session Bridging
Architecture Decision Record (ADR-03: Serverless Alexa-to-Bedrock Gateway):
- Context: Alexa Skill requests must pass natural language utterances to Bedrock and return synthesized audio within the strict 8-second Alexa timeout.
- Decision: Use a single Python 3.12 entry-point Lambda with Lambda Function URL that multiplexes ASK voice intents and standard HTTP requests.
- Rejected Alternatives:
- API Gateway REST API: Added extra per-request cost and configuration overhead without providing additional value over native Lambda Function URLs.
- Trade-Off Accepted: Session IDs must be managed explicitly in the Lambda handler to keep multi-turn context aligned with Bedrock session IDs.
Trade-Off Summary Matrix
ADR Ref | Decision | Alternatives Considered | Trade-Off Accepted | Primary Benefit |
|---|---|---|---|---|
ADR-01 | S3 Vector Store | OpenSearch Serverless, Aurora pgvector | +110ms vector lookup latency | Zero idle cost ($0/mo vs $175/mo minimum) |
ADR-02 | MCP over Lambda | Direct REST API integration | +15ms network hop | Reusable, standard-compliant tool server |
ADR-03 | Lambda Entry Point | API Gateway REST, AppSync GraphQL | Manual session token handling | Sub-25ms gateway overhead, fits Alexa 8s window |
7. Next Steps & Production Roadmap
While this architecture establishes a resilient foundation, ongoing evolution focuses on three areas:
- AgentCore Memory & Long-Term Personalization: Persisting passenger preferences (frequent flyer tier, dietary restrictions, preferred seat rows) in Amazon DynamoDB with semantic retrieval, allowing the agent to remember context across distinct booking sessions.
- Automated LLM-as-a-Judge Evaluations: Implementing continuous evaluation pipelines with Amazon Bedrock Evaluations to benchmark Claude 3.5 Haiku against newer model releases on tool-calling accuracy, hallucination rates, and latency.
- Multi-Channel Distribution: Expanding the entry-point Lambda to support WhatsApp and Telegram webhooks using the same underlying Bedrock Agent without altering business logic.
Repository & Implementation
The entire codebase, Terraform modules, OpenAPI specifications, and deployment scripts are open source and available on GitHub:
- GitHub Repository: dfloresgonz/airline-agent
- Key Components:
- infra/modules/bedrock-agent/ : Bedrock Agent, KB, S3 Vectors, and Action Groups in Terraform.
- lambdas/mcp-weather-server/ : Model Context Protocol server implementation.
- alexa/skill-package/ : Interaction models and skill manifest.
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article