When a task is so complex that even a well-phrased prompt isn't enough, prompt chaining – another advanced technique – may be the solution. Instead of trying to craft a perfect standalone prompt on your first try, it’s helpful to treat prompting like an ongoing conversation, which is where prompt chaining comes in. This technique is all about thinking of prompting as a way to manage an entire macro-level workflow.
Chaining prompts facilitates large tasks by breaking them into a series of smaller, connected steps within the same chat session. This process functions similarly to an assembly line: the output from one prompt serves as the input for the next, linking each stage together.
This technique involves three key steps:
- Task analysis: Start by breaking down your complex task into a series of smaller, logical steps
- Initial prompting: Craft a focused prompt that asks AI to complete just the first step
- Input/output flow: Use the output from the first prompt as the context for the second prompt, and continue this iterative flow until you complete the task
A practical example:
Planning a vacation to Paris requires managing logistics alongside personal interests. Prompt chaining can structure this project through the following sequence.
Here’s how prompt chaining could apply to this: