-
Notifications
You must be signed in to change notification settings - Fork 0
CLI Demo
The PATAS CLI Demo is a standalone Python package that demonstrates the basic concept of PATAS: logs → patterns → rules. It is designed for developers who want to understand how PATAS works without setting up the full system.
- ✅ Simple pattern detection (grouping by domains, phone numbers)
- ✅ Basic rule generation (SQL-like examples)
- ✅ Interactive CLI interface
- ✅ Bundled demo data
- ❌ Advanced pattern mining algorithms
- ❌ Rule lifecycle management (candidate → shadow → active → deprecated)
- ❌ SQL safety checks and validation
- ❌ Semantic analysis and embeddings
- ❌ Production-grade evaluation metrics
- ❌ Real-time processing
- ❌ Integration with external systems
This is NOT the real PATAS Core. Do NOT use in production.
- Go to Releases
- Download
patas_demo_cli-0.1.0-py3-none-any.whlfrom the latest release - Install:
pip install patas_demo_cli-0.1.0-py3-none-any.whl
pip install git+https://github.com/KikuAI-Lab/PATAS.git#subdirectory=apps/demo-clicd apps/demo-cli
pip install -e .patas-demo demoThis command prints:
- Description of what the demo does
- Location of demo data
- Available commands
Analyze the bundled demo data:
patas-demo analyzeAnalyze your own JSON file:
patas-demo analyze --input path/to/messages.jsonExport rules as SQL:
patas-demo analyze --export-sqlThe demo expects a JSON file with an array of message objects:
[
{
"id": "msg_1",
"text": "Buy now! Visit http://spam.com",
"is_spam": true,
"timestamp": "2025-01-15T10:00:00Z"
},
{
"id": "msg_2",
"text": "Hello, how are you?",
"is_spam": false,
"timestamp": "2025-01-15T10:05:00Z"
}
]============================================================
PATAS Demo - Pattern Analysis
============================================================
Loaded 15 messages
- Spam: 9
- Ham: 6
Discovering patterns...
Found 3 patterns
============================================================
Discovered Patterns
============================================================
Pattern 1: pattern_1
Type: domain
Description: Messages containing domain: spam-shop.com
Messages matched: 4
Example messages:
- Buy now! Visit http://spam-shop.com for amazing deals!
- Check out http://spam-shop.com - limited time offer!
The demo uses very basic pattern detection:
- Domain Extraction: Finds URLs in messages and groups by domain
- Phone Number Extraction: Finds phone numbers and groups by number
- Simple Grouping: Messages with the same domain/phone are grouped together
- Rule Generation: Creates simple SQL-like rules for each pattern
This is NOT how the real PATAS Core works. The real PATAS uses:
- Advanced semantic pattern mining
- Rule lifecycle with shadow evaluation
- SQL safety validation
- Production-grade metrics
| Feature | CLI Demo | Real PATAS Core |
|---|---|---|
| Pattern Detection | Simple regex grouping | Advanced semantic mining |
| Rule Generation | Basic SQL templates | Validated SQL with safety checks |
| Rule Lifecycle | None | candidate → shadow → active → deprecated |
| Evaluation | None | Precision, recall, coverage, ham rate |
| SQL Safety | None | Full validation and sanitization |
| Semantic Analysis | None | Embeddings and similarity clustering |
| Production Ready | ❌ No | ✅ Yes |
-
This is a toy implementation - it uses simple regex-based grouping, not real pattern mining.
-
Do NOT use in production - this demo is for educational purposes only.
-
The real PATAS Core includes:
- Advanced semantic pattern mining
- Rule lifecycle with shadow evaluation
- SQL safety validation
- Production-grade metrics and monitoring
- Integration capabilities
-
For production use, see:
- API Quickstart - Integrate via REST API
- API Reference Full - Complete API documentation
- Integration Guide - Production integration patterns
- Demo Package: apps/demo-cli/
- Releases: GitHub Releases
- Source Code: patas_demo_cli/
After trying the CLI demo:
- Explore the API: See API Quickstart for real PATAS integration
- Understand Architecture: Read Architecture Full to see how real PATAS works
- Production Integration: Follow Integration Guide for real deployments
Remember: The CLI demo is just a simplified illustration. For real spam detection, use the full PATAS Core via API.