Fundamentals of prompt design
When designing prompts for RAG applications, it’s essential to keep the following fundamentals in mind:
- Be concise and specific: Clearly define the task you want the AI model to perform, and provide only the necessary information to complete the task effectively. For example, saying
Please analyze the given context and provide an answer to the question, taking into account all the relevant information and details
would be less concise and specific than sayingBased on the context provided, answer the following question: [
specific question]
. - Ask one task at a time: Break down complex tasks into smaller, more manageable sub-tasks, and create separate prompts for each sub-task to ensure better results. For example, if you said
Summarize the main points of the context, identify the key entities mentioned, and then answer the given question
, that is multiple tasks you are asking for at the same time. You would likely have better results if...