P0171 & P0174?
Engine running lean means exactly that, it's not getting enough fuel or it's getting too much air. This is being reported to the PCM by the O2 sensors.
Usually you're looking for an air leak after the MAF sensor, possibly the intake manifold. How long have you had the CAI on there? Also, make sure any vacuum lines from the intake are connected and in good shape.
A malfunctioning fuel pressure regulator or weak fuel pump can give you weak fuel pressure.
It's also possible that the O2 sensors are bad. Don't run out and buy them, it's not the likey cause.
Start with the free stuff, check the clamps on the CAI and all the vacuum hoses on the intake. Check fuel pressure. Check for intake leak by spraying propane or starting fluid around the intake especially between the intake and the heads. If there's a leak you will hear a slight bump in the rpm's.