MoEngage 基于 Bedrock AgentCore 构建智能体式客户互动

本文由 MoEngage 的 Ashwin Srinivasan、Nishan Das 和 Karthik Baile 共同撰写。
一位营销或产品团队成员在策划周末限时闪购时,往往在写下一行文案之前就已经打开了三个工具。他们先打开分析仪表盘,看看上次哪些做法奏效;接着打开内容库,寻找合适的语气;然后再打开活动构建器,搭建活动本身。如果在电子邮件、推送、短信和 WhatsApp 上重复这一流程,营销团队一周中的大部分时间都花在了在工具之间来回切换上,而不是做决策。
MoEngage 模型上下文协议(MCP)连接器为兼容 MCP 的助手(如 Claude 或 ChatGPT)提供安全、按租户隔离的访问权限,可访问品牌的细分人群、活动历史和内容库。
这一能力指向软件平台更广泛的转变。除了面向业务用户的用户界面和面向工程团队的 API 之外,第三层正在浮现:用户用自然语言描述想要的结果,智能体则在平台上执行各个步骤。对于一个客户互动平台而言,这意味着已经以 API 形式开放的能力可以成为智能体调用的工具,而曾经需要在多个工具之间流转的活动,如今可以通过一次对话完成。
MoEngage 是一个智能体式客户互动平台,超过 1,350 个消费品牌通过推送、邮件、应用内、短信、WhatsApp 以及富通信服务(RCS)等渠道使用它,而该公司着手构建的正是这一层能力。MoEngage 打造了 Merlin AI,这是一组与平台实时数据协同工作的 AI 智能体。营销和产品团队如今可以在一次对话中起草、分析并调整营销活动,而由智能体决定向每位客户发送什么内容。客户 Glance 因此实现了推送通知点击率 38% 的提升。
MoEngage 将其视为一个架构问题。核心问题在于:如何在不重建数百个现有 API 的前提下,让智能体获得安全、按租户隔离的实时数据访问权限。在这篇博文中,我们将介绍 MoEngage 如何借助 Amazon Bedrock 和 Amazon Bedrock AgentCore 解决这一问题——后者是一个可用任意框架或模型大规模构建、连接和优化 AI 智能体的平台。文章涵盖 Merlin AI 中的四种智能体模式、MoEngage 如何将其现有 API 暴露为 MCP 工具,以及该架构如何确保每个租户的数据相互隔离。文末将介绍 MoEngage 客户所取得的成果,以及其他软件提供商可以复用的模式。
Merlin AI 运行四种智能体。四者共享同一基础:Amazon Bedrock 中的基础模型负责推理与生成,AgentCore runtime(Amazon Bedrock AgentCore 的一项能力)负责托管,MCP 负责标准化的数据访问。在全部四种模式中,Merlin AI 都使用 Amazon Bedrock 上的 Anthropic Claude Sonnet 4.6、Claude Sonnet 5 和 Claude Sonnet 5.5 进行推理、工具调用规划和内容生成。完整模型列表请参见 Amazon Bedrock 中支持的基础模型。
Merlin AI Studio 将专用智能体放在工作流中营销与产品团队实际执行该项工作的确切环节:
对话式智能体可跨营销活动、分析、细分人群和流程开展工作。用户可以用自然语言提问,智能体则调用合适的工具来作答或据此采取行动。嵌入在分析页面中的 Campaign Insights Agent 会将任务委派给专门的子智能体。一个子智能体同时对数个指标进行分析。第二个子智能体诊断某个指标表现不佳的原因,第三个则比较不同时间段或细分人群的表现。最后一步将分析结果整理成清晰的答案。
自定义智能体让生命周期和客户关系管理(CRM)团队能够设计出基于 MoEngage 数据和工具持续运行的智能体,且运行在产品与营销团队定义的规则之内。每个智能体都会通过活动日志展示其工作过程,记录它拉取的数据、做出的决策、触达的渠道以及发送的内容。团队可以让智能体完全自主运行,也可以在智能体执行任何操作前要求人工审核。
决策智能体为每一位客户单独行动。每个智能体决定说什么、何时说、说多频繁以及通过哪个渠道说,并从每一次结果中学习。产品与营销团队设定内容、目标和防护机制,其余由智能体处理,且每一次决策都清晰可见。Offer Decisioning 在网页和 App 界面上选出最优优惠。Campaign Decisioning 在电子邮件、推送、短信和 WhatsApp 上做出 1:1 的决策。与工作流智能体结合,这便将智能体式营销的两个部分整合到同一个系统中。
该架构分为四层。每一层只承担单一职责,并且可以在不影响其他层的情况下进行变更。
在一次典型请求中,用户登录 MoEngage 并提问。客户端携带用户现有的 JSON Web Token(JWT)发送请求。AgentCore runtime 验证该 Token,并为该用户启动一个隔离会话。智能体向 Amazon Bedrock 中的模型询问应调用哪些工具。MCP 服务器携带用户的租户上下文调用 MoEngage API,并返回结果。智能体随后组织出回答。
下图展示了这些组件如何连接。
图 1:运行在 Amazon Bedrock 和 AgentCore runtime 上的 MoEngage Merlin AI 架构。
MoEngage 通过一个 MCP 服务器和智能体可调用的 API 将其平台开放给智能体。其用于营销活动、分析、细分、内容和流程的平台 API 已经兼容 OpenAPI 3.0,因此 MoEngage 使用 FastMCP 框架从这些规范生成 MCP 工具。每个操作都会变成一个工具,带有结构化 schema、描述和参数校验。
以下简化示例展示了这一模式:
import httpx from fastmcp import FastMCP spec = httpx.get(MOENGAGE_OPENAPI_URL).json() client = httpx.AsyncClient(base_url=MOENGAGE_API_BASE) mcp = FastMCP.from_openapi(openapi_spec=spec, client=client, name='moengage') if __name__ == '__main__': mcp.run(transport='streamable-http', host='0.0.0.0', port=8000) 这些工具分为五组:
这些工具来自规范,因此它们与 API 保持同步。当团队更新规范时,工具定义也会随之更新。
多租户系统不能让模型自行决定它在读取谁的数据。MoEngage 做了三项设计选择来帮助防止这种情况。第一,MCP server 复用现有的认证模型,接受 MoEngage API 已在使用的同一套基于 JWT 的认证,AgentCore runtime 会在请求到达 server 之前校验每一个 Token。第二,workspace 和用户上下文通过请求头传递,由 AgentCore runtime 转发给 server,而不是作为工具参数传入,因此模型看不到这些值,也无法更改它们。第三,AgentCore runtime 让每个用户会话运行在各自隔离的环境中,因此一个用户的对话无法读取另一个用户的会话状态。
在此基础上,Amazon Bedrock Guardrails 会对智能体的响应应用内容安全和个人身份信息(PII)过滤。随后,一个 backend-for-frontend 层会在 MoEngage 界面渲染生成内容之前校验其结构。
让用户掌控智能体。用户可以为每个智能体设定其可执行操作的防护机制,在其活动日志中审查每一个动作,并在自主执行与人工审核执行之间做出选择。
AgentCore runtime 提供了多租户 MCP server 所需的生产能力,而每一项能力都对应 MoEngage 工作负载的一项具体需求。AgentCore runtime 会随需求变化伸缩会话,因此 MoEngage 无需为其客户 workspace 的流量高峰规划容量。默认情况下,每个会话运行在各自隔离的环境中,从而将一个品牌的对话和数据与另一个品牌隔离开来。内置的 JWT 授权器依据 MoEngage 现有的身份提供方校验 Token,因此 MCP server 使用与 API 相同的认证模型。
托管在 AgentCore 运行时上同样与框架无关。MoEngage 无需改动 MCP 服务器即可更换模型或智能体框架,这一点在智能体层持续演进的过程中尤为重要。通过 Amazon CloudWatch 提供的内置指标、日志和追踪,让 MoEngage 的工程师能够看清每一个会话。这些能力结合起来,使团队可以专注于智能体逻辑和营销智能,而不必操心托管基础设施。
通过 Amazon Bedrock 进行推理还为 MoEngage 带来了另外两项好处。Merlin AI 智能体在 Amazon Bedrock 上运行于 Anthropic Claude Sonnet 4.6、Claude Sonnet 5 和 Claude Sonnet 5.5,MoEngage 通过同一个 Amazon Bedrock API 在这些版本之间切换。此外,MoEngage 按 Token 付费,而无需自行运营 GPU 基础设施。Amazon Bedrock 不会使用客户的提示词或回复来训练基础模型,这对于一个要大规模处理客户互动数据的系统来说至关重要。
下面的示例展示了用户如何在不离开对话的情况下构建一场营销活动。
原文较长,译文为节选;译文由英文原文机器翻译,术语按行业惯例统一,可在文末展开原文核对。
查看英文原文(How MoEngage built agentic customer engagement on Amazon Bedrock AgentCore)
This post was co-written with Ashwin Srinivasan, Nishan Das and Karthik Baile from MoEngage.
A marketing or product team member planning a weekend flash sale often opens three tools before writing a single line of copy. First they open the analytics dashboard to see what worked last time, then the content library to find the right tone, and then the campaign builder to build the campaign itself. Repeat that across email, push, SMS, and WhatsApp, and much of a marketing team’s week goes to navigating tools instead of making decisions.
The MoEngage Model Context Protocol (MCP) Connector gives an MCP-compatible assistant, such as Claude or ChatGPT, secure, tenant-scoped access to a brand’s segments, campaign history, and content library.
This capability points to a broader shift in software platforms. Beyond a user interface for business users and an API for engineering teams, a third layer is emerging, where a user describes an outcome in plain language and an agent carries out the steps across the platform. For a customer engagement platform, that means a capability already exposed as an API can become a tool an agent calls, and a campaign that once moved across several tools can move through one conversation instead.
MoEngage, the agentic customer engagement platform that more than 1,350 consumer brands use across channels including push, email, in-app, SMS, WhatsApp, and Rich Communication Services (RCS), set out to build this layer. MoEngage built Merlin AI, a set of artificial intelligence (AI) agents that work with live platform data. Marketing and product teams can now draft, analyze, and adjust campaigns from a single conversation, while agents decide what to send each customer. One customer, Glance, saw a 38% uplift in push notification click-through rates as a result.
MoEngage treated this as an architecture problem. The question was how to give agents secure, tenant-scoped access to live data without rebuilding hundreds of existing APIs. In this post, we walk through how MoEngage solved it with Amazon Bedrock and Amazon Bedrock AgentCore, a platform to build, connect, and optimize AI agents at scale with any framework or model. The post covers the four agent modes in Merlin AI, how MoEngage exposed its existing APIs as MCP tools, and how the architecture keeps each tenant’s data isolated. It closes with the results MoEngage customers have seen and the pattern other software providers can reuse.
Solution overview: Four agent modes in Merlin AI
Merlin AI runs four kinds of agents. All four share the same foundation: foundation models in Amazon Bedrock for reasoning and generation, AgentCore runtime, a capability of Amazon Bedrock AgentCore, for hosting, and MCP for standardized access to data. Across all four modes, Merlin AI uses Anthropic Claude Sonnet 4.6, Claude Sonnet 5, and Claude Sonnet 5.5 on Amazon Bedrock for reasoning, tool-call planning, and content generation. For the full list of models, see Supported foundation models in Amazon Bedrock.
Embedded agents in Merlin AI Studio
Merlin AI Studio places purpose-built agents at the exact point in the workflow where marketing and product teams do that piece of work:
- Copywriter generates personalized push and transactional copy that stays consistent with the brand voice.
- Designer produces a marketing banner or image from a text description.
- Segment Assist turns a plain-language audience description into the correct set of attributes and filters. For example, a marketing or product team member can ask for users who abandoned a cart in the last 2 hours.
- Jinja Assist converts natural-language requests into working Jinja and Liquid markup for dynamic content.
- In-app Template Builder creates responsive, accessible HTML templates for in-app messages, including gamified formats, lead-capture pop-ups, and surveys.
- Flow Assist turns a high-level idea into a ready-to-deploy customer journey. Behind the scenes, a sequence of specialized steps interprets the request, proposes paths, builds the flow structure, refines it with historical data, and packages it for deployment.
Conversational agents
Conversational agents work across campaigns, analytics, segments, and flows. A user can ask a question in plain language and the agent calls the right tools to answer it or act on it. The Campaign Insights Agent, embedded on the analytics page, delegates to specialized sub-agents. One sub-agent runs analysis across several metrics at once. A second diagnoses why a metric is underperforming, and a third compares performance across time periods or segments. A final step formats the findings into a clear answer.
Custom agents
Custom agents let lifecycle and customer relationship management (CRM) teams design agents that run continuously on MoEngage data and tools, inside rules the product and marketing team defines. Every agent shows its work through an activity log of the data it pulled, the decisions it made, the channels it touched, and the content it sent. Teams can run an agent with full autonomy or require human review before anything executes.
Decisioning agents
Decisioning agents act for each individual customer. Each agent decides what to say, when, how often, and on which channel, and it learns from every outcome. Product and marketing teams set the content, goals, and guardrails, and the agents handle the rest, with visibility into every decision. Offer Decisioning selects the best offer on web and app surfaces. Campaign Decisioning delivers 1:1 decisions across email, push, SMS, and WhatsApp. Together with workflow agents, this puts both halves of agentic marketing in one system.
Architecture overview
The architecture has four layers. Each layer has a single responsibility and can change without affecting the others.
- Clients. Merlin AI agents inside the MoEngage product, and external MCP clients such as Claude and ChatGPT, through the MoEngage MCP Connector, connect to the MoEngage MCP server. Clients that support MCP can connect.
- MCP server on AgentCore runtime. MoEngage hosts its MCP server on AgentCore runtime. The server exposes MoEngage platform capabilities as MCP tools. It does not run its own model. Reasoning happens in the agent that calls it.
- MoEngage platform APIs. The MCP server calls the same OpenAPI 3.0-compatible APIs that MoEngage customers already use. These APIs enforce existing permissions and data residency rules.
- Foundation models in Amazon Bedrock. Agents use foundation models in Amazon Bedrock to plan tool calls, generate content, and summarize results. For model availability by Region, see Supported models by AWS Region in Amazon Bedrock.
In a typical request, a user signs in to MoEngage and asks a question. The client sends the request with the user’s existing JSON Web Token (JWT). AgentCore runtime validates the token and starts an isolated session for that user. The agent asks a model in Amazon Bedrock which tools to call. The MCP server calls the MoEngage APIs with the user’s tenant context and returns the results. The agent then composes the answer.
The following diagram shows how these components connect.
Turning existing APIs into MCP tools
MoEngage opens its platform to agents through an MCP server and agent-callable APIs. Its platform APIs for campaigns, analytics, segments, content, and flows were already OpenAPI 3.0-compatible, so MoEngage used the FastMCP framework to generate MCP tools from those specifications. Each operation becomes a tool with a structured schema, a description, and parameter validation.
The following simplified example shows the pattern:
import httpx
from fastmcp import FastMCP
spec = httpx.get(MOENGAGE_OPENAPI_URL).json()
client = httpx.AsyncClient(base_url=MOENGAGE_API_BASE)
mcp = FastMCP.from_openapi(openapi_spec=spec, client=client, name='moengage')
if __name__ == '__main__':
mcp.run(transport='streamable-http', host='0.0.0.0', port=8000)
The tools fall into five groups:
- Campaign tools create, edit, schedule, and send campaigns across channels.
- Analytics tools query delivery funnels, click-through rates, conversions, and cohort performance.
- Segmentation tools list, inspect, and create segments from behavioral and attribute filters.
- Content tools manage content blocks, templates, and dynamic content rules.
- Flow tools inspect, pause, or modify automation journeys.
The tools come from the specifications, so they stay in sync with the APIs. When a team updates a specification, the tool definitions update with it.
Keeping tenants isolated and identity out of the model’s reach
A multi-tenant system cannot let a model decide whose data it is reading. MoEngage made three design choices to help prevent that. First, the MCP server reuses the existing authentication model, accepting the same JWT-based authentication that MoEngage APIs already use, and AgentCore runtime validates each token before a request reaches the server. Second, workspace and user context travel in request headers that AgentCore runtime forwards to the server rather than as tool arguments, so the model does not see these values and cannot change them. Third, AgentCore runtime runs each user session in its own isolated environment, so one user’s conversation cannot read another’s session state.
On top of this, Amazon Bedrock Guardrails apply content safety and personally identifiable information (PII) filters to agent responses. A backend-for-frontend layer then validates the structure of generated content before the MoEngage interface renders it.
Give users control over agents. Users set guardrails on what each agent can do, review every action in its activity log, and choose between autonomous and human-reviewed execution.
Why MoEngage chose AgentCore runtime
AgentCore runtime provides the production capabilities that a multi-tenant MCP server needs, and each one addresses a specific requirement of MoEngage’s workload. AgentCore runtime scales sessions as demand changes, so MoEngage does not plan capacity for traffic bursts across its customer workspaces. Each session runs in its own isolated environment by default, which keeps one brand’s conversation and data separate from another’s. The built-in JWT authorizer validates tokens against MoEngage’s existing identity provider, so the MCP server uses the same authentication model as the APIs.
Hosting on AgentCore runtime is also framework-agnostic. MoEngage can change models or agent frameworks without touching the MCP server, which matters as the agent layer evolves. Built-in metrics, logs, and traces through Amazon CloudWatch give MoEngage engineers visibility into every session. Together, these capabilities let the team focus on agent logic and marketing intelligence rather than hosting infrastructure.
Inference through Amazon Bedrock gave MoEngage two more benefits. Merlin AI agents run on Anthropic Claude Sonnet 4.6, Claude Sonnet 5, and Claude Sonnet 5.5 on Amazon Bedrock, and MoEngage moves between these versions through the same Amazon Bedrock API. MoEngage also pays per token instead of operating GPU infrastructure. Amazon Bedrock does not use customer prompts or responses to train foundation models, which matters for a system that processes customer engagement data at scale.
One campaign, one conversation
The following example shows how a user builds a campaign without leaving the conversation.
- Ask for the draft. The user types:
Draft a weekend flash sale push for our high-value segment, using the same tone as our best-performing December campaign.
The agent calls the analytics tools to find the top December campaign, the segmentation tools to confirm the high-value segment, and the content tools to pull the brand voice. It returns a draft with several copy variants.
- Check what underperformed. The user asks:
Which push notifications last month had below 2% click-through rate (CTR), and what do they have in common?
The Campaign Insights Agent compares those campaigns and reports the shared pattern, such as send time or audience overlap.
- Adjust the journey. The user asks:
Show me the drop-off at step 3 of our onboarding flow, and pause the SMS branch if it’s below 5% conversion.
The agent reads the flow state through the flow tools and pauses the branch after the user confirms. This is the human-review mode in practice.
Each step uses the same tools that power the MoEngage interface. The user does not open a separate dashboard.
Results
Merlin AI agents on this architecture have been in production for more than 6 months. One customer, Glance, reached campaign go-live 50% faster and saw a 38% uplift in push notification click-through rates. With Merlin AI Copywriter, Glance teams also produce about three times more content variants per campaign.
Across the platform, MoEngage reports a 60–70% reduction in manual effort by marketing and product teams for channel, timing, and frequency decisions, and a 20–30% improvement in conversion rates from goal-based decisioning. Managed, pay-per-token inference in Amazon Bedrock reduced AI infrastructure costs by more than 50% compared with self-hosted models.
AgentCore feature availability varies by AWS Region. For supported Regions, see the Amazon Bedrock AgentCore documentation.
Conclusion
MoEngage made its platform agent-ready without rebuilding it. Existing OpenAPI specifications became MCP tools. AgentCore runtime provided hosting, authentication, and session isolation. Foundation models in Amazon Bedrock provided reasoning and generation. The result is a platform where marketing and product teams move from question to action in one conversation, where MoEngage engineers spend their time on marketing intelligence rather than infrastructure, and where agents handle workflows for the team and decisions for every customer while users stay in control.
The same pattern applies to other software providers with a mature API surface. Start from your existing specifications, keep identity outside the model, and let a managed runtime handle the production concerns.
To build your own MCP server on the same foundation, start with the Amazon Bedrock AgentCore documentation and follow the AgentCore runtime guide to host it. To choose a foundation model for your agents and review the security and data-handling controls, see the Amazon Bedrock User Guide. To generate MCP tools from your existing OpenAPI specifications, review the FastMCP documentation. To see Merlin AI in action, visit MoEngage Merlin AI. To plan a similar architecture, contact your AWS account team or Solutions Architect.
About the authors
Ashwin Srinivasan
Ashwin Srinivasan is a VP of Product at MoEngage, where he shapes the product vision around solving real-world customer pain points, ensuring team execution delivers reliable, scalable, and value-driven products that directly improve the user experience.
Nishan Das
Nishan Das is a Senior Director of Technology Partnerships at MoEngage, where he leads strategic technology partnerships and ecosystem alliances, driving product integration and expanding co-innovation initiatives across market partners.
Karthik Baile
Karthik Baile is a Partner Development Manager at MoEngage, where he manages partner marketing strategies, focusing on driving collaborative growth, brand alignment, and impactful go-to-market campaigns across strategic partner ecosystems.
Bhupesh Chadha
Bhupesh Chadha is a Principal Account Manager at Amazon Web Services, where he partners with independent software vendors (ISVs) to align their platform strategy with their business goals. He works with C-suite and senior leadership to accelerate growth, bring new capabilities to market, and turn technical investments into customer reach and differentiation.
Anant Murarka
Anant Murarka is a Solutions Architect at Amazon Web Services, where he works with ISV customers to design multi-tenant architectures and productionize AI-driven solutions. His areas of expertise include agentic AI, agent orchestration patterns, responsible AI, and helping product companies adopt generative AI on AWS. Outside of work, Anant is passionate about exploring how emerging AI paradigms reshape the way software products are built and delivered.
正文保留英文原文,标题与摘要由机器翻译。
原文发布于 AWS Machine Learning(How MoEngage built agentic customer engagement on Amazon Bedrock AgentCore),标题、摘要与正文由机器翻译,术语按行业惯例统一,未经人工逐句校订。