Prompt Engineering via Prompt Patterns — The Recipe Pattern
The article is part of series: Prompt Engineering via Prompt Patterns
You can switch to video version of this article
Free AI web copilot to create summaries, insights and extended knowledge, download it at here
1847
Abstract
easy to use. All of us saw excel sheets at some point in our lives. And here is the best part — any decent app offers an integration with Google products. So, maybe, just maybe, you don’t even need a developer to start collecting data from your vendors, or create a simple contacts database that can be embedded in your CRM.</p><h2 id="d797">Google Forms</h2><p id="f556">It all starts with <a href="https://www.google.com/forms/about/">Google Forms </a>where you can use a drag and drop builder to create a form for data entry or a survey. Those forms are easy to share and embed on almost any third-party website. They are lightweight, customizable, and just easy to work with.</p><figure id="5e65"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*4ByT335dOejVUI5G71tyMw.png"><figcaption></figcaption></figure><p id="b623">For this example, I chose the Contact Information template. My plan is to create a simple form for data entry and embed it on my hypothetical intranet website. The idea is to allow employees to enter the contact information of people they work with. But where do we store all this data? Here is where <a href="https://www.google.com/sheets/about/">Google Sheets</a> come into play.</p><h2 id="e1eb">Google Sheets</h2><p id="5c80">Once my form is ready, I move to the second tab called Responses and add a source for this form. I can connect a new spreadsheet that has all the columns defined automatically (they will match the names of the fields in my form). The sheet will be populated automatically.</p><figure id="17d9"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*3qsRhHD7hYWVs5VKC2yijw.png"><figcaption></figcaption></figure><figure id="4eb9"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*yOKcgU4J7y8J2Z5upwgpaQ.png"><figcaption></figcaption></figure><p id="
Options
e2ef">And just like that, I have a new spreadsheet that will keep all entered information from the form in one place. Now, everything is neatly organized and easily searchable. If I want, I can add more forms in the future that point to the same sheet or create a new sheet for each new form.</p><figure id="1482"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*naCwfvtuQc5WMpTNjirTLQ.png"><figcaption></figcaption></figure><p id="9b42">I can also share this spreadsheet with others or, to take it even further, use Sheets API to display this data in any way I like on my Intranet website. And my client-facing website. Anywhere, actually.</p><div id="658a" class="link-block"> <a href="https://developers.google.com/sheets/api"> <div> <div> <h2>Sheets API | Google Developers</h2> <div><h3>The Google Sheets API lets you read, write, and format Google Sheets data with your preferred programming language…</h3></div> <div><p>developers.google.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*JfkvTo8HOGQPyxsY)"></div> </div> </div> </a> </div><h2 id="6517">Google Analytics</h2><p id="1afb"><a href="https://analytics.google.com/">Google Analytics</a> is the final and optional piece of this simple puzzle. In this example, I don’t really need to track who entered what, but I can think of many other use cases where analytics is needed. Google Analytics is a real powerhouse and it integrates with Google Forms easily. If you use Google Forms to collect feedback from your clients or to hire people, for example, you’ll benefit from having nice charts and more in-depth data.</p></article></body>
The article is part of series: Prompt Engineering via Prompt Patterns
You can switch to video version of this article
Many a times when we attempt to approach a new problem outside our comfort zone, we are constrained by limited knowledge where we have limited information to go by and are trying to find all the missing pieces of information required to go from zero to fulfillment. What is our end goal here? We are looking for a sequence of steps to complete the required job.
So the formal definition of recipe pattern goes like, The recipe pattern provides constraints to ultimately output a sequence of steps given some partially provided ‘ingredients’. Ingredients, that must be configured in a sequence of steps to achieve a stated goal. Whoa that textbook definition seems purpose build to go way above heads of most of us, so let me try and explain with an example. Say you are trying to paint your room. You have your paint and roller with you, but you don’t know anything about preparing the walls or the room or how to paint. You do have an end goal in mind though. So you are going to provide the partial information about what you know and what you have, and what you want, and ask for a sequence of steps, including any missing steps from the large language model.
The pattern is specially useful in cases where you have a general idea of what you are about to do, like how a room is painted, and what ingredients are required like paint, brushes and rollers, but you are missing the precise ordering of steps to go by like how to mix the paint for first coat, or the knowledge that there needs to be multiple coats each requiring a different mixing techniques. I just picked a very easy example to explain, but this is useful in a lot of places like planning a trip, installing windows on your new laptop, deploying a website to cloud, performing cleanup and data analysis on a dataset, learning how to drive a car for the first time, and lets not forget cooking where this pattern name comes from 😊. In all such cases, precise ordering of steps is the key to reach the delicious end goal. You can use it to ask recipes, and I mean real cooking recipes given a list of ingredients you have around, or you can ask LLM to provide you three different cooking recipes for the chicken and spices you have available with you.
To use this pattern, you need to use statements like
I would like to achieve X
I know that I need to perform steps A, B and C
Provide a complete sequence of steps for me
Fill any missing steps
Identify any unnecessary steps
The first statement focuses the LLM on the overall goal so that the sequence of steps would be organized and completed with intention to achieve this goal. The second statement lets model not only know the steps user is already aware of, but also lets the model know that the user intends to use these steps in the final sequence. If you have watched the alternative approaches pattern video, you would know there would be multiple ways of accomplishing the same objective, here user is nudging the model towards one which he is most familiar with. Of course you can combine this pattern with the alternative approaches pattern to get ideas on more and perhaps better ways to reaching the end goal than the one you have in mind. Either way, statement two constrains the model to use a sequence of step involving your known steps. The third statement instructs model to provide complete orderly sequence of steps along with the next one to fill any missing steps. This lets the model utilize its vast training set i.e. the public internet to fill in the missing pieces. That last instruction helps identify any step that can be optimized out depending on the final recipe the model is providing.
I hope you have full information about the recipe pattern with all the ingredients and steps to start using it in your practical life. Please clap/share if article seemed useful. You can consider subscribing to our YouTube channel as well. Thank you!!!.
Next article: Prompt Engineering via Prompt Patterns — Few Shots Prompting

Ali AslamHow to make chain of thought prompting technique even more reliable using Cot-SC