You had a P0171, so I'd start with that. I know the light isn't on now, but you can have a lean condition that's enough to cause symptoms, but not enough to turn the CEL on.
A vacuum leak would cause a low idle for sure. If you have access to a scan tool that shows live data, you can check the fuel trims at idle- anything over 10% can cause symptoms. The code doesn't usually set until 18%-20% or so.