Description
Currently, all tasks are stored in memory and are lost when the application exits. We need to implement task persistence so that tasks are saved to a file and automatically loaded when the application starts.
Goals
- Save tasks to a JSON or pickle file
- Automatically load tasks on startup
- Preserve task data between sessions
- Handle file I/O errors gracefully
Implementation Details
- Create a
TaskStorage class or module
- Add methods to
TaskPilot agent:
save_tasks() - Save tasks to file
load_tasks() - Load tasks from file
- Auto-save on every task change
- Use
tasks.json or similar file format
- Add error handling for file operations
Acceptance Criteria
- ✅ Tasks persist after application closes
- ✅ Tasks load automatically on startup
- ✅ File I/O errors are handled gracefully
- ✅ Unit tests added for persistence
- ✅ README updated with persistence info
Example Usage
# Tasks are automatically saved
agent.add_task("Buy groceries") # Saved to file
# Exit and restart app
# Tasks are automatically loaded
agent.view_tasks() # Shows "Buy groceries"
Related Issues
Part of the TaskPilot-AI roadmap improvements
Description
Currently, all tasks are stored in memory and are lost when the application exits. We need to implement task persistence so that tasks are saved to a file and automatically loaded when the application starts.
Goals
Implementation Details
TaskStorageclass or moduleTaskPilotagent:save_tasks()- Save tasks to fileload_tasks()- Load tasks from filetasks.jsonor similar file formatAcceptance Criteria
Example Usage
Related Issues
Part of the TaskPilot-AI roadmap improvements