1. Implement the caret for different mode.
2. Refactor the BaseAgent and its subclass.