Locked learning resources

Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Locked learning resources

This lesson is for members only. Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Context and Memory

Everything the app sends the model for one turn is called the context. The model brings general knowledge from its training, but everything it knows about you, your work, and the current conversation has to be in the context.

What’s in the Context

Each time you send a message, the context includes:

  • The app’s own instructions, plus any custom instructions you’ve saved in your settings
  • Any memories the app has saved about you
  • The whole conversation so far, with your messages and the assistant’s replies
  • Anything you uploaded, and anything the agent read along the way, like a file, a web page, or an email
  • A skill’s instructions, once that skill starts (more on skills in Skills)

Most of this doesn’t show up in the chat you see. You might type one short message, and the model receives all of it along with your message.

Locked learning resources

Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Already a member? Sign-In

Locked learning resources

The full lesson is for members only. Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Already a member? Sign-In

00:00 Context and Memory.

00:03 Everything the app sends the model for one turn is called the context. The model brings general knowledge from its training. But everything it knows about you, your work, and the current conversation has to be in the context.

00:16 Here’s what that looks like when you send one short message. The model gets your message. It also gets the app’s own instructions, plus any custom instructions you’ve saved.

00:27 It gets any memories the app has saved about you. It gets the whole conversation so far. It gets anything you uploaded, and anything the agent read along the way, like a file or a web page.

00:40 And when a skill starts, the skill’s instructions go in too.

00:45 Most of this doesn’t show up in the chat you see. You might type one short message. The model receives all of it, along with your message.

00:54 The context grows as the conversation goes on, and it can only hold so much. The most a model can take in at once is called its context window. A later lesson shows how a long conversation fills it, and when a fresh start is worth it.

01:09 A model doesn’t remember anything from one conversation to the next. When something seems to carry over, it’s because the app saved it somewhere. Then the app put it back into the context.

01:20 There are three common ways that happens. Custom instructions are something you set once in your settings, and they’re added to every chat. Memory features save short notes about you, like your job or your preferences.

01:33 They add those notes to later chats. And projects, in apps that have them, keep files and instructions together. They send them along with every chat in that project.

01:43 Anything that wasn’t saved is gone when you start a new chat. Say a saved memory notes that you’re preparing a proposal for a client. The memory comes back in your next chat.

01:53 But the proposal itself comes back only if you upload it again.

01:57 Most AI apps have a settings page that shows what they carry from one chat to the next. It often has a name like Memory or Personalization. Everything there goes into the context of every new chat.

02:09 And you can usually edit it, or delete it. So there are two ways to correct something. Telling the assistant fixes only the chat you’re in. A change in the settings carries over to every new chat.

02:21 So the model only knows what’s in the context, and memory is something the app saves and adds back. Below this video, you can step through two days of chat, and see everything the model sees each time.

02:33 Then, in a practice app, you can correct an out-of-date memory, and see what comes back in a new chat.

Become a Member to join the conversation.