Terahertz communication networks and Intelligent Reflecting Surfaces (IRS) exhibit significant potential in advancing Sixth-Generation (6G) wireless networks, these technologies enable support of ultra-data transmission and exploding network capacity. Motivated by the above facts, this paper considers the flying IRS assisted Unmanned Aerial Vehicles (UAV) in THz communication network. To that aim, we proposed algorithm named a (Fly-IRS) aided-THz communication network by jointly optimizing the optimal user Grouping and the IRS phase shifting, optimal UAV's location optimization are being explored to achieve the system data rate maximization, enhancing the system capacity, and minimizing the Outage Probability (OP) to provide a better satisfied user ratio. The formulated problem is decomposed into two subproblems, an iterative algorithm based on modified K-means clustering algorithm is proposed to solve the first sub-problem: the optimizing user Grouping, while Deep Deterministic Policy Gradient (DDPG) optimizes the IRS phase shift and optimal UAV's location optimization. Finally, simulation results demonstrate that the proposed algorithm can maximize the system's data rate by up to 95% and improves the capacity of the system on average by 94% compared to benchmark algorithms.