> ## Documentation Index
> Fetch the complete documentation index at: https://help.emergent.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# Context Limits

<Info>
  **TLDR:** \
  Context = Everything the AI remembers about your project and conversation. More context = Better understanding = Better results!
</Info>

**Context** in Emergent refers to the **conversation memory and project knowledge** that the AI agent maintains throughout your development session. Think of it as the agent's "working memory" - it includes everything from your conversation history, the code that's been written, architectural decisions made, bugs fixed, features added, and your project requirements.

Emergent uses a structured memory architecture that allows agents to maintain long sessions, preserve technical decisions, and coordinate work across sub-agents. This guide explains how that memory is stored, prioritized, and passed through the system.

### **Standard Context Window**

**All Emergent agents operate with a 200,000 token context limit** as the primary context window.

**What This Means:**

* Sufficient for most full-stack MVP development
* Handles complex conversations with multiple features
* Supports extensive debugging and iteration

<Tip>
  Emergent may reach limits on very complex, long-running projects - which is where Forking comes into play. Read about it [here.](https://emergent.mintlify.app/features/Forking)
</Tip>

## Main Agent Context Architecture

Emergent provides **three** types of main agents. Each one manages memory differently based on its purpose and workload.

| **Agent**    | **Specialization**                               | **Best For**                                            |
| :----------- | :----------------------------------------------- | :------------------------------------------------------ |
| **E1**       | Stable, comprehensive testing (production-ready) | Standard full-stack development with thorough testing   |
| **E1.5**     | Focused, complex long-running tasks              | Extended development sessions requiring sustained focus |
| **E2**       | Thorough and relentless problem-solving          | Complex architectural challenges and difficult bugs     |
| **Mobile**   | Expo/React Native development                    | Mobile app development (paid users only)                |
| **Pro Mode** | Custom agent creation                            | Specialized workflows and custom configurations         |

### E1 Agent (Standard)

**Context Window:** About 200,000 tokens

**Memory Management:** Keeps the complete conversation history until the context limit is near

**Context Retention:** Holds all code changes, architectural decisions, and requirements throughout the session

<Info>
  This agent is best for standard full-stack development with thorough testing
</Info>

### E1.5 Agent (Focused)

**Specialized Context:** Tuned for complex sessions that run for long periods

**Enhanced Memory:** Better at maintaining continuity across extended development cycles

**Context Prioritization:** Organizes memory to support deep problem solving

<Info>
  Best agent for extended development sessions requiring sustained focus
</Info>

### E2 Agent (Comprehensive - Currently in Beta)

**Production Readiness:** Thorough and relentless problem-solving

**Memory Allocation:** Balances historical data with the need for ongoing quality checks

**Best Suited For:** Complex architectural challenges and difficult bugs

<Tip>
  For starting out, E1 is the standard agent - it should be comfortably able to handle most starter to intermediate projects.
</Tip>

## Sub-Agent Context Handling

Sub-agents receive a filtered snapshot of the main agent’s memory so they can operate with a narrow focus.

### Testing Sub-Agents (Backend and Frontend)

**Context Inheritance:** Receive structured summaries from the main agent

**Focused Memory:** Store only testing criteria and conditions

**Limited Scope:** Ignore unrelated parts of the project

### Integration Agent

**API Context:** Holds details about third-party services and configuration

**Service Memory:** Remembers authentication flows and integration patterns

**Specialized Knowledge:** Uses domain-specific context for external systems

### Image Sub-Agent

**Visual Context:** Tracks image requirements and generation parameters

**Asset Memory:** Holds style preferences, sizing rules, and usage patterns

## Context Window Management

Emergent organizes memory to support long sessions while protecting key project details.

<Steps>
  <Step title="Token Limits" icon="coins">
    Main agents have about 200,000 tokens available. Sub-agents work within smaller windows that fit their responsibilities.

    <Tip>
      A warning appears when sessions approach their limit. You can periodically push data to GitHub, or fork the session and continue. More on that later!
    </Tip>
  </Step>

  <Step title="Memory Retention Strategies" icon="brain">
    Full conversation history is maintained until space runs low. When memory must be compressed, only the essential information is preserved. The current codebase is always retained.
  </Step>
</Steps>

## Context Passing Between Agents

Agents cooperate by sharing memory in a structured and predictable way.

### **For Main to Sub-Agents:**

* Summarized project context
* Task-specific details
* The current project state when required

### From Sub-Agents to Main

* Test results, generated assets, or integration output
* Memory updates that become part of the main context
* Full synchronization so the project remains aligned

## Chat Forking for Context Management

Emergent creates new forks when the context approaches its maximum size. Forking preserves essential information and compresses older details. Here's an overview of the parts of your project this feature touches:

<Columns cols={3}>
  <Card title="Preserved Info" icon="info" />

  <Card title="Project Goals" icon="chart-column" />

  <Card title="User Requirements" icon="user" />

  <Card title="Tech Stack" icon="check" />

  <Card title="Current Codebase" icon="code" />

  <Card title="Recent Changes" icon="clock" />

  <Card title="Outstanding Tasks" icon="list-check" />

  <Card title="To-Do Items" icon="clipboard" />

  <Card title="General Cleanup" icon="hammer" />
</Columns>

<Info>
  For more details about Forking, including when to fork and when to start fresh instead, visit the [Forking Section.](https://emergent.mintlify.app/features/Forking)
</Info>
