@upgpt/email-classifier
The email classification primitive for TypeScript. Zero-config, pluggable AI providers, self-learning rules. Extracted from UpInbox.
Working in 5 Lines
import { classify } from '@upgpt/email-classifier';
const result = await classify({
subject: 'Your invoice #1234 is ready',
from: 'billing@acme.com',
body: 'Please find attached your invoice...',
});
console.log(result.category); // "receipt"
console.log(result.confidence); // 0.94Why Developers Use It
Zero-Config First Run
npm install, paste the example, run. Working email classification in under 60 seconds. No API keys required for the heuristic engine.
Pluggable AI Providers
Use Anthropic, OpenAI, Google, or bring your own. Switch providers with one line. Falls back to heuristic classification if no AI key is configured.
Self-Learning Rules
The classifier learns from corrections. Reclassify an email once and it remembers the pattern. Rules persist across sessions.
Full Type Safety
Written in TypeScript with complete type inference. Your IDE autocompletes categories, rules, and provider configs.
Privacy-First
Runs entirely in your application. No data leaves your environment unless you explicitly configure an AI provider. Perfect for compliance-sensitive use cases.
Dual License
Free with attribution ("Powered by UpGPT.ai" link) or commercial license for white-label use. Transparent, no gotchas.
Built For
- CRM tools — route inbound email to the right team
- Support ticket systems — auto-categorize and prioritize
- Inbox management — separate signal from noise
- Email analytics — classify at scale for reporting
- Compliance filtering — flag sensitive content automatically
Licensing
Attribution License (Free)
Use in any project. Include a “Powered by UpGPT.ai” link in your user-facing product. That's it.
UpGPT Attribution License (UAL-1.0)
Commercial License
Remove the attribution requirement. White-label use. Priority support and early access to new features.
Contact us for pricing →@upgpt/email-classifier is extracted from UpInbox, our AI email management product. It's part of the UpGPT platform.