While energy is conserved during conversion processes, measuring it without accounting for its quality can be misleading. The primary objective of a thermal energy storage system is not merely to store energy but to preserve useful work. In this study, comprehensively both first law (energy) and second law (exergy) analyses are performed for the proposed shell-in-tube latent heat thermal energy storage (LHTES) unit with a graphite matrix composite and phase change material. The researchers go beyond the current literature and provide valuable contribution to the limited thermodynamic analysis studies of paraffin/graphite matrix composite storage media by performing both energy analysis and exergy analysis. The evaluation is conducted for both charging and discharging periods, separately and in cycles for solar energy and waste heat recovery applications. The effect of operating parameters including bulk density (23, 50, 100, and 143 kg/m3), heat transfer fluid inlet velocity (0.1, 0.15, 0.2, 0.3, and 0.5 m/s that refer to the turbulent flow with a Re number in the range of 4700 to 41,000), HTF inlet temperature (charge: 75 degrees C and 85 degrees C, discharge: 25 degrees C) and thermal energy storage medium initial temperature (charge: 25 degrees C, discharge: 75 degrees C and 85 degrees C) are investigated. The study results in HTF inlet velocity is a crucial parameter, especially on the charging exergy efficiencies. The charging process achieved the highest exergy efficiency (77 %) at 0.1 m/s HTF inlet velocity, while the discharging process reached the highest efficiency value (97.3 %) at 0.5 m/s HTF inlet velocity. It is concluded that energy analysis is not a suitable performance measurement for the ideal case, but exergy analysis can provide information about the ideal thermodynamic performance. Increasing the bulk density improves thermal energy storage (charging) exergy efficiency by up to 2 times and heat release (discharging) exergy efficiency from the storage medium by up to 6.5 times. However, the performance evaluation based on exergy analysis for the cycle is more reasonable/appropriate than considering charge and discharge processes separately, since it may lead to erroneous results. It is observed that the higher bulk density values lead to a significant increase in the overall exergy efficiency from 80.2 % (for 23 kg/m3) to 92.2 % (143 kg/m3). However, it is concluded that increasing the bulk density beyond 100 kg/m3 only results in a 1.3 % change in exergy efficiency, depending on the thermophysical properties. In addition, in thermal energy storage applications, the need for high temperatures for charging process and low temperatures for discharging process decrease overall exergy efficiency due to increased irreversibilities caused by temperature gradients.