Categories Configuration Guide

Estimated reading time: 8 minutes

Table of Contents

Quick Start

The Categories page is where you define the email categories that the AI will use to classify and organize your Gmail inbox. Well-designed categories are the foundation of effective email automation and intelligent inbox organization.

What You'll Learn How to create effective email categories, configure classification rules, set up automated actions, and optimize category performance for accurate AI-powered email organization.

Key Concepts

Creating Your First Category

  1. Click the "Add Category" button in the top-right corner of the Categories page
  2. Enter a clear, descriptive category name (e.g., "Client Communications")
  3. Write a specific description explaining what emails belong in this category
  4. Choose a color for the Gmail label (optional but recommended for visual organization)
  5. Add keywords that help the AI identify emails for this category
  6. Click "Save" to create the category
Start with System Defaults The system provides 8-10 default categories optimized for common use cases. Review these first before creating custom categories. You can enable/disable or modify any default category to match your needs.

Creating & Editing Categories

Categories are configured through a comprehensive 5-tab modal that covers all aspects of email classification, automated actions, and category relationships.

Category Management Workflow

Creating a New Category

  1. Click "Add Category" button
  2. Complete required fields in the Basic Info tab (name, description)
  3. Configure classification rules in the Rules tab (keywords, confidence threshold)
  4. Set up automated actions in the Actions tab (optional)
  5. Define category relationships in the Relationships tab (optional)
  6. Review advanced settings in the Advanced tab
  7. Click "Save Category"

Editing an Existing Category

  1. Find the category in the Categories list
  2. Click the "Edit" button (pencil icon)
  3. Modify any fields across the 5 tabs
  4. Click "Save Category" to apply changes
Changes Take Effect Immediately Category modifications apply to all new emails processed after saving. Existing labeled emails are not retroactively reclassified. To reclassify old emails, you would need to manually trigger reprocessing or remove old labels in Gmail.

Enabling/Disabling Categories

Use the toggle switch on each category card to enable or disable classification:

Use Case: Temporarily disable seasonal categories (e.g., "Holiday Shopping") during off-season without deleting the configuration.

Deleting Categories

  1. Click the "Delete" button (trash icon) on the category card
  2. Confirm deletion in the dialog
  3. Category configuration is permanently removed
Deletion Warning Deleting a category removes the classification configuration but does NOT remove existing Gmail labels from previously classified emails. To remove labels from Gmail, use Gmail's bulk label removal feature.

Configuration Reference

Categories are configured through 5 tabs containing 16 total configuration fields. All fields are stored in Firestore at tenant_users/{tenant_id}_{user_email}/config/categories and loaded by the email processor during classification.

Tab 1: Basic Info

Category Name

Type: Text (required)

Purpose: Internal identifier for the category

Best Practice: Use clear, concise names (2-4 words). Examples: "Client Projects", "Team Updates", "Financial Documents"

Backend Use: Sent to Gemini AI in classification prompt

Category Description

Type: Textarea (required)

Purpose: Detailed explanation of what emails belong in this category

Best Practice: Be specific and include examples. The AI reads this description when classifying emails.

Example: "Emails from clients regarding active projects, including status updates, deliverable requests, feedback, and project-related questions."

Backend Use: Critical for AI classification accuracy; included in Gemini prompt

Label Color

Type: Color picker

Purpose: Color applied to Gmail label for visual identification

Options: Choose from Gmail's standard label colors

Best Practice: Use consistent color schemes (e.g., red for urgent, blue for informational, green for personal)

Backend Use: Applied when creating/updating Gmail labels via label_service.py

Gmail Label Name

Type: Text (optional)

Purpose: Custom name for the Gmail label (if different from category name)

Default: Uses category name if not specified

Use Case: Shorten long category names for Gmail (e.g., "Client Communications and Project Updates" → "Client Projects")

Enabled

Type: Toggle (boolean)

Purpose: Enable or disable this category for classification

Default: Enabled (true)

Backend Use: Email processor skips disabled categories during classification

Tab 2: Rules

Keywords

Type: Comma-separated list

Purpose: Keywords that help the AI identify emails for this category

Example: "project update, deliverable, milestone, deadline, status report"

Backend Use: Included in Gemini classification prompt as hints

Note: Keywords guide the AI but don't guarantee classification (AI considers full email context)

Confidence Threshold

Type: Number (0-100)

Purpose: Minimum confidence score required to apply this category

Default: 70 (70%)

Range:

  • 60-70: More emails classified (lower precision)
  • 75-85: Balanced approach (recommended)
  • 90-95: Only very confident matches (high precision, fewer classifications)

Backend Use: Checked in main.py during classification; categories below threshold are not applied

Priority Level

Type: Dropdown (high/medium/low)

Purpose: Default priority for emails in this category

Use Case: Automatically prioritize categories like "Client Communications" (high) vs. "Newsletters" (low)

Backend Use: Used for priority label creation if enabled in Global Rules

Tab 3: Actions

Automated actions triggered when an email is classified into this category.

Auto-Draft Reply

Type: Checkbox (boolean)

Purpose: Automatically create a draft reply using AI when email is classified

Backend Use: Triggers draft creation in main.py (line 1381+)

Requirements: Confidence must meet threshold in Global Rules → Processing Rules

Mark Important

Type: Checkbox (boolean)

Purpose: Apply Gmail "Important" flag to emails in this category

Backend Use: Gmail API call to star/flag email

Use Case: Ensure high-priority categories stand out in Gmail

Auto-Archive

Type: Checkbox (boolean)

Purpose: Automatically archive emails after labeling (remove from inbox)

Backend Use: Gmail API call to remove INBOX label

Use Case: Keep inbox clean by auto-archiving newsletters, receipts, notifications

Webhook URL

Type: Text (URL)

Purpose: HTTP endpoint to receive notification when email is classified into this category

Format: Must be valid HTTPS URL

Payload: JSON with email metadata, category, confidence score

Backend Use: webhook_service.py sends POST request

Forward To

Type: Email address

Purpose: Automatically forward emails in this category to specified email address

Status: ⚠️ Future feature (not yet deployed)

Planned Use: Forward specific categories to team members or external systems

Action Execution Scope Check Global Rules → Processing Rules → "Apply actions to all classifications" to control whether actions run for all categories in multi-classification scenarios or only the primary category.

Tab 4: Relationships

Define how categories interact with each other in multi-classification scenarios.

Required With

Type: Multi-select dropdown

Purpose: Categories that must be applied together with this category

Example: "Action Required" might be required with "Client Communications"

Backend Use: Enforced during classification in ai_classifier.py

Conflicts With

Type: Multi-select dropdown

Purpose: Categories that cannot be applied simultaneously with this category

Example: "Spam" conflicts with "Important" and "Client Communications"

Backend Use: Higher-confidence category wins; conflicting lower-confidence category is skipped

Using Relationships Effectively Relationships help maintain logical consistency. Use "Conflicts With" to prevent contradictory classifications (e.g., "Personal" and "Work"). Use "Required With" to ensure related categories are applied together (e.g., "Urgent" with "Action Required").

Tab 5: Advanced

Performance Metrics (Read-Only)

Displayed Data:

  • Total emails classified into this category
  • Average confidence score for this category
  • Last 7 days activity trend

Data Source: Aggregated from analytics integration with daily summaries

Use Case: Monitor category performance to identify underperforming or overused categories

Multi-Category Classification

Multi-category classification allows the AI to apply multiple categories to a single email when appropriate. This feature is enabled in Global Rules → Multi-Classification Rules.

How It Works

  1. AI evaluates email against all enabled categories
  2. Returns confidence score for each category
  3. Applies all categories that meet confidence thresholds (up to max configured in Global Rules)
  4. Checks for category conflicts and resolves by keeping higher-confidence category
  5. Enforces "Required With" relationships
  6. Creates all applicable Gmail labels

Configuration Requirements

Example Scenario

Email: "Hi team, here's the Q4 financial report for our client project. Please review by Friday as it's urgent."

Classifications Applied:
  1. Client Communications (95% confidence) - Mentions client project
  2. Financial (92% confidence) - Financial report attached
  3. Action Required (88% confidence) - Review requested with deadline
Gmail Labels Created: All three labels applied to email

Best Practices

Best Practices

Category Design Principles

1. Start with 8-12 Categories

Most users achieve optimal results with 8-12 categories. This provides sufficient organization granularity without overwhelming the AI or creating overlapping definitions.

2. Make Categories Mutually Exclusive (Unless Multi-Classifying)

Design categories so emails clearly belong to one primary category. Use multi-classification sparingly for special cases (e.g., "Urgent" as a secondary modifier category).

3. Write Detailed Descriptions

The AI reads your category descriptions. More specific descriptions lead to higher confidence scores:

4. Use Descriptive Keywords

Include 5-15 relevant keywords per category. Focus on terms commonly found in emails for that category:

Color Scheme Strategy

Use consistent color schemes to make Gmail labels intuitive:

Color Suggested Use Example Categories
Red Urgent/Important Action Required, Urgent, Alerts
Yellow/Orange Needs Attention Client Communications, Follow-Up
Blue Informational Newsletters, Updates, FYI
Green Personal/Positive Personal, Confirmations, Receipts
Purple Administrative HR, Financial, Legal
Gray Low Priority Spam, Automated, Notifications

Confidence Threshold Guidelines

Automated Actions Strategy

When to Use Auto-Archive:

When to Mark Important:

When to Use Auto-Draft:

Maintenance & Optimization

  1. Review Monthly: Check category performance in Advanced tab
  2. Merge Underused Categories: If a category has <5% of total emails, consider consolidating
  3. Split Overused Categories: If a category has >30% of emails, it may be too broad
  4. Adjust Thresholds Based on Confidence: If average confidence is consistently high (>95%), you can lower thresholds slightly
  5. Test Changes Gradually: Modify one category at a time and monitor impact for a few days

FAQs & Troubleshooting

Q: How many categories should I create?

A: Start with 8-12 categories for most use cases. Fewer than 5 provides insufficient organization; more than 15 can lead to overlapping definitions and lower confidence scores. Use the system defaults as a starting point, then customize based on your specific email patterns.

Q: What happens if I edit a category after emails have been classified?

A: Changes apply only to new emails processed after saving. Existing labeled emails are not retroactively reclassified. Gmail labels remain on old emails unless you manually remove them in Gmail.

Q: Can I use the same Gmail label name for multiple categories?

A: No, each category must have a unique Gmail label name. If you try to use a duplicate name, the system will automatically append a number (e.g., "Work (2)"). Use the "Gmail Label Name" field to customize label names while keeping category names distinct.

Q: Why is my category not being applied to emails?

A: Check the following:

  1. Category is enabled (toggle is green)
  2. Confidence threshold is not too high (try lowering to 70-75% temporarily)
  3. Category description is specific and clear
  4. Category doesn't conflict with higher-confidence categories being applied
  5. Email actually matches category criteria (test with an obvious example)
  6. System is enabled in Settings page

Q: How do confidence thresholds work with multi-classification?

A: Each category is evaluated independently. If an email scores 85% for "Client Communications", 78% for "Financial", and 90% for "Action Required", all three categories will be applied IF their individual confidence thresholds are met and max classifications setting allows it (configured in Global Rules).

Q: What's the difference between "Required With" and just enabling multi-classification?

A: Multi-classification allows categories to be applied together if they meet thresholds. "Required With" FORCES categories to be applied together even if one doesn't meet its threshold. For example, if "Urgent" is required with "Action Required", applying "Action Required" will also apply "Urgent" automatically.

Q: Can I import/export category configurations?

A: Currently, categories are stored in Firestore at tenant_users/{tenant_id}_{user_email}/config/categories. You can access them via the API, but there's no built-in import/export UI feature yet. Contact support if you need to bulk configure categories across multiple users.

Q: How do I test if my category configuration is working?

A: Send yourself a test email that clearly matches the category criteria. Check Gmail within 30-60 seconds to see if the label appears. Review the Overview Dashboard to confirm the classification was recorded. If using Telegram notifications, you'll receive an instant notification when the email is classified.

Q: What happens if two categories have "Conflicts With" each other?

A: The AI applies the category with the higher confidence score and skips the conflicting category. For example, if "Work" scores 88% and "Personal" scores 82%, and they conflict, only "Work" is applied. This prevents contradictory classifications.

Q: Can I use emoji in category names?

A: Yes, emoji are supported in category names and will appear in Gmail labels. Some users prefix categories with emoji for visual distinction (e.g., "⚡ Urgent", "📧 Newsletters", "💼 Work"). However, ensure emoji render correctly in your Gmail interface.

Q: Why aren't my auto-draft replies being created?

A: Auto-draft requires:

  1. Category has "Auto-Draft Reply" enabled
  2. Email meets confidence threshold (check Global Rules → Processing Rules → "Min confidence for auto-draft")
  3. Gmail OAuth permissions include "Send Email" scope
  4. Email is not from a no-reply address
Check Global Rules → Processing Rules for additional auto-draft configuration options.

Q: How do keywords affect classification?

A: Keywords are hints sent to the AI but are not strict filters. The AI considers keywords along with the full email content, sender, subject, and category description. Think of keywords as helping the AI understand what terms are relevant to this category, not as required match criteria.

Need More Help?
Back to Top