Add README documentation
Documents service purpose, endpoints, cron format, and configuration. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
27d0dce910
commit
6499e17390
1 changed files with 56 additions and 0 deletions
56
README.md
Normal file
56
README.md
Normal file
|
|
@ -0,0 +1,56 @@
|
||||||
|
# Schedule Service
|
||||||
|
|
||||||
|
Task scheduler for Egregore.
|
||||||
|
|
||||||
|
## Purpose
|
||||||
|
|
||||||
|
Cron-like scheduler that triggers AI tasks on a schedule. Wakes the reason service at configured times to perform automated work.
|
||||||
|
|
||||||
|
## Endpoints
|
||||||
|
|
||||||
|
| Endpoint | Method | Description |
|
||||||
|
|----------|--------|-------------|
|
||||||
|
| `/schedules` | GET/POST | List or create schedules |
|
||||||
|
| `/schedules/{id}` | GET/PATCH/DELETE | Manage a schedule |
|
||||||
|
| `/schedules/{id}/run` | POST | Manually trigger a schedule |
|
||||||
|
| `/schedules/{id}/history` | GET | View execution history |
|
||||||
|
| `/health` | GET | Health check |
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
Schedules stored in `~/data/schedules/`.
|
||||||
|
|
||||||
|
Each schedule has:
|
||||||
|
- `name` - Descriptive name
|
||||||
|
- `cron` - Cron expression (e.g., `0 9 * * *`)
|
||||||
|
- `instruction` - What to tell the reason service
|
||||||
|
- `enabled` - Active flag
|
||||||
|
|
||||||
|
## Running
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Activate venv
|
||||||
|
source ~/.venv/bin/activate
|
||||||
|
|
||||||
|
# Run directly
|
||||||
|
python main.py
|
||||||
|
|
||||||
|
# Or via systemd
|
||||||
|
sudo systemctl start schedule
|
||||||
|
sudo systemctl status schedule
|
||||||
|
```
|
||||||
|
|
||||||
|
## Cron Format
|
||||||
|
|
||||||
|
Standard 5-field cron: `minute hour day month weekday`
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
- `0 9 * * *` - Daily at 9am
|
||||||
|
- `*/15 * * * *` - Every 15 minutes
|
||||||
|
- `0 0 * * 0` - Weekly on Sunday midnight
|
||||||
|
|
||||||
|
## Dependencies
|
||||||
|
|
||||||
|
- FastAPI
|
||||||
|
- APScheduler (cron scheduling)
|
||||||
|
- httpx (to call reason service)
|
||||||
Loading…
Add table
Add a link
Reference in a new issue