Blog/

case-studies

How Index Built an AI-First Data Analytics Platform with Mastra

·

Jul 25, 2025

If point-and-click is a good way to build business dashboards, the founder reasoned, natural language would be even better.

That was the conclusion of Xavier Pladevall and Eduardo Portet, the founders of a BI platform with over a thousand customers that’s adding an agent layer on top.

The backstory: Pladevall and Portet grew up friends in the Dominican Republic together before each coming to the US for college to study CS. When they graduated in 2018 they decided to build a BI platform that was accessible to non-technical users like PMs and CEOs.

Over the next few years, their company, Index, has onboarded over 1,000 customers, allowing them to connect data warehouses and APIs into a BigQuery-based data access layer, and then streamline data analysis with a SQL and visual editor.

They’ve heavily invested in user experience, with well-architected dashboards, real-time shared cursors for multi-user collaboration.

For Pladevall and Portet, the next frontier was bringing AI into their product. They set to work on building a data analyst agent that would let users query their data in natural language.

Index's homepage

Index's homepage

Frustrated with TypeScript support in Python-first AI frameworks

Index needed an agent framework to power their conversational layer, which would sit on top of their drag-and-drop analytics.

The pipeline was something like: users would describe what they want, the agent would generates SQL, the backend would execute it, and the frontend would create charts or tables as needed.

The team had been using LangChain, but it just didn’t sit right with Portet and Pladevall, who were Typescript devs.

The Langchain ecosystem was Python-first, and "we felt like we were getting the short end of the stick," Portet laughs.

Type safety issues were particularly frustrating, with Langchain not consistently creating or enforcing types in its functions.

Finding Mastra

Index discovered Mastra through multiple touchpoints. A couple of their investors, as well as founder friends, recommended it. They also picked up a copy of Principles of Building AI Agents at a meetup, and were grateful for its thorough agent walkthough with code examples.

When they started using Mastra, the contrast with Langchain was clear. For one thing, types actually worked.

The "aha moment" happened immediately after installation. "Where it really clicked was when I ran yarn mastra dev, and the playground came up,” recalls Portet.

He loved the visual feedback. “I was like, okay, I can build with this. The playground was hands down the biggest thing."

Why Mastra Powers Index’s Agents

Index implemented their system using Mastra workflows, building a supervisor agent architecture that acts as a central router coordinating specialized nested workflows and agents.

They use Mastra's agentic capabilities extensively, with the supervisor coordinating multiple specialized components: data analyst agents for SQL generation and execution, visualization workflows for chart creation, API integration tools for third-party data sources, and nested workflows that can be reused across different agents.

"I like that Mastra's more opinionated on how things are done," Eduardo notes. "It takes cognitive load [out] of my head. I don't have to think about it. I just do it the way that you asked me to do it and connect everything together."

The transition from LangChain eliminated their type safety headaches completely. "The type safety and TypeScript support has been huge for our development velocity," Eduardo explains.

The team has found Mastra's development environment particularly valuable for rapid iteration. "The playground makes it easy to figure out what we want to build pretty quickly and then it's a matter of just hooking that output to the UI," Eduardo explains.

Expanding to unified data access

One thing that makes Index’s agents especially powerful is the data access layer they’ve built over the last few years.

This layer allows users to connect to data sources like Salesforce, Stripe, and PostHog as well as relational databases. Processed through BigQuery, this access layer creates a consistent workflow for Index's agents: "The workflow will always be write SQL, get a data set, execute on that data set," says Eduardo.

The schema generated by this layer, and ingested by Index’s agents, is one thing making them especially powerful.

The integrations allow complex data queries across diverse sources while maintaining a simple conversational interface. The supervisor pattern supports modular agent development and easy scaling of specialized capabilities.

Looking Ahead

Index is currently rolling out their agent with their existing customer base, while considering how their new agentic capabilities should affect their overall product positioning and messaging.

The shift from traditional BI tools to conversational AI represents a fundamental change in how their 1,000+ customers will interact with data.

"The playground and local development server have allowed us to move from concept to working prototype incredibly fast," Eduardo notes. "For a small team building something this ambitious, that development velocity has been critical."

Stay up to date