-
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