Prompt Studio

Prompt chaining in Prompt Studio

Jul 31, 2024 · 2min

Roksana

Roksana

Designing Prompt Studio

Prompt chaining in Prompt Studio

What is promptchaining?

Prompt Chaining is a technique where a task is broken down into subtasks, each with its own prompt. The AI's response to one prompt becomes the input for the next, creating a chain of prompts that guide the AI to a more accurate and relevant output. Prompt chaining reduces AI hallucination or gives you more control over the data flow.

How do you chain prompts in Prompt Studio?

To use prompt chaining, divide your task into smaller steps. Identify inputs and outputs for each prompt. Type the first prompt, add contextual information, set up AI behavior, and run it. Iterate on the prompt and edit the output until you achieve a satisfying result. To start the chain, click "add new step" under the prompt node and select "empty step" from the menu. This action creates a new prompt node with an empty text editor on the right. You can always return to the previous step by clicking on the node before. To chain previous output in your new prompt, click the "insert" button or type "/". From the menu, scroll to the "previous results" section and select the previous step that appears under its given name. Include the output reference organically in your prompt - place it inline with the prompt text to provide context on how the chained element should be treated during generation.

propmt chaining.gif

Please note that by default, new steps created in one Promptbook are not connected and don't influence each other in any way, nor do they have memory of previously generated content.

Chaining different versions

Each time we rerun a prompt in our Promptbook, versions are saved in the history. Access this by clicking the date button in the text editor's top bar. In the version history sidebar, you can switch between previously generated results. It's important to note that the active version in your text editor will be chained in the following steps. This option allows you to test chaining results with various options, enabling more advanced experimentation and giving you greater control over the final results of your chain.

Chainingversions-ezgif.com-video-to-gif-converter.gif