PTENES
Skip to content
MODULE 1.4

🧠 Context, memory, and the harness

Have you noticed that AI sometimes seems forget what did you say at the start of the conversation? Here you’ll understand why this happens — and learn to keep the agent focused and on track, without magic or technical terms.

6
Topics
~40
Minutes
Basic
Level
Theory
Type
Progress in this module0%

0 of 6 sections read

💡 New here? Four words before you start

  • Context — everything the AI has “in its head” in that conversation: what you said and what it has already done.
  • Context window — the size of this "head." It can hold a lot, but not infinitely.
  • Memory — notes that stay saved between conversations (different from context).
  • Harness — the structure around the AI: tools, memory, and rules. The “car” the engine is built into.
1

🗒️ What "context" means

Context it’s everything AI has “in its head” at that moment in the conversation: what you wrote, what it has already replied, the files you showed it, and the steps it has taken. It’s the short-term memory of that conversation — like what you remember from a conversation that’s still happening.

Here’s a simple, powerful rule: good context = good answers. If you give it a clear goal, examples, and what matters, AI hits the target. If you dump everything in messily and halfway, it guesses—and that’s not its fault; the context is weak.

🔑 The central idea

Think of someone new who arrived to help you today:

  • •Without context: "make a report" → it doesn’t know what it should be about, who it’s for, or what format to use.
  • •With context: "make this month’s sales report for tomorrow’s meeting, in 1 page" → now it gets it right on the first try.

✓ Good context

  • ✓Clear goal and who will use it
  • ✓An example of what you want
  • ✓What matters and what to ignore
  • ✓Response format and length

✗ Messy context

  • ✗Vague request: "help me with this"
  • ✗Mixing 5 topics in the same conversation
  • ✗Forget to state the final objective
  • ✗Don’t give any examples

Key concepts

📌 Context = memory of the conversation
📌 Good context = good answers
📌 Goal + example + format
📌 Vague in, vague out
2

🪟 Why AI forgets

The AI’s “head” has limited capacity. This limit has a name: context window. Imagine a window that the text of the conversation flows through. It can hold a lot — but not an infinite amount.

When a conversation gets too long, the oldest information starts to be pushed out at the edge of the window. That’s why AI “forgets” what you said at the beginning: it’s not inattentive — there simply isn’t room for everything at once anymore.

The context window what the AI has “in its head” right now ✓ remembered text new ✗ forgotten (went out of scope)
New text comes in from the right; the old text is pushed past the left edge and “falls out.” The AI can no longer see what left the window — that’s why it seems to have forgotten.
Illustration of a glowing window where streams of text enter from one side and older fragments dissolve along the opposite edge — a metaphor for the context window's limited size.
The context window, shown as an image: too much comes in one side and spills out the other. A conversation that's too long loses its beginning.

💡 Practical tip

If the AI starts contradicting itself or “losing the thread” in a long conversation, don’t argue with it. Start over in a new conversation and paste back only what matters. A clean window means full attention on what’s important.

Key concepts

📌 The “head” has limited size
📌 This is called context window
📌 Long conversations push the beginning out of view
📌 Forgetting ≠ carelessness
3

💾 Long-term memory

Context disappears when you close the conversation. But there’s another layer: the long-term memory. These are notes that AI keeps outside from the conversation to remember your preferences between different conversations—today, tomorrow, next week.

That’s exactly what makes an assistant seem like it knows. It notes “speak to me in Portuguese,” “prefers short answers,” “my business is a clothing store” — and you don’t have to repeat everything. That’s what makes the Jarvis for Track 3 to work.

📊 Context vs. memory—don't confuse them

  • •Context = what the AI remembers within of the current conversation. It disappears when you close it.
  • •Memory = notes that stick around between the conversations. It still applies tomorrow.
  • •Analogy: context is what you have on the table right now; memory is the notebook in the drawer.

The two work together: memory refreshes the context with what matters every time you come back to chat.

💾 Memory "speak in Portuguese", "short answers"... Today's conversation already knows you ✓ Tomorrow's conversation don’t need to repeat ✓
Memory is the notebook in the drawer: it supplies each new conversation with what you've already shared. That's what makes AI "know you."

💡 Practical tip

When you notice you’re repeating the same instruction every conversation (“respond in Portuguese, be direct”), ask the AI to save this to memory. You instruct it once, and it applies that instruction from then on.

Key concepts

📌 Memory = notes between conversations
📌 Save your preferences
📌 It’s what makes Jarvis get to know you
📌 Instruct once, it applies every time
4

🏗️ What is a harness

AI on its own is like a engine: powerful, but on its own it won’t get anywhere. The harness (pronounced "harness") is the chassis — the whole car built around the engine: the place where the tools, a memory and the rules that organize the work.

That’s why the same AI can deliver much more or much less depending on where it’s set up. A good harness gives AI the right tools, reminds it of what matters, and keeps it within the rules — helping an ordinary AI deliver like a pro.

🔑 Engine vs. car

Same engine, very different results:

  • •Engine on its own (pure AI): responds well, but has no tools and doesn’t remember anything between tasks.
  • •Engine in the car (AI in the harness): has a steering wheel, brakes, GPS, and a trunk—it becomes an agent that handles the whole trip.
The harness: the car around the engine HARNESS (the chassis / car) ⚙️ AI (engine) 🔧 tools 💾 memory 📏 rules
AI is the engine (⚙️). The harness is the whole car: tools, memory, and rules built around it. A good harness makes an ordinary engine perform much better.

💡 Practical tip

When someone says “this AI is better than that one,” be a little skeptical: often the difference isn’t in the engine, but in the harness around it. The same AI in a better car can go much farther.

Key concepts

📌 Harness = chassis around the AI
📌 Combines tools + memory + rules
📌 AI = engine; harness = car
📌 A good harness multiplies the result
5

🧭 Keep it from getting lost

In long tasks, the biggest risk isn't the AI "getting a calculation wrong" — it's get bogged down: going in circles, forgetting the goal, redoing what was already done. Three simple things prevent this: clear goal, small steps e checks along the way.

It's the same idea as a trip: you state the destination (goal), break it into segments (small steps), and check the map from time to time (checkpoints). That way, the agent won't risk getting lost along the way.

1

🎯 Clear objective

Say where you want to get and how you’ll know you’ve arrived. Without a destination, the agent wanders.

2

🪜 Small steps

A big task broken into short steps is easier to track — and fix.

3

✅ Check along the way

Ask it to stop and check: "does this still meet the goal?" It's the task's GPS.

💡 Practical tip

For a long task, ask AI to make a step-by-step plan before starting. You read the plan, adjust it, and only then let it execute. An agreed-upon plan is the best guardrail against “getting lost.”

Key concepts

📌 Real risk = get bogged down, don't get the math wrong
📌 Clear goal = destination
📌 Small steps = excerpts
📌 Checks = verifying the map
6

✅ Best practices for beginners

You don’t need to understand the engine under the hood to drive well. Three small habits solve 90% of context problems: one conversation per task, give examples e start over with a clean slate when things get tangled.

✓ Do it this way

  • ✓One conversation for each task
  • ✓Give an example of the result you want
  • ✓Start fresh when things get tangled
  • ✓State the goal right at the beginning

✗ Avoid this

  • ✗Mixing 4 topics in the same chat
  • ✗Sticking with a conversation that's already a mess
  • ✗Ask for everything at once, without an example
  • ✗Assume it “should remember” what left the window

🧪 Try it now: provide good context (3 minutes)

Goal: learn how to open a task with good context instead of throwing in a vague request. Paste the text below into Claude or ChatGPT, replacing the parts between < >.

Antes de responder, confirme que entendeu, repetindo de volta:
- meu objetivo é <o que você quer no final>
- o contexto é <quem vai usar, situação, restrições>
- o formato que eu quero é <ex: lista, 1 página, e-mail>

Se algo estiver faltando, me faça até 3 perguntas curtas
antes de começar. Só depois disso, mãos à obra.

How to know it worked: AI should repeat your goal in its own words and, if anything is missing, ask before taking action. Once it confirms the context, you’ve already secured half the result.

💡 Practical tip

Small habits greatly improve the result. Start with just one: "one conversation per task". That alone clears up much of the context confusion, without you needing to understand anything under the hood.

✋ Before you continue — why does AI sometimes "forget" the beginning of a long conversation?

🎓 Module summary

✓
Context is the conversation's memory — and good context leads to good answers.
✓
The context window is limited — that’s why the AI “forgets” the beginning of long conversations.
✓
Memory carries over between conversations — this is what helps Jarvis get to know you.
✓
The harness is the car — and an objective + steps + checks keep the agent on track.

Next module:

1.5 — 🩺 The human advantage: what only you bring to the table — and AI can't copy.