Email Classification

With the release of Slack Connect, people can now collaborate both with internal employees and external organizations in the same channel. To make this as smooth as possible, Slack does predictive email analysis to classify and recommend the best way for a user to work with people they want to collaborate with. To accomplish this,…

Sarah Henkens
13 min readadvanced
--
View Original

Overview

The article discusses the development of an email classification system at Slack, designed to predict whether an email address belongs to an internal employee or an external collaborator. It details the architecture, algorithms, and data models used to ensure accurate and efficient classification in the context of Slack Connect invites.

What You'll Learn

1

How to design an eventually-consistent data model for email classification

2

Why using context-based thresholds improves email classification accuracy

3

How to implement real-time data updates using mutation jobs

Prerequisites & Requirements

  • Understanding of data modeling and classification algorithms
  • Familiarity with asynchronous job queues and database operations(optional)

Key Questions Answered

How does the email classification engine determine if an email is internal or external?
The email classification engine uses multiple contexts, such as Settings Context, Inviter Context, and Team Context, to classify email addresses. It processes unique email domains and applies thresholds based on the number of users associated with each domain to make accurate predictions.
What is the significance of an eventually-consistent architecture in email classification?
An eventually-consistent architecture allows Slack to provide real-time domain knowledge while minimizing computational costs. It ensures that the email classification system remains responsive and accurate despite the dynamic nature of user data and organizational changes.
What challenges does data drift pose in the email classification system?
Data drift can lead to inaccuracies in the classification system due to asynchronous job executions that may not reflect the current state of user counts. This necessitates a self-healing mechanism to recalibrate counts and maintain accuracy over time.
How does the classification engine handle real-time updates when users join or leave a workspace?
When users join or leave a workspace, a mutation job is enqueued to update the total count of users for each domain. This process ensures that the classification engine has the most current data for making predictions.

Key Statistics & Figures

Threshold for internal domain classification
10%
A domain must have at least 10% of users in the organization to be classified as internal.
Team size
Over a million users
Slack teams can grow significantly, necessitating efficient data handling strategies.

Technologies & Tools

Some links below are affiliate links. We may earn a commission if you make a purchase.

Key Actionable Insights

1
Implement a classification engine that leverages multiple contexts to improve prediction accuracy.
Using various contexts allows for more nuanced decisions about email classification, which can enhance user experience in collaborative platforms.
2
Design a self-healing mechanism to address data drift in your systems.
This approach ensures that your data remains accurate over time, particularly in environments with high user turnover or frequent changes.
3
Utilize real-time mutation jobs to keep your data models updated.
This practice is critical in maintaining the accuracy of classification systems, especially when user data is dynamic.

Common Pitfalls

1
Failing to account for data drift can lead to inaccurate classifications.
This occurs when asynchronous job executions result in counts that do not reflect the current state, necessitating a robust healing mechanism to correct discrepancies.

Related Concepts

Data Modeling
Classification Algorithms
Asynchronous Job Processing