-
Notifications
You must be signed in to change notification settings - Fork 0
Public Home
Automatically discovers spam patterns and creates blocking rules
PATAS is a system that automatically analyzes your messages, finds similar spam patterns, and creates blocking rules that can be immediately used in your system.
Before PATAS:
- ❌ Moderators manually review thousands of complaints
- ❌ Blocking rules are written manually and quickly become outdated
- ❌ New spam patterns emerge faster than they can be blocked
- ❌ No understanding of why messages are similar
With PATAS:
- ✅ Automatically groups similar spam messages
- ✅ Explains why messages are similar
- ✅ Creates ready-to-use SQL queries for blocking
- ✅ Works 24/7, never tires, never misses patterns
Want to quickly understand how PATAS works?
Try our educational CLI demo — a simplified version that demonstrates the basic concept:
# Install from GitHub Release
pip install patas_demo_cli-0.1.0-py3-none-any.whl
# Or from Git
pip install git+https://github.com/KikuAI-Lab/PATAS.git#subdirectory=apps/demo-cli
# Usage
patas-demo analyzeInteractive demo — drag and drop a file with messages and see pattern analysis:
👉 Run Demo
If you're a developer, integrate PATAS via the API:
# Send a batch of messages
curl -X POST https://api.patas.com/api/v1/analyze \
-H "Content-Type: application/json" \
-d '{
"messages": [
{"id": "1", "text": "Buy now! http://spam.com", "is_spam": true},
{"id": "2", "text": "Click here: http://spam.com", "is_spam": true}
],
"run_mining": true
}'Result:
{
"patterns": [
{
"group_size": 2,
"similarity_reason": "Messages contain the same suspicious URL: http://spam.com",
"sql_query": "SELECT id FROM reports WHERE message_content LIKE '%http://spam.com%'"
}
]
}- CLI Demo — Simplified CLI demo for learning
- API Reference — Complete documentation of all 9 endpoints
- API Quickstart — Quick start in 5 minutes
- Examples — Practical code examples (Python, cURL, JavaScript)
- Architecture — System architecture
- Integration Guide — Integration guide
- Configuration Guide — All settings
- Overview — System overview
- Use Cases — Use case scenarios
- Demo Guide — Full demo guide
- Troubleshooting — Troubleshooting
- Semantic Pattern Mining — Semantic mining
- SQL LLM Validation — LLM rule validation
- Pattern Quality Testing — Pattern quality
- Positioning — Product positioning
- Automatically identifies spam patterns from your data
- Supports multiple pattern types (URLs, keywords, signatures, semantic)
- Uses LLM for intelligent pattern recognition (optional)
- Candidate → Shadow → Active → Deprecated
- Shadow evaluation prevents false positives
- Automatic rollback for degrading rules
- Tracks precision, recall, coverage
- Monitors false positives
- Performance metrics for each rule
- RESTful API for integration
- Batch processing for large datasets
- Configurable aggressiveness profiles (conservative/balanced/aggressive)
PATAS provides 9 RESTful endpoints:
-
GET /api/v1/health— Health check -
POST /api/v1/messages/ingest— Message ingestion -
POST /api/v1/patterns/mine— Run pattern mining -
GET /api/v1/patterns— List patterns -
GET /api/v1/rules— List rules -
POST /api/v1/rules/eval-shadow— Evaluate shadow rules -
POST /api/v1/rules/promote— Promote/deprecate rules -
GET /api/v1/rules/export— Export active rules -
POST /api/v1/analyze⭐ — Batch analysis (main endpoint)
See API Reference for details.
PATAS provides 7 CLI commands:
-
patas ingest-logs— Ingest from external API or storage -
patas mine-patterns— Run pattern mining -
patas eval-rules— Evaluate shadow rules -
patas promote-rules— Promote and monitor rules -
patas safety-eval— Safety evaluation -
patas demo-telegram— Demo for Telegram engineers -
patas explain-rule— Explain a rule with examples
- SQL injection protection
- Whitelist for tables/columns
- Input data validation
- PII redaction
- Privacy modes (STANDARD/STRICT)
MIT License — see LICENSE
We welcome contributions! See CONTRIBUTING for details.
Version: 2.0.0
Status: Production Ready