Inspiration

Many companies lose money because they make decisions using incorrect or outdated data.

For usage-based SaaS companies, revenue depends on many systems working together, including product usage, billing, contracts, CRM data, and marketing data. When one data pipeline breaks or becomes outdated, teams can make costly mistakes. Finance may underbill customers, RevOps may miss growth opportunities, Marketing may report inaccurate metrics, and leaders may rely on dashboards that are no longer accurate.

That inspired us to build MarginTrust AI: an AI agent that helps companies find data problems and understand their business impact before they become expensive.

What it does

MarginTrust AI helps usage-based B2B SaaS companies find revenue and cost risks caused by data issues.

Users can ask questions such as:

  • Are we underbilling any enterprise customers this week?
  • Can I trust the revenue dashboard today?
  • Which data issue is costing us the most?
  • Which accounts are ready for expansion but missing from the CRM pipeline?
  • What should Finance, RevOps, or Data teams fix first?

The agent analyzes business data and connector health, estimates the financial impact, and recommends what to do next.

For example, underbilling exposure can be estimated as:

$$ \text{Underbilling Exposure} = \text{Expected Usage Charges} - \text{Actual Billed Amount} $$

Instead of simply saying that a data sync failed, MarginTrust AI explains:

  • which business metric is affected
  • how much money may be at risk
  • which accounts or systems are impacted
  • which team should fix the issue
  • what action should be taken next

The goal is to help teams protect revenue, reduce unnecessary costs, and trust their data.

How we built it

We built MarginTrust AI as a web application using a React frontend and a FastAPI backend.

The demo uses synthetic SaaS data for a fictional company called StreamWorks Cloud. The data represents common business systems such as product usage, contracts, invoices, CRM opportunities, marketing spend, support activity, and connector health.

The data is stored in BigQuery. We use Fivetran to move data and provide connector status information. The backend reads analytics views in BigQuery that identify issues such as underbilling risk, missed expansion opportunities, duplicate marketing spend, connector problems, and dashboard reliability.

The AI experience is powered by Gemini and Google Cloud Agent Builder. The agent combines business data with connector information to generate easy-to-understand findings and recommendations.

The product includes:

  • an executive risk dashboard
  • an AI chat interface
  • connector health monitoring
  • a prioritized action list
  • revenue and cost leakage detection
  • dashboard trust scoring
  • summaries for Finance, RevOps, and Data teams

Challenges we faced

One of the biggest challenges was making the project feel like a true AI agent instead of a simple chatbot or dashboard.

We wanted the agent to understand information from multiple sources, including usage data, invoices, contracts, CRM opportunities, marketing spend, connector status, and business impact. The agent needed to explain not only what went wrong, but also why it matters, how much it could cost, and who should take action.

Another challenge was creating realistic synthetic data. We wanted the data to be completely safe and fictional while still reflecting real SaaS problems such as underbilling, missed expansion revenue, duplicate marketing spend, and unreliable dashboards.

We also focused on making Fivetran an important part of the solution by connecting connector health and data movement directly to business outcomes.

What we learned

We learned that effective AI agents need more than a chat interface. They need reliable data, useful tools, and enough business context to provide actionable recommendations.

We also learned that trust is essential. Teams cannot act on vague AI responses. They need clear evidence, estimated impact, ownership, and recommended next steps.

Our biggest takeaway was that data quality is not just a technical issue. Problems with data pipelines can quickly lead to lost revenue, missed opportunities, wasted spending, and poor business decisions.

What’s next

Next, we want to make MarginTrust AI even more action-oriented by allowing it to trigger Fivetran syncs, create incident tickets, and notify the right team members automatically.

We also plan to expand the agent to support additional SaaS workflows such as renewal risk, churn risk, customer health monitoring, and finance reconciliation.

Our long-term vision is for MarginTrust AI to become an intelligence layer that helps companies understand not only whether their data pipelines are working, but also whether they can trust the business decisions built on top of that data.

Built With

Share this project:

Updates