I would just go to the dealership. They can pull up a parts blow-up and have you look right at what you need. Been there, done that.
But yeah, if your egr is working fine and you have vacuum leaks, then I would go that route first. P0401 is also common for the dpfe. You can also check the hoses from the egr pipe to the dpfe. I've seen those rot and clog. Napa sells a replacement set for about $6.