# Structure of ReplanningFlow ``` goal (info on the old plan), plan (old plan), plan_file_location | v +---------------+ | Controller | --------<<<<-----------+ +---------------+ | | | | (command, command args) | | | v | +------------------+ | | Executor | Each branch is an | | (Tree Structure) | executor | +------------------+ | | ^ | (summary) | | | v | | | +-> goes back to the Controller>-+ ``` Structure of the Executors: ``` +-------------------+ | Branching | | Executor | +-------------------+ / \ / \ / \ / \ write_plan ask_user ``` About the branches: - [ask_user](https://huggingface.co/aiflows/PlanWriterFlowModule/blob/main/PlanWriterAskUserFlow.py): Ask user for info / confirmation, etc. - [write_plan](https://huggingface.co/aiflows/InteractivePlanGenFlowModule): Generates plan (user edit is allowed) and fetches user feedback. - The PlanGenerator of write_plan is replaced with [NewPlanGenFlow](https://huggingface.co/aiflows/ReplanningFlowModule/blob/main/NewPlanGenFlow.py) to re-plan instead of write plan. How it works: Controller calls write_plan until user is satisfied in the feedback, finish.