2.4 KiB
2.4 KiB
Turn-Based Curator
Extract gems every N turns instead of waiting for daily curation.
Files
| File | Purpose |
|---|---|
curator_turn_based.py |
Main script - checks turn count, extracts gems |
curator_cron.sh |
Cron wrapper to run every minute |
turn-curator.service |
Alternative systemd service (runs on-demand) |
Usage
Manual Run
# Check current status
python3 curator_turn_based.py --status
# Preview what would be curated
python3 curator_turn_based.py --threshold 10 --dry-run
# Execute curation
python3 curator_turn_based.py --threshold 10 --execute
Automatic (Cron)
Add to crontab:
* * * * * /root/.openclaw/workspace/.projects/true-recall-v2/tr-continuous/curator_cron.sh
Or use systemd timer:
sudo cp turn-curator.service /etc/systemd/system/
sudo systemctl enable turn-curator.timer # If you create a timer
Automatic (Integrated)
Alternative: Modify realtime_qdrant_watcher.py to trigger curation every 10 turns.
How It Works
- Tracks turn count - Stores last curation turn in
/tmp/curator_turn_state.json - Monitors delta - Compares current turn count vs last curation
- Triggers at threshold - When 10+ new turns exist, runs curation
- Extracts gems - Sends conversation to qwen3, gets gems
- Stores results - Saves gems to
gems_trcollection
State File
/tmp/curator_turn_state.json:
{
"last_turn": 150,
"last_curation": "2026-02-24T17:00:00Z"
}
Comparison with Daily Curator
| Feature | Daily Curator | Turn-Based Curator |
|---|---|---|
| Schedule | 2:45 AM daily | Every 10 turns (dynamic) |
| Time window | 24 hours | Variable (depends on chat frequency) |
| Trigger | Cron | Turn threshold |
| Use case | Nightly batch | Real-time-ish extraction |
| Overlap | Low | Possible with daily curator |
Recommendation
Use BOTH:
- Turn-based: Every 10 turns for active conversations
- Daily: 2:45 AM as backup/catch-all
They'll deduplicate automatically (same embeddings → skipped).
Testing
# Simulate 10 turns
for i in {1..10}; do
echo "Test message $i" > /dev/null
done
# Check status
python3 curator_turn_based.py --status
# Run manually
python3 curator_turn_based.py --threshold 10 --execute
Status
- ✅ Script created:
curator_turn_based.py - ✅ Cron wrapper:
curator_cron.sh - ⏳ Deployment: Optional (manual or cron)
- ⏳ Testing: Pending