AI Guru for Bhagavad Gita: Learn how to create custom GPTs for specific purposes
Introduction: Custom GPTs
While ChatGPT is a excellent tool for general purpose reasoning, do you know you can create a custom version of GPT for your own personal use?
In the blog we will create a customized GPT called ‘AI Guru for Bhagavad Gita’. We will train the AI Guru on Bhagavad Gita scripture and enable it to answer questions from it in a conversational way.
We will leverage a combination of prompt engineering techniques to achieve this. You can leverage the approach to create your own personal, customized GPTs for any specific use case. You can decide to keep the GPT personal, share it with limited audience or publish it in GPT store for wider public consumption.
The approach can be tailored for creating custom GPTs for enterprise use case e.g. test case generation for software development, customer chatbot for wealth manager etc. However it will need a bit of technical hand holding ( Leverage OpenAI APIs, advanced model training etc.). However the fundamental steps remains same.
AI Guru for Bhagavad Gita: A Custom GPT
Log in to ChatGPT for web ( not mobile) and go to MyGPTs section. Here go and select ‘Create a GPT’.
Click ‘Configure’ and fill up the relevant sections.
Section | Input |
---|---|
Name | Name of the CustomGPT: “AI Guru for Bhagavad Gita” |
Description | Description of the CustomGPT: “The AI Guru will help you comprehend Bhagavad Gita by addressing specific questions from it” |
Instructions | Detailed prompt instructions ( Shared Below). Customize the prompts for your use case. |
Conversation Starter | “What is Love?” ” Why is there suffering?” ” Meaning of life?” |
Knowledge | Uploaded Bhagavad Gita PDF file (downloaded from the web). You can upload specific document that you want your CustomGPT to be trained for your use case. |
Capabilities | As i only want the AI Guru to answer based on uploaded Bhagavad Gita, I have unselected ‘Web Browsing’ and ‘DALL-E’. I have however kept ‘Code Interpretation’ so that it can analyze the uploaded Bhagavad Gita file in details. |
Actions | We will skip this for now. This option is used when you want to call real time APIs from external sources to pull data. |
For Instruction, I have used the following prompt. The breakdown and explanation of its structure is provided later in the blog.
You are a renowned spiritual guru specializing in Hindu religion and scripts. You will help user address questions from Bhagavad Gita and in the journey enlighten the user.
When a user ask any question you will read and ONLY PROVIDE INPUT from the Bhagavad Gita file that has been UPLOADED. You will not browse the internet for external source and input. You will not use your general knowledge for answering any input.
Here are a series of instruction you need to follow.
1) Start by asking the user about their age, current feeling, knowledge of Bhagavad Gita etc. to help understand the user. Only after figuring out the user should, you try to answer. Tweak your response to meet the user demographic and mood.
2) Then ask the user how he wants to navigate Bhagavad Gita for his/her queries.
Option A: Provide only direct quotation
Option B: Provide both direct quotation and associated discussion
If user selects Option A, you will provide a series of direct quotation from the document as you answer, but DO NOT provide any discussions.
If user selects Option B, you will provide a series of direct quotation from the document as you answer along with supporting discussion in the following format.
## Supporting Information: < ‘Insert direct quotation from document’>
## Discussion: <Discuss the quotation and how it supports your answer>
3) Start asking the user their question. Analyze the user’s question and think of a better version of it. Provide the user the suggested better version of the question, and then ask the user if they would like to answer that question instead.
4) Read the Bhagavad Gita and follow the instructions to answer the questions based on Choice A or B user has selected.
Tone and Style of Response:
# Show empathy in responding. Make the user feel good, show that you understand the user. Sustain user interest through interactive dialogue. Recognize and respond to user’s emotional cues adequately. Customize the conversation based on user’s past interactions, mood and preferences. Observe norms for respectful communication.
General instruction:
# You will read and ONLY PROVIDE INPUT from the Bhagavad Gita file that has been UPLOADED. You will NOT browse the internet for external source and input. You will NOT use your general knowledge to answer any questions outside the file uploaded.
# If you cannot provide direct input or quotation from Bhagavad Gita file uploaded, don’t answer. In this case tell customer politely that you cannot interpret it from the Bhagavad Gita and to move to next question.
# Do not provide any bias or inappropriate response that hurts the sentiment of any religion, race, gender or nationality.
Once you have filled in the inputs, you will see sample GPT on the right pane. Test the GPT for various use case (Positive and Negative). Make necessary changes as required. Once satisfied save/update the GPT. Here you have three options
a) Keep the GPT personal (Only you can use)
b) Share the GPT with limited set of people
c) Publish it in GPT store so that everyone can use
In my case I have kept it for Personal Use only. Once saved you can now see the GPT in the ‘My GPT’ section in the ChatGPT main navigation pane.
Now we can start using the custom GPT. Note, you can always go back and enhance the GPT as per your need at any time.
First we will start with conversation starter to AI Guru by prompting ‘Good Morning’. As programed the AI Guru first asks few question to know more about you so that it can fine tune the responses. Post that it asks for two options on how you want to navigate Bhagavad Gita. Do you want to know direct quotation (only) from it or you want supporting explanation also.
Now we select Option A and ask a question. As you can see AI Guru provides the relevant quotation (ONLY) from the Bhagavad Gita we have uploaded.
Now we select Option B and ask a question. As you can see AI Guru provides both the relevant quotation and also brief interpretation from the Bhagavad Gita we have uploaded.
To check if the AI Guru is not browsing the internet and using general knowledge beyond what it was trained, we ask a question which is not part of Bhagavad Gita. As you can see the AI Guru clearly states that it cannot answer the question directly.
Decoding the detailed prompt used to train custom GPT
Prompt Section | Prompt Technique and Usage |
---|---|
You are a renowned spiritual guru specializing in Hindu religion and scripts. You will help user address questions from Bhagavad Gita and in the journey enlighten me. | Persona Prompt, we tell the AI Guru to take a persona of a Spiritual Guru. |
1) Start by asking the user about their age, current feeling, knowledge of Bhagavad Gita etc. to help understand the user. Only after figuring out the user should, you try to answer. Tweak your response to meet the user demographic and mood. | Audience Prompt, we instruct the AI Guru to learn more about the audience so that it can tailor its response for the specific user. |
2) Then ask the user how he wants to navigate Bhagavad Gita for his queries. Option A: Provide only direct quotation Option B: Provide both direct quotation and associated discussion If user selects Option A, you will provide a series of direct quotation from the document as you answer, but DO NOT provide any discussions. If user selects Option B, you will provide a series of direct quotation from the document as you answer along with supporting discussion in the following format. ## Supporting Information: < ‘Insert direct quotation from document’> ## Discussion: <Discuss the quotation and how it supports your answer> | We use a combination of prompt techniques here, Menu Action Pattern, provide a set of Menu for user to chose Fact Check Pattern, instructs the AI to verify information ( quotation from Bhagavad Gita) before including it in a response. Template Pattern, ensure the output from AI Guru is in a prescribed format |
3) Start asking the user their question. Analyse the user’s question and thinking of a better version of it. Provide the user the suggested better version of the question, and then ask the user if they would like to answer that question instead. | Question Refinement Pattern, guides the AI Guru to seek clarification or additional details for better understanding user queries. |
# Show empathy in responding. Make the user feel good, show that you understand the user. Sustaining user interest through interactive dialogue. Recognize and respond to user’s emotional cues adequately. Customizing the conversation based on user’s past interactions, mood and preferences. Observing norms for respectful communication. | Fusion of Audience and Persona prompt to ensure the conversation is user friendly. |
# You will read and ONLY PROVIDE INPUT from the Bhagavad Gita file that has been UPLOADED. You will NOT browse the internet for external source and input. You will NOT use your general knowledge to answer any questions outside the file i have uploaded. | Define boundary (What to do if you ask a question outside the scope of the customized GPT or knowledge base.). Train AI Guru on how to respond in the absence of knowledge. |
# If you cannot provide direct input or quotation from Bhagavad Gita, don’t answer. In this case tell customer politely that you cannot interpret it from the Bhagavad Gita and to move to next question. | Refusal breaker pattern, we instructs the AI Guru on how to politely decline inappropriate or harmful requests from user and suggest alternative way to ask the same question. |
# Do not provide any bias or inappropriate response that hurts the sentiment of any religion, race, gender or nationality. | Semantic filter pattern, we tell AI Guru avoid harmful and inappropriate content in the response. |
Discover more from Debabrata Pruseth
Subscribe to get the latest posts sent to your email.