We present a framework for improving adaptability of Learning from Demonstration (LfD) strategy by combining the LfD and Sequential Quadratic Programming (SQP). The advantage of the LfD method is that it can find a motion planning solution that is suitable to a task in a short time. Although the method successfully generates a motion when a query point is similar to learned trajectories, it has a limitation when additional constraints such as an obstacle avoidance constraint and a short distance constraint are added. In the suggested framework, a trajectory generated from an LfD is modified with SQP by minimizing a cost function that considers constraints. Thus the final trajectory is suitable for a task and adapted for constraints. The effectiveness of the method is shown with a target reaching task with an arm-type manipulator in three-dimensional space.