-
Notifications
You must be signed in to change notification settings - Fork 0
Quick Start
This guide will help you get PATAS up and running quickly.
- Python 3.10 or higher
- SQLite (included) or PostgreSQL
- Optional: OpenAI API key for semantic pattern mining
# Clone repository
git clone https://github.com/KikuAI-Lab/PATAS.git
cd PATAS
# Install dependencies
poetry install
# Activate virtual environment
poetry shell# Clone repository
git clone https://github.com/KikuAI-Lab/PATAS.git
cd PATAS
# Install dependencies
pip install -e .- Copy the example environment file:
cp .env.example .env- Edit
.envwith your settings:
# Database (SQLite by default)
DATABASE_URL=sqlite:///./data/patas.db
# Safety Profile
AGGRESSIVENESS_PROFILE=conservative
# LLM (optional, for semantic pattern mining)
LLM_PROVIDER=openai
OPENAI_API_KEY=your-key-hereSee Configuration for complete configuration options.
Load messages from logs or CSV:
# From your platform logs (example)
patas ingest-logs --source=your platform --since-days=7
# From CSV file
patas ingest-logs --source=csv --input=spam_logs.csvRun pattern mining to discover spam patterns:
patas mine-patternsThis will:
- Analyze ingested messages
- Discover recurring patterns
- Generate candidate rules
- Store patterns and rules in database
Evaluate rules in shadow mode (safe, non-production):
patas eval-rulesThis evaluates all shadow rules against historical data and computes metrics.
Promote good rules to active status:
patas promote-rulesThis promotes rules that meet safety thresholds based on your aggressiveness profile.
patas-tg poc --input=examples/sample_your platform_logs.jsonl --out=./reportThis will:
- Load your platform log format
- Run pattern mining
- Evaluate rules
- Generate a report in the output directory
See [Engineering Notes for integration](Engineering-Notes-for-your platform) for detailed integration guide.
Start the API server:
# Using Poetry
poetry run patas-api
# Or directly
patas-api
# Or with uvicorn
uvicorn app.api.main:app --host 0.0.0.0 --port 8000The API will be available at http://localhost:8000.
See API Quickstart for API usage examples.
Before deploying to production, always run safety evaluation:
patas safety-evalThis validates all profiles against safety thresholds. Do not deploy if this command fails.
- Read Architecture to understand system design
- Review Configuration for advanced settings
- See [your platform Safety Guide](your platform-Safety-Guide) for production deployment
- Check API Reference for API integration
See Configuration and Deployment for common issues and solutions.