AbstractThis article proposes a novel dataâdriven framework of distributed optimal consensus for discreteâtime linear multiâagent systems under general digraphs. A fully distributed control protocol is proposed by using linear quadratic regulator approach, which is proved to be a sufficient and necessary condition for optimal control of multiâagent systems through dynamic programming and minimum principle. Moreover, the control protocol can be constructed by using local information with the aid of the solution of the algebraic Riccati equation (ARE). Based on the Qâlearning method, a reinforcement learning framework is presented to find the solution of the ARE in a dataâdriven way, in which we only need to collect information from an arbitrary follower to learn the feedback gain matrix. Thus, the multiâagent system can achieve distributed optimal consensus when system dynamics and global information are completely unavailable. For output feedback cases, accurate state information estimation is established such that optimal consensus control is realized. Moreover, the dataâdriven optimal consensus method designed in this article is applicable to general digraph that contains a directed spanning tree. Finally, numerical simulations verify the validity of the proposed optimal control protocols and dataâdriven framework.