> ## Documentation Index
> Fetch the complete documentation index at: https://docs.alpha.isaree.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Context window

> The short-term memory of an AI — everything it can actively read and reason with at one time.

The **context window** is the AI's short-term memory. It is the total amount of information — messages, documents, instructions, and history — that an AI can actively hold and reason with during a single session.

A helpful way to think about it: imagine a WhatsApp group chat. Everything that has ever been written in that chat is available to anyone reading it. When you make a decision or reply to a question, you are drawing only on what is visible in that chat window — nothing outside it. If a conversation from six months ago is still in the thread, you can scroll back and reference it. If it was deleted or never added to the chat, it simply does not exist for the purposes of that conversation.

An [Agent](/concepts/agent) works the same way. It can only reason with what is inside its context window. Information outside the window — even if it exists somewhere in the system — is not accessible to the AI during that session.

## How context shapes clinical answers

Because the context window acts as short-term memory, it enables the AI to maintain continuity across a patient encounter. When a patient's previous visit notes, current medications, and active problem list are all loaded into the context window, the AI can answer questions like "summarize the last three visits" or "what medications were changed since the last appointment" without you having to manually look anything up.

In Isa, each patient has their own dedicated conversation thread. As the encounter progresses, the AI draws on the messages, notes, and structured data that have been added to that patient's thread — not a generic or shared memory.

<Info>
  When a patient's thread grows long enough to fill the context window, Isa automatically compacts older turns into a summary so the session can continue. The Summarisation Prompt in [Settings](/isa/settings) controls how that summary is structured — the default uses a clinical template.
</Info>

## Pulling in other agents

Just as you can add new participants to a WhatsApp group chat to bring in their knowledge and perspective, the [Primary Agent](/isa/primary-agent) can **pull in other agents** during a session. A specialized agent has its own defined role — for example, a Medication Safety Agent or a Referral Drafting Agent. When the Primary Agent determines that a task falls within a specialized agent's expertise, it invokes that agent to handle that specific part of the workflow.

This means complex, multi-step clinical tasks can be handled by a coordinated team of specialized agents, each contributing within its defined scope, all within a single patient-centric session.

## Context costs memory

For [on-device](/concepts/on-device-vs-cloud) models, the context window is also what drives the [RAM](/concepts/ram-device-memory) requirement. The model needs working memory for every token it holds, so the same model needs more RAM the longer its context window — a \~3 GB model can need an 8 GB device for a short context and a 16 GB device for a long one. That's why the Community Hub's model picker sizes models by context, not by download size — see [Choose a model](/guides/choose-a-model).

## What this means in practice

* **Complete patient picture:** A patient-centric context window means the AI has access to critical details hidden deep in the conversational patient history — not just the most recent note.
* **Continuity of care:** Because each patient's conversation thread carries forward across visits, the AI can track changes over time and surface relevant historical information at the right moment.
* **Controlled scope:** The AI reasons from the content in the thread — your patient's specific history and any documents you have added — rather than generic knowledge.

## Next

<CardGroup cols={2}>
  <Card title="Primary Agent" icon="user-tie" href="/isa/primary-agent">
    See how the Primary Agent coordinates Agents in a session.
  </Card>

  <Card title="Choose a model" icon="compass" href="/guides/choose-a-model">
    Pick a model with an appropriate context window for your workflow.
  </Card>
</CardGroup>
