Published on March 18, 2026

Как ИИ-агенты остаются в контексте длинных задач

How Cursor Taught AI to Remember Long Contexts

Cursor took an unusual approach to training its AI assistant: self-summarization became part of the training process, not just a supporting tool.

Development 4 – 6 minutes min read
Event Source: Cursor AI 4 – 6 minutes min read

When you're working on a large project in a code editor, tasks are rarely completed in just a few steps. You often have to go through several files, adjust the architecture, find a bug, and then return to where you started. It's a long process – and this is precisely where AI assistants traditionally run into problems.

The Cursor team encountered this issue while developing their Composer agent and found a way to get around it – not by increasing the model's memory, but by changing how it's trained.

Контекстное окно языковых моделей и их ограничения

The Context Window – Not Just a Technical Limit

Every language model has what's called a «context window» – roughly speaking, the amount of information it can hold «in its mind» at one time. Imagine reading a book but only being able to keep the last 50 pages in your head. Everything that came before no longer affects your conclusions.

For short tasks, this isn't critical. But when an agent is working on something complex – a long chain of actions, a major refactoring, multi-stage debugging – the useful history quickly exceeds this window's limits. And the model starts to «forget» earlier steps, lose the thread of the task, and repeat itself.

One common way to combat this is summarization: the agent periodically compresses its action history into a brief summary to free up space for new steps without losing the essence of what has already been done. Composer does exactly this – it can condense previous actions into a compact description and continue working from there.

Sounds reasonable. But this is where a non-obvious problem arises: how does the model know how to summarize correctly?

Ограничения обучения ИИ-амоделей на коротких траекториях

When a Model's Training Doesn't Match Its Task

Agents are usually trained on trajectories – sequences of actions that have led to a correct result. But the length of these trajectories is limited by that same context window. Anything that falls outside its scope simply isn't included in the training.

This creates a vicious cycle: the model learns to work with short histories but in practice has to deal with long ones. In such a setup, summarization exists on its own – its quality is in no way linked to how well the agent ultimately performs the task.

Simply put: a model can learn to create elegant summaries that, in reality, don't help it see the task through to completion.

Интеграция суммаризации в процесс обучения ИИ-моделей

The Idea: Make Summarization Part of the Training

The Cursor team proposed a different approach. Instead of treating summarization as an auxiliary function, they built it directly into Composer's training process.

Here's how it works conceptually. You take a long trajectory – one that doesn't entirely fit within the context window. It gets broken down into parts. The first part is «condensed» into a summary. Then, the model is trained to continue the task based on that summary – and so on down the line.

The key insight is this: the quality of the summarization is now evaluated not in the abstract, but by how well the model handles the rest of the task. If a summary is inaccurate or omits important details – the model will stumble on subsequent steps. This itself is the training signal.

Thus, the model learns not just to retell its action history, but to do so in a way that the retelling is actually useful for continuing the work.

Важность решения проблемы контекста для ИИ-агентов

Why This Is Important Right Now

As AI agents take on increasingly complex tasks, the ability to work with long horizons is becoming crucial. An agent that « forgets» the context after 20 steps simply won't be able to handle a serious engineering task.

Increasing the context window is one path, but it's expensive and has practical limitations. Teaching a model to efficiently compress and use its own history is another path and, by all appearances, a more flexible one.

Cursor's approach is interesting because it doesn't require a fundamentally new architecture. It's more of a change in training logic: summarization ceases to be an «add-on» and becomes part of what the model is graded on.

Будущие перспективы метода суммаризации для ИИ-агентов

What Remains Unclear

For now, this is an approach described in a company blog post, not an independently verified result. How well it works in practice – outside of test conditions, on real projects with unpredictable structures – remains to be seen.

It's also an open question how well the model handles very long chains – when there are multiple summaries, and each subsequent one builds on the last. Errors here could accumulate.

Nevertheless, the direction seems logical. Agents that know how to «remember» correctly will be able to take on more complex tasks – and see them through to the end.

Original Title: Training Composer for longer horizons
Publication Date: Mar 17, 2026
Cursor AI cursor.com A U.S.-based AI-powered code editor assisting developers with writing and analyzing code.
Previous Article Gensyn Introduces REE – An Environment for Reproducible AI Computations Next Article Midjourney V8 Alpha: What's New in the Latest Version

Related Publications

You May Also Like

Explore Other Events

Events are only part of the bigger picture. These materials help you see more broadly: the context, the consequences, and the ideas behind the news.

AI: Events

How to Train AI on Million-Token Texts: A Game-Changing Idea

Technical context Infrastructure

Researchers have proposed a method for distributing the processing of ultra-long texts across multiple GPUs, allowing models to be trained on contexts of up to one million tokens.

Hugging Facehuggingface.co Mar 10, 2026

From Source to Analysis

How This Text Was Created

This material is not a direct retelling of the original publication. First, the news item itself was selected as an event important for understanding AI development. Then a processing framework was set: what needs clarification, what context to add, and where to place emphasis. This allowed us to turn a single announcement or update into a coherent and meaningful analysis.

Neural Networks Involved in the Process

We openly show which models were used at different stages of processing. Each performed its own role — analyzing the source, rewriting, fact-checking, and visual interpretation. This approach maintains transparency and clearly demonstrates how technologies participated in creating the material.

1.
Claude Sonnet 4.6 Anthropic Analyzing the Original Publication and Writing the Text The neural network studies the original material and generates a coherent text

1. Analyzing the Original Publication and Writing the Text

The neural network studies the original material and generates a coherent text

Claude Sonnet 4.6 Anthropic
2.
Gemini 2.5 Pro Google DeepMind step.translate-en.title

2. step.translate-en.title

Gemini 2.5 Pro Google DeepMind
3.
Gemini 2.5 Flash Google DeepMind Text Review and Editing Correction of errors, inaccuracies, and ambiguous phrasing

3. Text Review and Editing

Correction of errors, inaccuracies, and ambiguous phrasing

Gemini 2.5 Flash Google DeepMind
4.
DeepSeek-V3.2 DeepSeek Preparing the Illustration Description Generating a textual prompt for the visual model

4. Preparing the Illustration Description

Generating a textual prompt for the visual model

DeepSeek-V3.2 DeepSeek
5.
FLUX.2 Pro Black Forest Labs Creating the Illustration Generating an image based on the prepared prompt

5. Creating the Illustration

Generating an image based on the prepared prompt

FLUX.2 Pro Black Forest Labs

Don’t miss a single experiment!

Subscribe to our Telegram channel —
we regularly post announcements of new books, articles, and interviews.

Subscribe