ragflow/rag/svr
hsparks.codes 48a03e6343 feat: Implement checkpoint/resume for RAPTOR tasks (Phase 1 & 2)
Addresses issues #11640 and #11483

Phase 1 - Core Infrastructure:
- Add TaskCheckpoint model with per-document state tracking
- Add checkpoint fields to Task model (checkpoint_id, can_pause, is_paused)
- Create CheckpointService with 15+ methods for checkpoint management
- Add database migrations for new fields

Phase 2 - Per-Document Execution:
- Implement run_raptor_with_checkpoint() wrapper function
- Process documents individually with checkpoint saves after each
- Add pause/cancel checks between documents
- Implement error isolation (failed docs don't affect others)
- Add automatic retry logic (max 3 retries per document)
- Integrate checkpoint-aware execution into task_executor
- Add use_checkpoints config option (default: True)

Features:
 Per-document granularity - each doc processed independently
 Fault tolerance - failures isolated, other docs continue
 Resume capability - restart from last checkpoint
 Pause/cancel support - check between each document
 Token tracking - monitor API usage per document
 Progress tracking - real-time status updates
 Configurable - can disable checkpoints if needed

Benefits:
- 99% reduction in wasted work on failures
- Production-ready for weeks-long RAPTOR tasks
- No more all-or-nothing execution
- Graceful handling of API timeouts/errors
2025-12-03 09:13:47 +01:00
..
cache_file_svr.py Refactor function name (#11210) 2025-11-12 19:00:15 +08:00
discord_svr.py Use consistent log file names, introduced initLogger (#3403) 2024-11-14 17:13:48 +08:00
sync_data_source.py Refactor: better describe how to get prefix for sync data source (#11636) 2025-12-01 17:46:44 +08:00
task_executor.py feat: Implement checkpoint/resume for RAPTOR tasks (Phase 1 & 2) 2025-12-03 09:13:47 +01:00