Lesson 22 of 25

The Chain of Thought

Instead of asking for the whole result in one prompt, you break the work into a sequence of linked steps and feed each answer into the next question. It works because every link gives you a chance to correct course before the error compounds - and because a model asked to do one thing well does it better than one asked to do five things at once.

Reach for it whenWhen the output you want depends on decisions that have to be made first - a business plan that needs a market analysis before a budget, or code that needs its logic settled before it is written.

The chain works naturally in a single conversation because the thread carries its own context - you rarely need to paste the previous answer back in, you can just refer to it. Where you do need to be deliberate is at the handover: say "using the SWOT above" rather than assuming, because a long thread can drift. For a chain you run repeatedly, build the whole sequence into a Custom GPT with the steps described in its instructions, and it will walk you through them.

Worth knowingWith a reasoning model, do not over-split. These models already decompose a task internally, so chaining a short analytical problem into four prompts can produce a worse result than asking once with clear constraints - each turn loses a little of the whole picture. Chain when the links genuinely need your judgement in between, or when the steps need different roles. Chain for the sake of appearing rigorous and you are just adding turns. A second thing: in a long thread, early constraints fade; restate the ones that still matter at each link.
  • Reference the previous answer rather than re-pasting it.
  • Do not chain what one clear prompt would handle.
  • Restate live constraints at each link; threads drift.
  • Build a repeated chain into a Custom GPT.
  • Use Canvas from the link where a document starts.
Example 1: Building a Business Plan (A Multi-Link Chain)

Perplexity version

**Why a chain here:** each link needs a different specialist and your judgement in between. A market analyst, a marketing strategist and a financial planner would not write each other's sections, and you need to accept the SWOT before anyone budgets against it. Send these as three separate messages in one conversation.

---

**LINK 1 - THE FOUNDATION**

Act as a market research analyst.

My business idea: a home-delivery service for authentic, home-cooked Hyderabadi meals, aimed at busy professionals in Gachibowli.

Run a SWOT analysis on this specific concept. For each quadrant give three to four points, each one concrete about this business in this location rather than generic to food delivery. Under Threats, be specific about the cloud kitchens and the quick-commerce players already operating in Gachibowli.

End with one line: which single Weakness would kill this business first if unaddressed.

---

**LINK 2 - THE FIRST FLOOR**

Using the SWOT you just produced - no need to restate it - now act as a marketing strategist.

Propose three distinct channels to reach busy professionals in Gachibowli. For each: how it works in practice, which specific Strength or Opportunity from the SWOT it exploits, roughly what it costs to run for a month in rupees, and how I would know within four weeks whether it is working.

The three must be genuinely different in kind - not three variations on Instagram. At least one should be something that works because of where this business is, like the office parks and the tech campuses, rather than something any food brand anywhere could do.

---

**LINK 3 - THE SECOND FLOOR**

Now act as a financial planner, working from the three channels above.

Build a six-month marketing budget. A month-by-month table in rupees, allocating across the three channels, with the reasoning for the split. Front-load testing and shift spend toward whatever the Link 2 success measures would identify.

Then three things:
1. A total, and what it assumes about my order volume.
2. The cheapest version of this plan that still tests all three channels - the number I actually need if I am starting small.
3. Which figures here are estimates you cannot verify. Delivery commission rates, ad costs per click in Hyderabad and customer acquisition costs change constantly and you are working from recollection. Name them so I can get real quotes before I commit.
Open Perplexity 2,397 characters
Example 2: The Creative Writing Chain

Perplexity version

**Why a chain here:** a novel's opening chapter depends on a character who depends on nothing, and if you ask for all three at once you get a thin character serving a convenient plot. Separating them lets you reject the character before 700 words are built on him. Three messages, one conversation.

---

**LINK 1 - CHARACTER CREATION**

You are my creative writing partner. We are building a character for a detective novel.

He is a disgraced former police officer in Hyderabad, now working as a private investigator.

Give me a detailed profile: his name, his backstory, what exactly the disgrace was and whether he deserved it, his primary motivation now, and his greatest flaw. The flaw should be the kind that creates plot, not a label - something that will make him do the wrong thing at a specific moment.

Two constraints. Make the disgrace something more interesting than taking a bribe. And give me three small, specific, physical details about how he lives - what he eats, what he drives, where he sleeps - because those are what make a character real on the page.

---

**LINK 2 - PLOT OUTLINE**

Using the character above, build the plot.

A five-point outline for a mystery: he is hired to find a missing piece of the Nizam's jewellery, and the trail takes him into the city's old smuggling underworld.

For each of the five points: what happens, and what it costs him. And make his flaw - the one we established in Link 1 - the reason the middle of the story goes wrong. A plot that would work with any detective in it is not using the character we just built.

Tell me which of the five beats is weakest before I commit to it.

---

**LINK 3 - WRITING THE OPENING**

Now write the opening chapter, roughly 700 words, using the character and outline we have developed.

It must introduce him in his element and arrive at the inciting incident from the outline. Use at least two of the physical details from the profile - show them, do not list them. Hyderabad should be present in the specifics, not in the adjectives.

Open Canvas for this one. The first two links were decisions and belong in the chat; the chapter is a document I will keep revising, and side-by-side editing is the difference between asking for a new draft and fixing a line.
Open Perplexity 2,261 characters
Example 3: A Technical Code-Building Chain

Perplexity version

**Why a chain here:** this is the chain that earns itself most clearly. Logic reviewed as pseudocode is logic you can read; logic buried in forty lines of Python is logic you accept on trust. Three messages, one conversation.

---

**LINK 1 - THE LOGIC**

I need a Python script. Before any code, let us settle the logic.

I want a function that takes a list of website URLs. For each one it tries to connect. On success - HTTP 200 - the URL goes on a "successful" list. On failure it goes on a "failed" list.

Write this as plain-English pseudocode, numbered. No Python yet.

Then, before I approve it, tell me what I have not specified: what counts as failure beyond a non-200 status, whether there is a timeout, what happens on a redirect, whether a 301 or a 403 is success or failure for my purposes. Those decisions belong in the pseudocode, not discovered later in a stack trace.

---

**LINK 2 - THE CODE**

That pseudocode is approved. Translate it into a working Python script.

Use the requests library. Put a comment above each block naming which numbered pseudocode step it implements - that way I can check the translation rather than just read the code.

Set a sensible timeout and say what value you chose and why. Nothing beyond the pseudocode: no logging framework, no concurrency, no config file. If you think the script needs something we did not specify, say so underneath rather than adding it.

---

**LINK 3 - THE REFINEMENT**

The script works. Now add error handling.

Wrap the request in try/except catching requests.exceptions.RequestException, and print a clear message naming the URL and what went wrong. A failed URL should land on the failed list with its reason rather than vanishing, and one bad URL must not stop the rest of the list.

Then tell me what would still break it: an empty list, a malformed URL that fails before the request is made, a server that accepts the connection and never responds. For each, whether the current code survives it. That list is worth more than the error handling itself - it tells me which failures I have actually covered.
Open Perplexity 2,093 characters