Lesson 4 12 min

Context and Memory

Learn how to use context effectively and understand how AI memory works across conversations.

Recall: The RTCF Framework

In Lesson 3, you learned to structure prompts with Role, Task, Context, and Format. Today we dive deeper into the “C”—Context—and explore how AI memory actually works.

By the end of this lesson, you’ll understand:

  • How AI memory works (and doesn’t work)
  • How to provide effective context
  • The power of examples (few-shot prompting)

How AI Memory Works

Let’s clear up a common misconception: AI doesn’t remember you.

When you close a chat and open a new one, the AI has zero memory of your previous conversation. It doesn’t know your name, your preferences, or what you discussed yesterday.

Within a single conversation, AI does maintain context—but it’s limited to what fits in the context window (which we covered in Lesson 2).

What This Means for You

  1. Each conversation is independent. Don’t assume AI knows what you discussed before.

  2. Provide context every time. If information is important, include it explicitly.

  3. Long conversations can drift. After many back-and-forth exchanges, AI may “forget” early context.

Note: Some platforms (like ChatGPT with Memory) are adding persistent memory features, but these are still limited and you shouldn’t rely on them for important context.

The Art of Providing Context

Context shapes everything. The same question with different context produces wildly different responses.

Example: Same Question, Different Context

Question: “How do I handle this situation?”

Context A: “I’m a manager and an employee keeps arriving late.”

Response A: Advice about progressive discipline, having a conversation, documenting patterns…

Context B: “I’m a teenager and my friend keeps arriving late to hang out.”

Response B: Advice about communication, understanding their situation, setting expectations with friends…

Same question. Completely different (and appropriate) responses.

What Context to Include

Context TypeWhen to IncludeExample
Who you areWhen your role affects the answer“I’m a first-year medical student…”
Who it’s forWhen the audience matters“…explaining this to elderly patients”
What you’ve triedWhen troubleshooting“I already tried X and Y, but…”
ConstraintsWhen there are limitations“Budget is $500, deadline is Friday”
BackgroundWhen AI needs info to help“Our company sells B2B software to banks…”

Quick Check

You want AI to help you write a project update email. Which context would be most helpful?

A) “I need to write an email” B) “I need to write a project update email to my VP” C) “I need to write a project update email to my VP. The project is 2 weeks behind schedule due to vendor delays, but we have a plan to catch up. She prefers bullet points and dislikes excuses.”

(Answer: C provides role, audience, situation, and preference context)

Few-Shot Prompting: Show, Don’t Tell

One of the most powerful prompting techniques is few-shot prompting—giving AI examples of what you want.

Instead of explaining the format you want, you show it.

Without Examples (Zero-Shot)

“Convert these meeting notes into action items with owners and deadlines.”

With Examples (Few-Shot)

“Convert these meeting notes into action items. Follow this format:

Example input: ‘John will follow up with the vendor about pricing by next Tuesday’ Example output: ‘- [ ] Follow up with vendor on pricing @John 📅 Tuesday’

Example input: ‘We need to review the contract before signing’ Example output: ‘- [ ] Review contract before signing @TBD 📅 TBD’

Now convert these notes: [your actual notes here]”

The few-shot version shows AI exactly what pattern to follow. This works because AI is fundamentally a pattern-recognition system—showing it patterns is speaking its native language.

When to Use Few-Shot Prompting

  • Complex formats: When the output structure matters
  • Specific styles: When you need a particular tone or voice
  • Transformations: When converting one format to another
  • Consistency: When you need multiple outputs to match

Managing Long Conversations

Here’s a practical problem: long conversations can cause AI to drift off-topic or lose early context.

Signs of Context Drift

  • AI “forgets” instructions you gave earlier
  • Responses become less relevant or more generic
  • AI starts contradicting earlier statements

Solutions

1. Restart with fresh context If a conversation gets messy, start a new one. Paste in a summary of what you’ve established and continue from there.

2. Remind key constraints Periodically restate important rules: “Remember, keep all responses under 100 words and in bullet format.”

3. Use system prompts Many AI tools let you set a “system prompt” or “custom instructions” that persists throughout the conversation. Use this for consistent constraints.

4. Summarize and continue Ask AI to summarize the conversation so far, then use that summary as context for the next phase.

Practical Exercise: Context Loading

Here’s a technique for complex tasks—load context before asking for help:

“Before I ask for your help, let me give you context about my situation:

  • I’m a [your role]
  • I’m working on [project/task]
  • My audience is [who will see this]
  • Key constraints are [limitations]
  • I want the output to be [format]

Do you have any clarifying questions before we begin?”

This “context loading” approach:

  1. Ensures AI has the information it needs
  2. Lets AI ask for missing details
  3. Creates a shared understanding before you dive in

Key Takeaways

  • AI has no persistent memory between conversations
  • Context shapes responses—the same question with different context gets different answers
  • Few-shot prompting (showing examples) is often more effective than explaining
  • Long conversations drift—restart or summarize when needed

Up Next

Lesson 5 covers output formats—how to get AI to give you responses in exactly the structure you need, whether that’s a table, bullet points, code, or something custom.

Knowledge Check

1. What happens to AI's memory when you start a new conversation?

2. Why are examples (few-shot prompting) so powerful?

3. What should you do if the AI's response drifts off-topic in a long conversation?

Answer all questions to check

Complete the quiz above first

Related Skills