Bg 15.15

sarvasya cāhaṁ hṛdi sanniviṣṭo
mattaḥ smṛtir jñānam apohanaṁ ca
vedaiś ca sarvair aham eva vedyo
vedānta-kṛd veda-vid eva cāham
Word for word: 
sarvasya — of all living beings; ca — and; aham — I; hṛdi — in the heart; sanniviṣṭaḥ — situated; mattaḥ — from Me; smṛtiḥ — remembrance; jñānam — knowledge; apohanam — forgetfulness; ca — and; vedaiḥ — by the Vedas; ca — also; sarvaiḥ — all; aham — I am; eva — certainly; vedyaḥ — knowable; vedānta-kṛt — the compiler of the Vedānta; veda-vit — the knower of the Vedas; eva — certainly; ca — and; aham — I.
Translation: 
I am seated in everyone’s heart, and from Me come remembrance, knowledge and forgetfulness. By all the Vedas, I am to be known. Indeed, I am the compiler of Vedānta, and I am the knower of the Vedas.
Purport: 

The Supreme Lord is situated as Paramātmā in everyone’s heart, and it is from Him that all activities are initiated. The living entity forgets everything of his past life, but he has to act according to the direction of the Supreme Lord, who is witness to all his work. Therefore he begins his work according to his past deeds. Required knowledge is supplied to him, and remembrance is given to him, and he forgets, also, about his past life. Thus, the Lord is not only all-pervading; He is also localized in every individual heart. He awards the different fruitive results. He is worshipable not only as the impersonal Brahman, the Supreme Personality of Godhead and the localized Paramātmā, but as the form of the incarnation of the Vedas as well. The Vedas give the right direction to people so that they can properly mold their lives and come back to Godhead, back to home. The Vedas offer knowledge of the Supreme Personality of Godhead, Kṛṣṇa, and Kṛṣṇa in His incarnation as Vyāsadeva is the compiler of the Vedānta-sūtra. The commentation on the Vedānta-sūtra by Vyāsadeva in the Śrīmad-Bhāgavatam gives the real understanding of Vedānta-sūtra. The Supreme Lord is so full that for the deliverance of the conditioned soul He is the supplier and digester of foodstuff, the witness of his activity, and the giver of knowledge in the form of the Vedas and as the Supreme Personality of Godhead, Śrī Kṛṣṇa, the teacher of the Bhagavad-gītā. He is worshipable by the conditioned soul. Thus God is all-good; God is all-merciful.

Antaḥ-praviṣṭaḥ śāstā janānām. The living entity forgets as soon as he quits his present body, but he begins his work again, initiated by the Supreme Lord. Although he forgets, the Lord gives him the intelligence to renew his work where he ended his last life. So not only does a living entity enjoy or suffer in this world according to the dictation from the Supreme Lord situated locally in the heart, but he receives the opportunity to understand the Vedas from Him. If one is serious about understanding the Vedic knowledge, then Kṛṣṇa gives the required intelligence. Why does He present the Vedic knowledge for understanding? Because a living entity individually needs to understand Kṛṣṇa. Vedic literature confirms this: yo ’sau sarvair vedair gīyate. In all Vedic literature, beginning from the four Vedas, Vedānta-sūtra and the Upaniṣads and Purāṇas, the glories of the Supreme Lord are celebrated. By performance of Vedic rituals, discussion of the Vedic philosophy and worship of the Lord in devotional service, He is attained. Therefore the purpose of the Vedas is to understand Kṛṣṇa. The Vedas give us direction by which to understand Kṛṣṇa and the process of realizing Him. The ultimate goal is the Supreme Personality of Godhead. Vedānta-sūtra (1.1.4) confirms this in the following words: tat tu samanvayāt. One can attain perfection in three stages. By understanding Vedic literature one can understand his relationship with the Supreme Personality of Godhead, by performing the different processes one can approach Him, and at the end one can attain the supreme goal, who is no other than the Supreme Personality of Godhead. In this verse the purpose of the Vedas, the understanding of the Vedas, and the goal of the Vedas are clearly defined.