# CultGuard Agents - Autonomous Monitoring Quick Reference

## 🚀 Quick Commands

### Interactive Mode (via pi)
```bash
devenv shell
pi

# Start monitoring
/start_monitoring --investigation <id> --page <url> --interval 30

# Check status
/monitoring-status

# Check new content
/check_new_content --investigation <id> --since_minutes 60

# Analyze content
/analyze_content --content_ids ["id1", "id2"] --type risk --llm

# Generate report
/generate_report --investigation <id> --time_range_hours 24

# Configure alerts
/configure_alerts --post_spike_threshold 15
```

### Autonomous Agents

```bash
# Facebook Monitor (continuous)
agent-monitor \
  --investigation <id> \
  --page <url> \
  --interval 30

# Content Analyzer (one-shot)
agent-analyzer \
  --investigation <id> \
  --batch-size 50 \
  --llm

# Alert System (continuous)
agent-alert \
  --investigation <id> \
  --channel email \
  --email user@example.com

# Evidence Collector (continuous)
agent-collector \
  --investigation <id> \
  --auto \
  --interval 10
```

### Quick Start Script
```bash
./quick-start.sh <investigation_id> <facebook_url>
```

## 📊 Risk Scoring

| Score | Level | Action |
|-------|-------|--------|
| 0-14 | Low | Monitor |
| 15-29 | Medium | Review |
| 30+ | High | Alert |

## 🎯 Alert Thresholds (Defaults)

- Post spike: >10 posts in interval
- Reaction spike: >1000 engagements
- Suspicious keywords: election, vote, protest, breaking, urgent
- New entities: >5 in 60 minutes

## 📁 File Locations

- Extension: `.pi/extensions/cultguard-monitor.ts`
- Agents: `src/agents/*.ts`
- Logs: `logs/`
- Reports: `reports/`
- Media: `media/auto/<investigation>/`

## 🔧 Troubleshooting

```bash
# Check if extension loaded
pi  # Look for "CultGuard Monitoring Extension loaded"

# Check database
db-stats
search --sql "SELECT COUNT(*) FROM investigations"

# View agent logs
tail -f logs/monitor-<id>.log

# Reset monitoring state
pi "/monitoring-reset"

# Restart failed agent
kill <pid>
agent-monitor -i <id> -p <url>
```

## 📚 Full Documentation

- **Architecture & Setup:** `AGENTS.md`
- **Implementation Details:** `IMPLEMENTATION_SUMMARY.md`
- **Database Schema:** `data/schema.sql`
- **Main README:** `README.md`
