Transition from Fragmented Marketing Tools to an Agentic Layer
The starting point of this project was a field diagnosis indicating that marketing teams spend a significant amount of time exploring tools, switching between an analytics dashboard, content library, and campaign builder while planning weekend flash sales. MoEngage is a customer engagement platform used by over 1,350 consumer brands across push, email, in-app, SMS, WhatsApp, and RCS channels, and determined that a "third layer where agents perform steps across the platform when users describe results in natural language, beyond the two layers of UI and API" was necessary.
"A third layer is emerging where agents perform steps across the platform when users describe results in plain language."
Under this recognition of the problem, MoEngage built a suite of agent products called Merlin AI. The core constraint was to provide agents with safe and tenant-scoped real-time data access without rewriting the existing hundreds of APIs. As a solution, Amazon Bedrock and Amazon Bedrock AgentCore were chosen, and Model Context Protocol (MCP) was adopted as the standard interface.
Four Agent Modes of Merlin AI and Role Distribution
Merlin AI uses Anthropic Claude Sonnet 4.6, 5, 5.5 from Amazon Bedrock for inference, tool calling plans, and content generation across all modes, hosted on the AgentCore runtime and sharing a common base for data access via MCP.
| Mode | Representative Agent | Core Function |
|---|---|---|
| Embedded Agent (Studio) | Copywriter, Designer, Segment Assist, Jinja Assist, In-app Template Builder, Flow Assist | Generates copy, creates banners, transforms segments, converts Jinja/Liquid markup, creates HTML templates, structures journey flows at precise workflow points |
| Interactive Agent | Campaign Insights Agent (three sub-agents for analysis, diagnosis, and comparison) | Queries and executes across campaigns, analysis, segments, and flows using natural language |
| Custom Agent | Lifecycle and CRM team-defined agents | Continuously executes on MoEngage data and tools, with options for autonomous or human review modes |
| Decision-making Agent | Offer Decisioning, Campaign Decisioning | Makes 1:1 decisions on optimal offers, channels, timing, and frequency for each customer, learning continuously from results |
Embedded Agent: Solving Workflow Points
Merlin AI Studio places purpose-built agents at the exact points where marketers work. For example, Segment Assist converts natural language descriptions like "users who abandoned their cart in the last 2 hours" into the correct attribute and filter sets. Flow Assist transforms high-level ideas into ready-to-deploy customer journeys, sequentially performing internal steps of request interpretation → path suggestion → flow structure composition → refinement with historical data → deployment packaging.
- request interpretation
- path suggestion
- flow structure composition
- history refinement
- deployment packaging
Interactive Agent: Multi-Sub-Agent Collaboration
The Campaign Insights Agent is embedded in the analytics page, with three sub-agents sharing roles. One analyzes multiple metrics simultaneously, the second diagnoses the causes of poor metrics, and the third compares performance across periods and segments. The final step formats the results into clear answers.
Custom and Decision-making Agents: Autonomy and Guardrails
Custom agents continuously execute on MoEngage data and tools within the rules defined by product and marketing teams. All agents transparently disclose their work history through activity logs (data queries, decisions, channel contacts, sent content), with options for fully autonomous mode or human pre-review mode. Decision-making agents perform 1:1 decisions on offers and campaigns, integrating the "gentleman side of agentic marketing" into a single system with workflow agents.
Four-Layer Architecture: Responsibility Separation, Tenant Isolation, and Reuse of Existing Assets
The architecture is composed of four layers according to the single responsibility principle, allowing each layer to be modified without affecting others.
``` [Clients] → [MCP Server on AgentCore Runtime] → [MoEngage Platform APIs] → [Foundation Models in Amazon Bedrock] ```
Roles by Layer
1. Clients: Merlin AI agents within MoEngage products and external MCP clients (Claude, ChatGPT, etc.) access via the MoEngage MCP Connector. 2. MCP Server on AgentCore Runtime: Exposes MoEngage platform capabilities as MCP tools, does not hold its own models (inference is performed by calling agents), and creates user-specific isolation sessions after JWT verification. 3. MoEngage Platform APIs: Existing APIs compatible with OpenAPI 3.0 called by the MCP server, applying existing permissions and data residency rules. 4. Foundation Models in Amazon Bedrock: Used by agents for tool calling plans, content generation, and result summarization, referencing model availability by region.
Request Processing Flow
- user login/query
- send request with JWT
- validate AgentCore runtime token and start isolation session
- plan tool calls for Bedrock models
- MCP server calls API with tenant context
- return results and generate response
The key point is that the MCP server wraps existing APIs to expose them as tools, enabling agentification without rewriting APIs. Tenant isolation is ensured through JWT-based authentication and isolation sessions in the AgentCore runtime, with existing compliance rules like data residency operating as they do at the API layer.
Pattern for Agentifying Existing API Assets with MCP
The pattern demonstrated by MoEngage serves as a standard template for SaaS platforms adding an agent layer.
- Maintain existing OpenAPI 3.0 specs: The MCP server reads the specs and automatically generates tool schemas.
- Reuse permission models: Apply the same RBAC, ABAC, and data residency rules from the API layer.
- Model neutrality: The AgentCore runtime does not support specific frameworks or models; currently using Claude series in Bedrock but can be swapped out.
- Open external MCP clients: Grant tenant-scoped access to third-party assistants like Claude, ChatGPT via the MoEngage MCP Connector.
This approach minimizes development costs and migration risks by focusing on "exposing existing APIs as MCP tools" rather than building new APIs for agents.
Empirical Results and Platform Provider Reproduction Guide
The actual customer Glance recorded a 38% increase in push notification click-through rates after implementing Merlin AI. This figure is interpreted as a result of the combination of embedded, interactive, and decision-making agents optimizing content, timing, and channels on a 1:1 basis.
Checklist for platform providers to reproduce this pattern:
- [ ] Are existing APIs documented in OpenAPI 3.0 specs?
- [ ] Is authentication and authorization token-based (JWT, etc.) to pass tenant context?
- [ ] Are data residency and compliance rules enforced at the API layer?
- [ ] Are the necessary foundation models available in the AgentCore runtime region?
- [ ] Does the MCP server have capabilities for hosting, scaling, and observability operations?
Implications: The Agent Layer as the Third Layer of SaaS
The MoEngage case presents early evidence that B2B SaaS is evolving into a three-layer platform of "UI → API → Agent". The agent layer can be built by wrapping existing API assets with standard protocols like MCP, simplifying security architecture by delegating tenant isolation, permissions, and compliance to the existing API layer. Development organizations should focus on "agentifying existing APIs with MCP tools" rather than building new backends for agents, while product organizations should design combinations that fit their domain among the four modes of embedded, interactive, autonomous, and decision-making workflows.