To set up a service account for your Dialogflow agent, go to the "Settings" page of your agent in the Dialogflow console, and click on the "Service Account" tab. You can create a new service account and download the JSON key file.