IDparts makes a hose kit for A4 cars
https://www.idparts.com/vacuum-hose-kit-a4-alh-p-5660.html
How old is the battery? More than 5 years? Get a new one...designed for the TDI's requirements!
But also, make sure that it is getting charged properly by the alternator.
If you are losing power a possibility is a deteriorated turbo actuator, bad MAF sensor, faulty vacuum supply, etc...
If it goes into limp mode there should be a fault code in the ECU to help pinpoint the trouble.
Rattle? need more info on that
Engine rattle, brake rattle, suspension rattle?
Does it stop just as the car is stopped?
A car of that age and mileage needs to be gone over for vitality of it's systems.
Get with someone that has VCDS diagnostic capabilities. They may be able to zero in on what is ailing the car.
Check the TDI trusted mechanics list or at least the "has VCDS" list in the TDI 101 section in these forums.