1 Chronicles 29:18

O LORD God of Abraham, Isaac, and of Israel, our fathers, keep this for ever in the imagination of the thoughts of the heart of thy people, and prepare their heart unto thee:

David's prayer asks the Lord God of Abraham, Isaac, and Israel to keep forever in the imagination of the thoughts of the heart of His people the willing devotion they had shown, and to prepare and direct their hearts unto Himself. That devotion to be preserved was their wholehearted readiness to give offerings for the work of building the temple sanctuary, a free and joyful consecration to God's work. It was not to be a passing feeling that would fade, but a lasting disposition kept in them by God Himself.

This keeping of the heart means enduring commitment and faithfulness to God, held steady in the inner thoughts and affections. It is expressed in keeping and seeking all His commandments, with the heart prepared to remain true to Him.

Joined with the prayer for the people is the prayer for Solomon, that God would give him a perfect and prepared heart. That prepared heart is to keep God's commandments, His testimonies, and His statutes. It is also to carry out the building of the temple, fulfilling the great work entrusted to him.