A compact device for exhaust gas management in an EGR system suitable for being directly coupled on a PF/DPF filter where this filter extends along a longitudinal direction X-X' the end of which has an opening; and where the device comprises: - a coupling base with a seating (1.5) suitable for being coupled to the filter covering its opening, - an exhaust conduit extending according to a longitudinal direction Y-Y', - a heat exchanger comprising at least a first coolant fluid connection (2.1) and a second coolant fluid connection (2.2) both for the circulation of the coolant liquid; and where the exchanger extends along a longitudinal direction Z-Z' between an inlet (2.3) for the gas to be cooled and an outlet (2.4) for the cooled gas, - an intermediate chamber comprising: o a gas inlet (5.3) in fluidic connection with the outlet (2.4) of the heat exchanger, o a first outlet (5.1) connected to the EGR conduit to provide cooled exhaust gases towards the EGR valve of the EGR system, o a second outlet (5.2) connected to the exhaust conduit, where - the coupling base has a first connection (1.2) of the coupling base in fluidic connection with the inlet (2.3) of the heat exchanger, - the longitudinal direction Z-Z' of the heat exchanger is misaligned with respect to the longitudinal direction X-X' of the filter, - the coupling base has a second connection (1.3) of the coupling base arranged in opposition with respect to the first connection (1.2) of the coupling base according to the longitudinal axis X-X' of the filter, this second connection (1.3) of the coupling base being in fluidic connection with the exhaust conduit, where the longitudinal direction Y-Y' of said exhaust conduit is essentially parallel to the longitudinal direction of the heat exchanger and misaligned with respect to the longitudinal direction X-X' of the filter, - the second outlet (5.2) of the intermediate chamber in fluidic connection with the exhaust conduit is located on the side of the exhaust conduit; and, - the device comprises a valve suitable for having at least two end positions, a first end position for closing the fluidic connection between the intermediate chamber and the exhaust conduit leaving the passage through the exhaust conduit free; and a second end position for closing the exhaust conduit leaving the fluidic connection between the intermediate chamber and the exhaust conduit free. - a coupling base with a seating (1.5) suitable for being coupled to the filter covering its opening, - an exhaust conduit extending according to a longitudinal direction Y-Y', - a heat exchanger comprising at least a first coolant fluid connection (2.1) and a second coolant fluid connection (2.2) both for the circulation of the coolant liquid; and where the exchanger extends along a longitudinal direction Z-Z' between an inlet (2.3) for the gas to be cooled and an outlet (2.4) for the cooled gas, - an intermediate chamber comprising: o a gas inlet (5.3) in fluidic connection with the outlet (2.4) of the heat exchanger, o a first outlet (5.1) connected to the EGR conduit to provide cooled exhaust gases towards the EGR valve of the EGR system, o a second outlet (5.2) connected to the exhaust conduit, o a gas inlet (5.3) in fluidic connection with the outlet (2.4) of the heat exchanger, o a first outlet (5.1) connected to the EGR conduit to provide cooled exhaust gases towards the EGR valve of the EGR system, o a second outlet (5.2) connected to the exhaust conduit, - the coupling base has a first connection (1.2) of the coupling base in fluidic connection with the inlet (2.3) of the heat exchanger, - the longitudinal direction Z-Z' of the heat exchanger is misaligned with respect to the longitudinal direction X-X' of the filter, - the coupling base has a second connection (1.3) of the coupling base arranged in opposition with respect to the first connection (1.2) of the coupling base according to the longitudinal axis X-X' of the filter, this second connection (1.3) of the coupling base being in fluidic connection with the exhaust conduit, where the longitudinal direction Y-Y' of said exhaust conduit is essentially parallel to the longitudinal direction of the heat exchanger and misaligned with respect to the longitudinal direction X-X' of the filter, - the second outlet (5.2) of the intermediate chamber in fluidic connection with the exhaust conduit is located on the side of the exhaust conduit; and, - the device comprises a valve suitable for having at least two end positions, a first end position for closing the fluidic connection between the intermediate chamber and the exhaust conduit leaving the passage through the exhaust conduit free; and a second end position for closing the exhaust conduit leaving the fluidic connection between the intermediate chamber and the exhaust conduit free.