Blog

Why PLAID Japan builds agents on their Google Cloud infrastructure with Mastra

PLAID, Inc. (Tokyo Stock Exchange: 4165) is Japan's leading customer experience platform—think Mixpanel or Amplitude, but built specifically for the Japanese market. Founded in 2011 by former Rakuten exec Kenta Kurahashi, PLAID went public in December 2020 at a $500 million valuation after building KARTE, which now tracks over 1 trillion yen in annual e-commerce transactions. KARTE analyzes website visitor behavior and emotions in real-time to enable personalized communications, serving Japan's top businesses across e-commerce, recruiting, real estate, hotels, and education sectors.

Stuck building workflows with GUI tools

AI infrastructure became critical to PLAID's engineering roadmap because customers required increasingly sophisticated features like predictive user intent, dynamic content generation, and contextual recommendations that couldn't be built with rules-based logic

For internal AI workflows, PLAID's engineering team had been using a combination of no-code tools Dify and n8n, which presented challenges for a team accustomed to code-first development.

"Dify would often break with updates," explains Kosuke Oya, a software engineer at PLAID who co-authored the company's multicloud strategy. "And since it's managed through a GUI, it didn't align well with our product development flow."

For customer-facing products, the team faced similar issues with existing TypeScript AI frameworks. They tried using Langchain.js, but found that its Typescript type support was lacking. They used provider SDKs directly, but found that switching between LLMs wasn't straightforward.

Finding Mastra

PLAID's engineering team discovered Mastra on GitHub in mid-February, when Mastra went viral on Github Trending. "It became a hot topic internally when the GitHub star count grew rapidly," Oya recalls.

"It's a TypeScript framework, which is a great fit for us since most of our products are written in TypeScript," Oya explains. "We don't have in-house expertise in Python, and I believe TypeScript is a better language for long-term maintenance."

Takanori Koga, another engineer on the team, felt the same way: "Because it's built with TypeScript, we could quickly build things like agents and integrate with MCP servers."

Implementation on Google Cloud infrastructure

PLAID implemented within their existing Google Cloud infrastructure, running on Google Cloud Run and integrating it through their Backend-for-Frontend (BFF) layer. They have Node.js servers specifically to talk to both the frontend web app side as well as the backend infrastructure services.

"Our infrastructure is on GKE, and we've configured it to use the Mastra API Server from our BFF," Koga explains.

They use Mastra's agentic and MCP capabilities, as well as putting the Mastra client library in their frontend.

"Building an agent and connecting it remotely to an MCP server was easy," Koga says. "We integrate with external tools using the Mastra Client—we were able to integrate with a Slack App very quickly."

"Being able to manage it as code makes it easy to handle, which has increased our development productivity," Oya reports.

The shift from GUI tools to code-first development internally has made it easier for the engineering teams to collaborate.

"Because we can understand what's happening through the code, I believe it has improved the common understanding and ease of collaboration among engineers," Koga explains.

"Thanks to Mastra, AI Agents have become more accessible to us because we can develop and customize them ourselves," Koga notes.

The playground in particular is a team favorite. "The playground makes it easy to adjust prompts and troubleshoot with traces, which has boosted development productivity," Oya adds.

Building advanced agents for KARTE

The next step for PLAID is to move from internal into customer-facing agents.

"We plan to build advanced agents that can perform operations on the KARTE admin screen or conduct analysis on our behalf using tools, as well as multi-agents that can execute tasks across multiple products within KARTE," Oya explains.

The team is also working on streamlining internal processes: "We're planning to streamline our internal inquiry response process and create agents to automate routine tasks," Koga adds.

And, he adds, the team is continuously monitoring Mastra for the stream of new features.

"The update speed is extremely fast, so it's best to check on it continuously so you don't miss anything," he laughs.

Share

Stay up to date