Skip to main content

We're excited to be creating more content for you! Additional modules are being added regularly.

Module 2.5

Context Management

When chatting with an AI, context is everything. Context management is the art of helping the AI maintain relevant information throughout your conversation. This becomes especially important when working on complex tasks or having lengthy discussions.

How Context Works

Context in AI conversations operations within two primary categories: immediate and historical. Immediate context includes the current exchange and the most recent messages. The AI readily accesses and uses this information to further the conversation. Historical context covers information from earlier in the conversation. The AI may lose access to this information as the conversation progresses.

Throughout your conversation, you will always be leveraging one of the two. While there is no standard for when a topic shifts from one category to the other, it is good practice to assume that historical context likely refers to any part of the chat that you can no longer see on your screen from the bottom of the chat. It isn't perfect, but it does provide an effective baseline.

Immediate Context Example

  • You: "I have a database of customer feedback."
  • AI: "What would you like to know about the feedback?"
  • You: "What are the common themes?"

Here, the AI maintains the context about customer feedback and can provide relevant analysis because your question directly relates to the most recent message.

Historical Context Example

  • You: "I'm working on a marketing campaign for eco-friendly products."
  • 20 messages later about various topics (the weather, website updates, project management, etc.)
  • You: "What color should we use?" 

Here, the AI might not remember that you are asking about the marketing plan for eco-friendly products because you've shifted topics several times.

The Art of Context Management

Effective context management involves three key practices: creating a foundation, maintaining structure, and refreshing. To have an effective outcome, you should look to apply all three consistently.

  • Foundation - the "C" in PORC focuses specifically on context. It is essential to start with a clear framework that provides relevant information about the task at hand.
    • Example - "We're developing a marketing strategy for an eco-friendly clothing brand targeting young professionals. Our key values are sustainability, style, and affordability. For each suggestion you provide, consider these aspects."
    • In this example, effectively provide all the key goals needed to develop a marketing strategy. This will help the AI develop a better plan than if we simply asked it to "develop a marketing plan for a young professional clothing line."
  • Structure - establishing and maintaining a consistent organization to your conversations significantly improves your chat experience. It breaks complex tasks down into structured segments without losing the overall goal.
    • Example - "Based on our eco-friendly clothing brand discussion, please develop the following: 1. Brand Voice; 2. Digital Marketing Channels; 3. Sample Messaging."
    • In this example, we've explained how we would like the conversation to flow. Now, as soon as you finish with any of the segments, the AI will know to move on to the next step.
  • Refresh - briefly restating important context should always be done after switching topics or after you've had a lengthy exchange.
    • Example - "Returning to our eco-friendly clothing brand's marketing strategy, specifically the sustainability aspect we discussed..."
    • In this example, we've expressed to the AI that we would like to change gears to focus on a new segment. This helps ensure that everything stays on track throughout the conversation.

Common Challenges and Solutions

When you are early into your prompting practice, it is easy to accidentally derail a conversation by diving into another topic. Fortunately, this can usually be remedied with a few strategies:

  • Losing Track in Long Conversations
    • Challenge: The AI forgetting earlier details
    • Solution: Periodically summarize key points
    • Example: "To recap: We're developing marketing for an eco-friendly clothing brand. We've established our brand voice as professional yet approachable. Now, let's discuss marketing channels."
  • Switching Between Topics
    • Challenge: Confusion when handling multiple tasks
    • Solution: Clear transition statements and context refreshers
    • Example: "Pausing our marketing discussion. Switching to product pricing strategy. We'll return to marketing after."
  • Complex Multi-Part Tasks
    • Challenge: Maintaining consistency across related but separate tasks
    • Solution: Structured progression with context links
    • Example: "As part of our eco-friendly brand launch: We've completed the marketing strategy, now we're working on pricing, next will be distribution Each decision should align with our sustainability focus."

If you are ever not sure about where you are within the conversation or if you think that the AI is not responding correctly to your messages, just ask! It is a great practice to prompt the bot to provide you with an update about your current progress. This will help ensure alignment and that you are working towards your overall goal. You can do this simply: "Before we continue, I'd like to pause for a status check. Based on our outline, where would you say we currently stand?"

Practical Examples

Example 1: Project Development

Poor Context Management

AI: How can I help you?  
  You: I need a logo. What should it look like? What colors should we use? How about the font?

This approach is not ideal because it offers no information about the company that you're creating a logo for. Would you hire a graphic designer and ask them the same way? Probably not.

Better Context Management

AI: How can I help you?  
  You: I need to create a logo for my eco-friendly clothing brand targeting young professionals:
  1. Let's design a logo that conveys sustainability
  2. Choose colors that reflect eco-friendly values
  3. Select fonts that balance professionalism with approachability

This approach provides significantly more information about the logo that you need, giving the AI clear parameters they need to consider.

Example 2: Content Creation

Poor Context Management

AI: How can I help you?  
  You: I am writing an essay. Create an introduction, then add the next part, and finish with a conclusion.

This isn't going to work because the AI cannot read your mind. What are you writing about? How long does it need to be? What is this for? If you don't give this information (among others) to the bot, you're not going anywhere quickly.

Better Context Management

AI: How can I help you?  
  You: I am writing an essay about sustainable fashion for this Sunday's newspaper. I am going to provide you with a couple of recent essays. I want you to analyze them to create the following:
  1. An introduction highlighting the industry's environmental impact
  2. Three main sections covering sustainable materials, ethical production, and conscious consumption
  3. A conclusion with actionable steps for readers

This approach explicitly covers everything that the bot needs to know to create your essay. Mother nature would be so proud!

Putting It All Together

In our next section, we'll explore how to combine our understanding of tokens and context management to handle more complex interactions and advanced prompt engineering techniques. We'll look at strategies for maintaining clarity and purpose in sophisticated AI conversations while managing both token limits and context effectively.