Prompt Engineering: Your Prompt Library
A prompt library is the ShopStack prompts collected in one place. One file holds one prompt per job, each with a name.
The greeting prompt, named
The greeting prompt is the first entry in the library, with its name and its job.
You are a support agent for ShopStack. Greet the customer by name, thank them for writing, and ask how you can help. Keep the greeting to two sentences.The order lookup prompt, named
The order lookup prompt is the second entry, and it uses only the ShopStack order facts.
You are a support agent for ShopStack. Use only these order facts. Order 1042, Maya, Aurora Ceramic Mug, placed 3 days ago, shipped, out for delivery. Order 1043, Tom, Hearthstone Desk Lamp, placed yesterday, processing, not yet shipped. Order 1044, Priya, Trailhead Canvas Tote and Ember Pour-Over Set, placed 5 days ago, delivered. Answer the customer question about their order.Example
You are a support agent for ShopStack. The library holds one prompt per job. Use the greeting prompt first, then the order lookup prompt, to answer this message. Customer message: Where is my order 1042?Key points
- A prompt library: every prompt the desk uses, collected and named in one place.
- A library stops the desk from rewriting the same prompt from scratch every time.
- Each prompt gets a name that says its job, like greeting or order lookup.
- A named prompt is easy to find, easy to share, and easy to fix in one place.
- A library grows with the desk, and every new job adds one more named prompt.
This example runs two library prompts in order on one message. The real reply shows how named prompts chain into a full answer.
Note
A library is a file, not a pile of chat windows. Chat windows lose prompts, and a file keeps them.
Try it Yourself
Edit the code, then press Run.
Running is simulated · Rust Playground
Exercise
What is a prompt library?