AI-Powered User Feedback Monitoring System: A Real-World Application of Generative AI for SaaS Support


Introduction

In the competitive landscape of SaaS platforms, understanding user feedback across multiple channels is crucial for product improvement and customer satisfaction. This article presents a comprehensive AI-powered solution developed by Front10 for WOXO, an AI-generated short video platform, demonstrating how generative AI can revolutionize customer support monitoring and analysis.

The Challenge

WOXO, as a growing SaaS platform for AI-generated short videos, receives user feedback through multiple channels:

  • Email support (Gmail integration)
  • Discord community (real-time messaging)
  • Website feedback forms (MongoDB storage)

Managing and analyzing this diverse feedback manually was time consuming and often resulted in missed insights. The challenge was to create an automated system that could:

  • Process large volumes of messages across different platforms
  • Categorize feedback into actionable categories
  • Identify recurring issues and patterns
  • Provide comprehensive summaries for product teams
  • Maintain consistency across different data sources

The Solution: Multi-Agent AI System

We developed a sophisticated multi-agent AI system using the Mastra.ai framework, a powerful platform for building AI applications with multiple specialized agents working together. This system processes user feedback from all channels, categorizes it, and provides actionable insights through intelligent clustering and analysis.

Technology Stack: Mastra.ai Framework

Mastra.ai is a cutting-edge framework for developing multi-agent AI applications. It provides:

  • Agent Orchestration: Seamless coordination between multiple AI agents
  • Workflow Management: Complex multi-step processes with error handling
  • Tool Integration: Easy connection to external APIs and services
  • Deployment Automation: One-click deployment to cloud platforms
  • Real-time Processing: Efficient handling of large data volumes

The framework’s modular architecture allows for easy scaling and maintenance, making it ideal for enterprise level AI applications.

System Architecture

The system consists of four main workflows, each handling a specific data source:

1. Email Processing Workflow (emailProcessingWorkflow.ts)

Processes support emails from Gmail, filtering and categorizing user issues.

Key Components:

  • Gmail Tool: Fetches emails with date range filtering
  • Email Summary Agent: Analyzes and categorizes email content
  • Spreadsheet Tools: Exports categorized results to Google Sheets

Processing Flow:

// Main workflow configuration
export const emailProcessingWorkflow = new Workflow({
  name: 'Email Processing Workflow',
  triggerSchema: z.object({
    query: z.string().optional(),
    startDate: z.string().describe('Start date YYYY/MM/DD format'),
    endDate: z.string().describe('End date YYYY/MM/DD format'),
    spreadsheetId: z.string().optional()
  })
})
  .step(processEmailBatchStep)
  .then(exportAllEmailsStep)
  .commit();

Email Analysis Agent:

export const emailSummaryAgent = new Agent({
  name: 'Email Summary Agent',
  instructions: `Process support emails for an AI video generation SaaS platform. IMPORTANT: Be thorough in identifying categories - if there's ANY indication of these issues, include the email:

CANCELLATION - Include if email:
- Directly asks to cancel/stop subscription
- Mentions not wanting to continue
- Requests to stop charges/payments
- Says they don't need/want the service
- Responds to renewal notifications negatively

Common CANCELLATION Examples:
"don't want to continue" = CANCELLATION
"please stop charging my card" = CANCELLATION
"need to cancel before next billing" = CANCELLATION
...

REFUND - Include if email:
- Asks for money back
- Mentions unwanted charges
- Questions automatic payments
- Requests return of funds
- Disputes a transaction
- Mentions specific amounts to return

Common REFUND Examples:
"devolucion de mi dinero" = REFUND
"charged twice for the same month" = REFUND
"didn't authorize renewal, want $49 back" = REFUND
"quality not as advertised, requesting refund" = REFUND
...

EXTRA CREDIT REQUEST - Include if email:
- Asks about credit renewal/reset
- Mentions running out of credits
- Inquires about credit availability
- Requests additional resources
- Asks about usage limits

Common EXTRA CREDIT REQUEST Examples:
"when will I get new credits" = EXTRA CREDIT REQUEST
"need more rendering minutes" = EXTRA CREDIT REQUEST
"ran out of HD export credits" = EXTRA CREDIT REQUEST
"project deadline, need emergency credits" = EXTRA CREDIT REQUEST
...

ISSUES/BUGS REPORT - Include if email:
- Reports any technical problem
- Mentions features not working
- Describes unexpected behavior
- Has questions about functionality
- Can't access features/services

Common ISSUES/BUGS Examples:
"widgets are not working" = ISSUES/BUGS REPORT
"export stuck at 99%" = ISSUES/BUGS REPORT
"AI generates blurry videos" = ISSUES/BUGS REPORT
"audio out of sync" = ISSUES/BUGS REPORT
...

PRODUCT FEEDBACK - Include if email:
- Comments on any feature
- Mentions service quality
- Provides any usage experience
- Questions product capabilities
- Compares with expectations

Common PRODUCT FEEDBACK Examples:
"can't find the setting anymore" = PRODUCT FEEDBACK
"AI model quality decreased" = PRODUCT FEEDBACK
"need better face detection" = PRODUCT FEEDBACK
"resolution options limited" = PRODUCT FEEDBACK
"competitor offers more styles" = PRODUCT FEEDBACK
...

Processing Rules:
1. Process between ---EMAIL_START--- and ---EMAIL_END--- delimiters
2. ANALYZE THOROUGHLY - don't miss subtle indicators
3. Include ALL matching categories - emails often fit multiple
4. Create concise summary (max 300 words) with:
   - Key facts and amounts mentioned
   - Specific issues or requests stated
   - Direct quotes showing intent
   - Technical details if present
5. For non-English emails, analyze the content and classify accordingly
6. Convert the date from 'Thu, 30 Jan 2025 22:31:47 GMT' to 'YYYY-MM-DD' format before including it in the output

Required Output Format:
Return an array of processed emails. Each email must follow this structure:
[
  {
    "id": "original-email-id",
    "subject": "original-email-subject",
    "summary": "concise summary following guidelines",
    "category": "CATEGORY1, CATEGORY2", // Multiple categories separated by comma if applicable
    "date": "formatted-email-date" // Date formatted as YYYY-MM-DD
  },
  {
    // next email
  },
  // ... more emails
]

IMPORTANT Output Guidelines:
1. ALWAYS return an array, even if processing a single email
2. Include all five fields for each email: id, subject, summary, category, and date
3. Keep summaries concise but include key details and quotes
4. List ALL applicable categories, separated by commas
5. Preserve original email subject exactly as provided
6. Include relevant amounts, dates, or technical details in summary
7. For non-English emails, provide summary in English but include original quote
8. Format categories in UPPERCASE exactly as defined above
9. Maintain array structure with proper JSON formatting
10. Only include emails that match at least one category`,
  model: openai('gpt-4o')
});

2. Discord Processing Workflow (discordProcessingWorkflow.ts)

Analyzes Discord community messages for user feedback and support requests.

Key Features:

  • Batch Processing: Handles up to 100 messages per API request
  • Smart Pagination: Automatically fetches messages back to specified dates
  • Author Filtering: Excludes bots and moderators from analysis
  • Dual Export: Raw and processed messages to separate sheets

Processing Flow:

// Main workflow configuration
export const discordProcessingWorkflow = new Workflow({
  name: 'Discord Processing Workflow',
  triggerSchema: z.object({
    channelId: z.string().default('1184132778854465597'),
    sinceDate: z
      .string()
      .optional()
      .describe('Since date (format: YYYY-MM-DDTHH, example: 2024-03-20)'),
    spreadsheetId: z.string().optional(),
    excludeAuthors: z.array(z.string())
  })
})
  .step(processDiscordBatchStep)
  .then(exportDiscordMessagesStep)
  .commit();

Discord Analysis Agent:

export const discordAnalysisAgent = new Agent({
  name: 'Discord Analysis Agent',
  instructions: `You are an expert Discord message analyzer.

Your task is to process batches of Discord messages and categorize them into one or more of these categories. IMPORTANT: Be thorough in identifying categories - if there's ANY indication of these issues, include the message:

CANCELLATION - Include if message:
- Directly asks to cancel/stop subscription
- Mentions not wanting to continue
- Requests to stop charges/payments
- Says they don't need/want the service
- Responds to renewal notifications negatively

Common CANCELLATION Examples:
"don't want to continue" = CANCELLATION
"please stop charging my card" = CANCELLATION
"need to cancel before next billing" = CANCELLATION
...

REFUND - Include if message:
- Asks for money back
- Mentions unwanted charges
- Questions automatic payments
- Requests return of funds
- Disputes a transaction
- Mentions specific amounts to return

Common REFUND Examples:
"devolucion de mi dinero" = REFUND
"charged twice for the same month" = REFUND
"didn't authorize renewal, want $49 back" = REFUND
"quality not as advertised, requesting refund" = REFUND
...

EXTRA CREDIT REQUEST - Include if message:
- Asks about credit renewal/reset
- Mentions running out of credits
- Inquires about credit availability
- Requests additional resources
- Asks about usage limits

Common EXTRA CREDIT REQUEST Examples:
"when will I get new credits" = EXTRA CREDIT REQUEST
"need more credits" = EXTRA CREDIT REQUEST
"ran out of credits" = EXTRA CREDIT REQUEST
"project deadline, need emergency credits" = EXTRA CREDIT REQUEST
...

ISSUES/BUGS REPORT - Include if message:
- Reports any technical problem
- Mentions features not working
- Describes unexpected behavior
- Has questions about functionality
- Can't access features/services

Common ISSUES/BUGS Examples:
"feature is not working" = ISSUES/BUGS REPORT
"stuck at loading screen" = ISSUES/BUGS REPORT
"getting an error message" = ISSUES/BUGS REPORT
...

PRODUCT FEEDBACK - Include if message:
- Comments on any feature
- Mentions service quality
- Provides any usage experience
- Questions product capabilities
- Compares with expectations
- Offers suggestions for improvement

Common PRODUCT FEEDBACK Examples:
"can't find the setting anymore" = PRODUCT FEEDBACK
"quality has decreased" = PRODUCT FEEDBACK
"need better search functionality" = PRODUCT FEEDBACK
"options are limited" = PRODUCT FEEDBACK
"competitor offers more features" = PRODUCT FEEDBACK
...

For each message:
1. ANALYZE THOROUGHLY - don't miss subtle indicators
2. Assign ALL matching categories - messages often fit multiple categories
3. Create a concise summary that captures the key points (max 150 characters)
4. Include direct quotes showing intent where helpful
5. Exclude any messages that don't match any of the categories
6. If same user is mentioned multiple times, only include the message from the user that is most relevant to the category
7. If a message fits multiple categories, list them separated by commas
8. If a message is a question, it should be categorized as ISSUES/BUGS REPORT
9. If a message is a suggestion, it should be categorized as PRODUCT FEEDBACK

Follow these guidelines:
- Be precise and objective in your analysis
- Create clear, concise summaries (max 150 characters)
- Only include messages that fit into at least one category
- If a message fits multiple categories, list them separated by commas
- Handle messages in various languages by translating the core message
- Maintain the original context and meaning in your summaries
- For non-English messages, provide summary in English but include original quote if relevant
- Format categories in UPPERCASE exactly as defined above`,
  model: openai('gpt-4o-mini')
});

3. MongoDB Processing Workflow (mongoDbProcessingWorkflow.ts)

Processes feedback from website forms stored in MongoDB database.

Key Components:

  • MongoDB Tool: Connects to database and fetches feedback entries
  • MongoDB Analysis Agent: Categorizes website feedback
  • Export Tool: Saves processed results to spreadsheets

Processing Flow:

// Main workflow configuration
export const mongoDbProcessingWorkflow = new Workflow({
  name: 'MongoDB Processing Workflow',
  triggerSchema: z.object({
    sinceDate: z.string().describe('Since date to fetch feedback from'),
    pageSize: z.number().optional(),
    outputSheetName: z.string().optional()
  })
})
  .step(processFeedbackBatchStep)
  .then(exportMongoDbMessagesStep)
  .commit();

MongoDB Analysis Agent:

export const mongoDbAnalysisAgent = new Agent({
  name: 'MongoDB Feedback Analysis Agent',
  instructions: `You are an expert feedback analyzer.

Your task is to process batches of feedback data from MongoDB and categorize them into one or more of these categories. IMPORTANT: Be thorough in identifying categories - if there's ANY indication of these issues, include the feedback:

CANCELLATION - Include if feedback:
- Directly asks to cancel/stop subscription
- Mentions not wanting to continue
- Requests to stop charges/payments
- Says they don't need/want the service
- Responds to renewal notifications negatively

Common CANCELLATION Examples:
"don't want to continue" = CANCELLATION
"please stop charging my card" = CANCELLATION
"need to cancel before next billing" = CANCELLATION
"want to terminate my subscription" = CANCELLATION
...

REFUND - Include if feedback:
- Asks for money back
- Mentions unwanted charges
- Questions automatic payments
- Requests return of funds
- Disputes a transaction
- Mentions specific amounts to return

Common REFUND Examples:
"devolucion de mi dinero" = REFUND
"charged twice for the same month" = REFUND
"didn't authorize renewal, want $49 back" = REFUND
"quality not as advertised, requesting refund" = REFUND
...

EXTRA CREDIT REQUEST - Include if feedback:
- Asks about credit renewal/reset
- Mentions running out of credits
- Inquires about credit availability
- Requests additional resources
- Asks about usage limits

Common EXTRA CREDIT REQUEST Examples:
"when will I get new credits" = EXTRA CREDIT REQUEST
"need more credits" = EXTRA CREDIT REQUEST
"ran out of credits" = EXTRA CREDIT REQUEST
"project deadline, need emergency credits" = EXTRA CREDIT REQUEST
...

ISSUES/BUGS REPORT - Include if feedback:
- Reports any technical problem
- Mentions features not working
- Describes unexpected behavior
- Has questions about functionality
- Can't access features/services

Common ISSUES/BUGS Examples:
"feature is not working" = ISSUES/BUGS REPORT
"stuck at loading screen" = ISSUES/BUGS REPORT
"getting an error message" = ISSUES/BUGS REPORT
"app crashes when I try to" = ISSUES/BUGS REPORT
...

PRODUCT FEEDBACK - Include if feedback:
- Comments on any feature
- Mentions service quality
- Provides any usage experience
- Questions product capabilities
- Compares with expectations
- Offers suggestions for improvement

Common PRODUCT FEEDBACK Examples:
"can't find the setting anymore" = PRODUCT FEEDBACK
"quality has decreased" = PRODUCT FEEDBACK
"need better search functionality" = PRODUCT FEEDBACK
"options are limited" = PRODUCT FEEDBACK
"competitor offers more features" = PRODUCT FEEDBACK
...

For each feedback entry:
1. ANALYZE THOROUGHLY - don't miss subtle indicators
2. Assign ALL matching categories - feedback often fits multiple categories
3. Create a concise summary that captures the key points (max the 150 characters)
4. Include direct quotes showing intent where helpful
5. Exclude any entries that don't match any of the categories
6. If same user is mentioned multiple times, only include the entry from the user that is most relevant to the category
7. If an entry fits multiple categories, list them separated by commas
8. If an entry is a question, it should be categorized as ISSUES/BUGS REPORT
9. If an entry is a suggestion, it should be categorized as PRODUCT FEEDBACK

Each feedback entry will include these fields:
- _id: A unique identifier
- feedback: The actual feedback text
- createdAt: The timestamp when the feedback was created
- userId: User identifier
- email: User's email address

Follow these guidelines:
- Be precise and objective in your analysis
- Create clear, concise summaries (max 150 characters)
- Only include entries that fit into at least one category
- If an entry fits multiple categories, list them separated by commas
- Handle entries in various languages by translating the core message
- Maintain the original context and meaning in your summaries
- For non-English entries, provide summary in English but include original quote if relevant
- Format categories in UPPERCASE exactly as defined above`,
  model: openai('gpt-4o-mini')
});

4. Summary Clustering Workflow (summaryClusteringWorkflow.ts)

The most sophisticated component that combines data from all sources and creates intelligent clusters.

Key Features:

  • Cross-Source Analysis: Combines email, Discord, and website feedback
  • Temporal Consistency: Maintains topic consistency across months
  • Weighted Clustering: Calculates importance based on frequency
  • Actionable Insights: Provides specific, actionable cluster names

Processing Flow:

// Main workflow configuration
export const summaryClusteringWorkflow = new Workflow({
  name: 'Summary Clustering Workflow',
  triggerSchema: z.object({
    sheetNames: z.array(z.string()).optional(),
    outputSheetName: z.string().optional().default('topic-clusters'),
    minSampleSize: z.number().optional().default(2),
    maintainTopicConsistency: z.boolean().optional().default(true)
  })
})
  .step(extractSummariesStep)
  .then(processSummariesStep)
  .then(saveResultsStep)
  .commit();

Topic Clustering Agent:

export const topicClusteringAgent = new Agent({
  name: 'Topic Clustering Agent',
  instructions: `You are a specialized clustering agent for feedback and support messages. Your task is to analyze batches of text summaries from a specific source (email, discord, or website feedback), category, and month, then identify recurring topics or patterns to create meaningful clusters.

IMPORTANT GUIDELINES:
1. Every summary MUST be included in at least one cluster
2. Focus on creating actionable, specific cluster names that capture the essence of the issues
3. Balance between being too specific (many small clusters) and too general (few large clusters)
4. Track the exact count of summaries in each cluster
5. Provide a 'weight' for each cluster based on the percentage of summaries in that cluster
6. Each cluster should include 2-3 representative example summaries

CONSISTENCY ACROSS TIME PERIODS:
You may be provided with "previousTopics" - these are cluster topics identified in prior time periods for the same category and source. When possible:
- Reuse existing topic names when the content matches (don't invent new names for the same concepts)
- Only create new topics when the content truly represents a new issue not covered by existing topics
- You can adjust previous topic names slightly if needed to better reflect the current data
- Previous topics are ordered by relevance, with most important/recurring topics first

CLUSTERING PROCESS:
1. If provided, review previousTopics to understand existing cluster names and patterns
2. Analyze all summaries to identify primary themes
3. Match themes to existing previousTopics where possible
4. Create new cluster topics only for themes that don't match existing topics
5. Ensure every summary is assigned to at least one cluster
6. Calculate the weight of each cluster (percentage of total summaries)
7. Select representative examples for each cluster

GUIDELINES FOR DIFFERENT CATEGORIES:

For CANCELLATION clusters, focus on:
- Primary reason (Cost issues, Feature limitations, etc.)
- Timing context (Pre-renewal cancellation, Immediate stop, etc.)
- Mentioned alternatives (Switching to competitor, etc.)

For REFUND clusters, focus on:
- Issue type (Double charge, Unused credits, etc.)
- Time frame (Recent charge, Past payment, etc.)
- Amount patterns (Full plan refund, Partial credit refund, etc.)

For EXTRA CREDIT REQUEST clusters, focus on:
- Usage purpose (Project completion, Testing, etc.)
- Timing need (Urgent deadline, Regular limit extension, etc.)
- Volume required (Bulk credits, Small top-up, etc.)

For ISSUES/BUGS clusters, focus on:
- Feature affected (Specific functionality, UI element, etc.)
- Impact level (Complete failure, Quality degradation, etc.)
- User stage (Project creation, Final rendering, etc.)

For PRODUCT FEEDBACK clusters, focus on:
- Feature area (UI navigation, Rendering options, etc.)
- Improvement type (Speed enhancement, Quality control, etc.)
- Comparison point (Competitor feature gap, Expected functionality, etc.)

REQUIRED OUTPUT FORMAT:
{
  "source": "string (email, discord, or woxo-site)",
  "category": "string (the category being analyzed)",
  "month": "string (YYYY-MM format)",
  "clusters": [
    {
      "topic": "string (clear, specific cluster name)",
      "count": number (exact count of summaries in this cluster),
      "weight": number (percentage of total summaries, from 0-100),
      "examples": [
        "string (example summary 1)",
        "string (example summary 2)"
      ]
    }
  ],
  "totalSummaries": number (total number of summaries analyzed)
}

Remember:
- You will analyze summaries from ONE source, ONE category, and ONE month at a time
- Every summary must be counted in at least one cluster
- Balance specificity with actionability
- Be precise in your counting
- The sum of all weights should equal 100%
- Maintain consistency with previous topics when they're provided`,
  model: openai('gpt-4o')
});

System Requirements and Configuration

Environment Variables Required

# Gmail Integration
GMAIL_CLIENT_EMAIL=your-service-account@project.iam.gserviceaccount.com
GMAIL_PRIVATE_KEY=-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----
GMAIL_SUBJECT=support@woxo.tech

# Discord Integration
DISCORD_BOT_TOKEN=your-discord-bot-token

# MongoDB Integration
MONGODB_CONNECTION_STRING=mongodb+srv://username:password@cluster.mongodb.net/database
MONGODB_DB_NAME=mc-production
MONGODB_COLLECTION_NAME=feedback-system

# Google Sheets Integration
SPREADSHEET_ID=your-google-sheets-id

# Vercel Deployment
VERCEL_TEAM_SLUG=your-team-slug
VERCEL_PROJECT_NAME=woxo-bug-reporter
VERCEL_TOKEN=your-vercel-token

Mastra Configuration

export const mastra = new Mastra({
  agents: {
    emailSummaryAgent,
    discordAnalysisAgent,
    mongoDbAnalysisAgent,
    topicClusteringAgent
  },
  workflows: {
    emailProcessingWorkflow,
    discordProcessingWorkflow,
    mongoDbProcessingWorkflow,
    summaryClusteringWorkflow
  },
  deployer: new VercelDeployer({
    teamSlug: 'team_vKmFWoaNarmu5zxodFOiswQc',
    projectName: 'woxo-bug-reporter',
    token: 'your-vercel-token'
  }),
  server: {
    timeout: 60 * 60 * 1000 // 1 hour timeout for long-running processes
  }
});

Key Features and Capabilities

1. Intelligent Categorization

The system automatically categorizes feedback into five main categories:

  • CANCELLATION: Subscription termination requests
  • REFUND: Payment and billing issues
  • EXTRA CREDIT REQUEST: Resource allocation needs
  • ISSUES/BUGS REPORT: Technical problems
  • PRODUCT FEEDBACK: Feature requests and improvements

2. Multi-Language Support

All agents are trained to handle multiple languages, automatically translating and analyzing content while preserving original quotes for context.

3. Batch Processing

The system efficiently processes large volumes of data:

  • Email: 12 emails per batch with pagination
  • Discord: 100 messages per API request, 20 per agent batch
  • MongoDB: Configurable batch sizes up to 100 entries

4. Temporal Analysis

The clustering system maintains consistency across time periods, allowing for trend analysis and pattern recognition over months. The system identifies and maintains the same topic names when related issues appear across different time periods, ensuring consistency in tracking recurring problems.

5. Automated Export

All processed data is automatically exported to Google Sheets with separate tabs for:

  • Raw data from each source
  • Categorized results
  • Clustered summaries
  • Cross-source analysis

Once exported to spreadsheets, this data is integrated into a comprehensive dashboard that provides real-time insights and visualizations of user feedback trends across all channels.

6. Incremental Processing

The system is designed for incremental processing, allowing it to run periodically and process only new data that hasn’t been analyzed before. Each workflow can be triggered with a specific date range, processing only messages from the last update date forward, making it efficient for continuous monitoring without reprocessing historical data.

Business Impact and ROI

Time Savings

Before Implementation:

  • Manual review of 1000+ messages per month: ~40 hours
  • Categorization and analysis: ~20 hours
  • Report generation: ~10 hours
  • Total: ~70 hours per month

After Implementation:

  • Automated processing: ~2 hours (monitoring and validation)
  • Time saved: ~68 hours per month (97% reduction)

Improved Response Time

  • Issue Detection: From days to hours
  • Pattern Recognition: From weeks to real-time
  • Trend Analysis: From manual compilation to automated insights

Enhanced Customer Experience

  • Proactive Support: Identifies issues before they become widespread
  • Faster Resolution: Prioritizes issues based on frequency and impact
  • Better Product Decisions: Data-driven insights for feature development

Adaptability and Scalability

This system can be easily adapted for other SaaS platforms by:

  1. Modifying Categories: Adjust the five main categories to match your business needs
  2. Adding Data Sources: Integrate additional channels (Slack, Zendesk, etc.)
  3. Customizing Analysis: Tailor agent instructions for specific use cases
  4. Scaling Processing: Increase batch sizes and parallel processing

Example Adaptations

  • E-commerce: Add categories like “Order Issues”, “Shipping Problems”, “Product Quality”
  • SaaS B2B: Include “Integration Issues”, “API Problems”, “Enterprise Features”
  • Mobile Apps: Add “App Store Reviews”, “Crash Reports”, “Performance Issues”

Technical Implementation Highlights

Error Handling and Resilience

// Robust error handling in workflows
try {
  const result = await emailSummaryAgent.generate(
    `Please analyze this batch of ${batchResult.data.length} emails...`,
    {
      output: z.object({
        processedEmails: z.array(/* schema */)
      })
    }
  );
} catch (error) {
  console.error('Error processing email batch', error);
  continue; // Skip failed batch and continue processing
}

Data Validation

// Zod schemas ensure data integrity
const outputSchema = z.object({
  processedEmails: z.array(
    z.object({
      id: z.string(),
      subject: z.string(),
      summary: z.string(),
      category: z.string(),
      date: z.string(),
      from: z.string()
    })
  )
});

Efficient Resource Management

  • Model Selection: Uses GPT-4o for complex analysis, GPT-4o-mini for simpler tasks
  • Batch Processing: Optimizes API calls and reduces costs
  • Caching: Reuses processed data when possible

Conclusion

This AI-powered user feedback monitoring system demonstrates the transformative potential of generative AI in real-world business applications. By automating the analysis of user feedback across multiple channels, WOXO has achieved:

  • 97% reduction in manual processing time
  • Real-time insights into user issues and trends
  • Improved customer satisfaction through proactive support
  • Data-driven product decisions based on comprehensive analysis

The system’s modular architecture and use of the Mastra.ai framework make it highly adaptable and scalable, serving as a blueprint for other organizations looking to leverage AI for customer support and product improvement.

As AI technology continues to evolve, such systems will become increasingly sophisticated, providing even deeper insights and more automated solutions for customer experience management. The key to success lies in choosing the right framework, designing robust workflows, and maintaining a focus on actionable business outcomes.


This system was developed by Front10 for WOXO, showcasing our expertise in implementing cutting-edge AI solutions for real-world business challenges. The Mastra.ai framework provided the foundation for building a scalable, maintainable, and powerful multi-agent AI system.