Dear Roopa,
In these days of COVID-19 pandemic, job security has reduced. There are concerns about the removal of employment. Against this backdrop, why your company is facing a challenge of the retention of the employees? You wish to go to the extent of making the employees sign an agreement that forces them to stay in your company for a few years. Will this "forced stay" maintain the motivation level of the employees or even their productivity?
If the employee attrition is a challenge then have you studied the causes of the attrition? What is the outcome of your study?
Please give us a little more information on your challenge. Solutions cannot be offered with lesser information.
Thanks,
Dinesh Divekar