# Auto Context Summarization

PureCode AI keeps your conversations running smoothly — even as they grow and reach the model’s context limit. It automatically summarizes older messages to free up space and maintain context, helping you stay productive without restarting your session.

Here’s how this intelligent summarization works and how you can use it to stay efficient in the same session.

### How summarization works <a href="#how-summarization-works" id="how-summarization-works"></a>

When conversations grow longer, they exceed the model's context window limit:

<div data-with-frame="true"><figure><img src="/files/TFCAN8u4G8z0F3ldftnS" alt=""><figcaption></figcaption></figure></div>

To solve this, PureCode AI summarizes older messages to make room for new conversations.

<div data-with-frame="true"><figure><img src="/files/3dEWZYA6IEj15m0n5rdP" alt=""><figcaption></figcaption></figure></div>

#### Explanation:

PureCode AI monitors token usage during your conversation. When you’re getting close to the limit,&#x20;

1. Creates a comprehensive summary of everything that’s happened
2. Preserves all the technical details, code changes, and decisions
3. Replaces the conversation history with the summary
4. Continues exactly where you left off

You’ll see a summarization toast when this happens, showing the number of chat messages got summarized.

<div data-with-frame="true"><figure><img src="/files/uZxG3FQecv5zShYTp3DZ" alt=""><figcaption></figcaption></figure></div>

#### Common Question's: <a href="#cost-considerations" id="cost-considerations"></a>

<details>

<summary>How does PureCode AI manage long chats?</summary>

It automatically summarizes older messages when your conversation nears the model’s limit, keeping context intact.

</details>

<details>

<summary>Will I lose details during summarization?</summary>

No. PureCode AI ensures that all key information—including technical details, code changes, and important decisions is preserved. The summary is designed to capture the essence of your conversation so you can continue seamlessly without missing anything important.

</details>

<details>

<summary>Can I summarize manually?</summary>

Not yet. Currently, summarization happens automatically when your conversation approaches the model’s limit. However, the ability to manually trigger a summary is on our roadmap and will be available soon, giving you more control over managing your chat context.

</details>

<details>

<summary>Why is summarization needed?</summary>

Every AI model has a context limit—the maximum amount of conversation it can “remember.” Summarization helps manage this limit by condensing older messages, keeping your session running smoothly and ensuring that you can continue working without interruptions or losing context.

</details>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://purecodedocs.gitbook.io/docs/features/auto-context-summarization.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
