0Pricing
AI Prompt Engineering · Lesson

Building on Previous Responses

Multi-turn conversations: referencing prior output in follow-up prompts.

Building on Previous Responses is a free AI Prompt Engineering lesson on CoddyKit — lesson 3 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the AI Prompt Engineering learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

Multi-Turn Conversations

A multi-turn conversation with an AI model is a collaborative build — each exchange adds something new rather than replacing what came before.

This is different from follow-up prompting to fix errors. Building on previous responses means using the model's prior output as raw material: expanding it, selecting from it, recombining it, or applying a new lens to it.

Mastering this pattern lets you produce complex, layered outputs that would be impossible in a single prompt.

Referencing Prior Output

The simplest building pattern is referencing what the model just wrote:

  • "Based on what you wrote above, what are the three biggest risks?"
  • "Take the framework you described and apply it to a healthcare context."
  • "Using the tone from your last response, rewrite this new paragraph."
  • "From the list you generated, which item would you prioritize first and why?"

These references keep the model grounded in its own prior work, creating continuity across turns.

Selecting and Expanding

When the model produces a list or set of options, you can select one item and ask for expansion:

  • "Take the second option from your list and expand it into a full plan."
  • "I like the third approach best. Write a 300-word implementation guide for it."
  • "Option B is closest to what I need. Develop it further with specific steps and timeline."

This pattern is powerful for ideation workflows: generate options in one turn, select and develop in the next.

Using Structure from a Previous Response

You can ask the model to apply the structure from one response to new content:

  • "Using the same structure from your last response, analyze competitor B."
  • "Apply the same five-section format to this new product."
  • "Follow the outline you created above, but fill it in for a B2B audience instead of B2C."

This is extremely useful for creating consistent, parallel documents — reports, comparisons, and analyses that need to follow the same template across multiple subjects.

Iterative Depth: Going Deeper Turn by Turn

Multi-turn conversations let you progressively increase depth:

  1. Turn 1: "Give me a high-level overview of machine learning pipelines."
  2. Turn 2: "Go deeper on the data preprocessing step."
  3. Turn 3: "Give a Python code example for handling missing values in that preprocessing step."
  4. Turn 4: "Now add error handling and logging to that code example."

Each turn zooms in one level. This is more controlled than asking for everything at once in a single complex prompt.

Cross-Referencing Multiple Prior Turns

In longer conversations, you can pull together elements from multiple earlier turns:

  • "Combine the user personas from Turn 2 with the product features from Turn 4 to write a targeted pitch for each persona."
  • "Take the risks you identified earlier and the mitigation strategies from your last response and create a risk matrix."

This works best when each prior turn produced a clearly labelled, distinct piece of content. Disorganized prior turns make cross-referencing confusing for both you and the model.

Context Window Limitations

Multi-turn conversations have a practical limit: the model's context window. Every message — yours and the model's — is included in the context sent to the API. As the conversation grows longer, older messages may be truncated.

Practical strategies:

  • Summarize and compress earlier turns when they are no longer needed in full detail
  • Start a fresh conversation when the topic fundamentally shifts
  • Keep individual responses concise to extend how far back the model can see

Managing Multi-Turn Context in Code

In Python, you maintain multi-turn context by appending each message pair to the conversation history list:

import openai

client = openai.OpenAI(api_key='sk-...')

conversation = []

def chat(user_message):
    conversation.append({'role': 'user', 'content': user_message})

    response = client.chat.completions.create(
        model='gpt-4o-mini',
        messages=conversation
    )

    reply = response.choices[0].message.content
    conversation.append({'role': 'assistant', 'content': reply})
    return reply

# Turn 1: Generate options
print(chat('Give me 3 app name ideas for a meditation app.'))

# Turn 2: Select and expand
print(chat('Take the second option and write a tagline and a 50-word app description for it.'))

# Turn 3: Apply structure to another item
print(chat('Now do the same for the first option: tagline and 50-word description.'))

Anchoring References Clearly

When referencing prior output, be precise about what you mean. Vague references cause the model to guess:

  • Vague: "Expand on what you said earlier."
  • Clear: "Expand on the third bullet point in your previous response — the one about onboarding friction."

If a prior response had multiple sections, name the section. If it was a list, reference the item number. The more precisely you anchor your reference, the more reliably the model will follow it.

Building Documents in Stages

Multi-turn building is ideal for creating structured documents like reports, plans, or proposals:

  1. Turn 1: Generate the outline
  2. Turn 2: Write Section 1
  3. Turn 3: Write Section 2 (maintaining the tone from Section 1)
  4. Turn 4: Write the executive summary based on Sections 1 and 2

This staged approach gives you control over each section before committing to the next, and allows you to adjust direction mid-document without losing everything.

When Building Fails: Losing the Thread

Multi-turn building can go wrong when the model loses track of earlier context. Signs of thread loss:

  • The model contradicts something it said two turns ago
  • It ignores a constraint established early in the conversation
  • It reverts to generic advice instead of the specific framework you built

Fix: Re-state the key context explicitly in your next message rather than assuming the model remembers. "As we established, the audience is non-technical executives. With that in mind..."

Knowledge Check: Multi-Turn Building

You have a three-turn conversation. Turn 1 produced a five-section outline for a business report. Turn 2 produced the full text of Section 1 (Market Analysis). Now you want Section 2 (Competitive Landscape) to follow the same structure and tone as Section 1.

Which Turn 3 prompt is most effective?

Recap: Building on Previous Responses

Multi-turn conversations are a powerful way to build complex outputs progressively. The key techniques are: referencing prior output by name or number, selecting and expanding specific items, applying structure from one response to new content, and iterating depth turn by turn.

Precise anchoring and awareness of context window limits are the main skills that prevent multi-turn conversations from losing coherence.

In the next lesson, you will learn when to abandon a conversation and start fresh instead of continuing to build.

Frequently asked questions

Is the “Building on Previous Responses” lesson free?

Yes — the full text of “Building on Previous Responses” is free to read here on the web, and the AI Prompt Engineering course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the AI Prompt Engineering course, upgrade to CoddyKit PRO.

What will I learn in “Building on Previous Responses”?

Multi-turn conversations: referencing prior output in follow-up prompts. You practise AI Prompt Engineering with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start AI Prompt Engineering?

No prior experience is required. AI Prompt Engineering on CoddyKit is structured for beginners through advanced learners; this is — lesson 3 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Building on Previous Responses” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this AI Prompt Engineering lesson?

Yes. Every AI Prompt Engineering lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Reading and Evaluating AI Outputs
  2. Writing Effective Follow-Up Prompts
  3. Building on Previous Responses
  4. When to Refine vs Start Fresh
← Back to AI Prompt Engineering