Delivering Long-Running Workflows Without Losing Context

Smarter Context, More Reliable AI

AI assistants are moving beyond isolated questions and short conversations. Customers increasingly rely on them for long-running development tasks, document analysis, research, troubleshooting, and workflows involving multiple files, tools, and decisions.

As these interactions grow, so does the amount of context the AI must process. Requirements, attachments, code, validation results, earlier decisions, and conversational history all compete for a finite context window.

Context compaction helps solve this problem by reducing lower-value historical material while preserving the facts and instructions required to continue safely.

Across our evaluated semantic-compaction benchmark scenarios, Cortex reduced eligible supplemental context by 46% while maintaining complete required-fact recall and successful source retrieval.


Why context management matters

Long conversations create several challenges:

  • Important requirements can become buried beneath repetitive content.
  • Earlier decisions may conflict with newer instructions.
  • Large attachments and tool outputs can consume substantial context.
  • Similar identifiers and file paths can become confused.
  • Generic summaries can omit critical details or introduce unsupported claims.
  • Eventually, an interaction can approach the model’s context limit.

Simply retaining everything is inefficient. Indiscriminately deleting older material is unsafe.

Effective context management must retain the information that determines correctness while reducing material that no longer needs to appear in full.


A 46% reduction in eligible supplemental context

Across the benchmark scenarios that activated compaction, the evaluated workload contained 192,776 characters of eligible supplemental context.

After compaction, 103,384 characters remained.

That represents:

  • 46% less eligible supplemental context
  • 89,392 characters removed
  • Compaction activated only when the workload exceeded its configured threshold

This reduction creates more room for current instructions, new files, validation evidence, and future conversation turns.

The measurement applies specifically to context eligible for compaction. Current customer instructions, protected facts, recent conversation, safety information, and references to authoritative sources remain available.


Context efficiency without sacrificing correctness

Reducing context is useful only when the assistant continues to understand the task correctly.

A smaller prompt is not an improvement if the assistant forgets a constraint, modifies the wrong file, restores an obsolete decision, or invents content from a missing source.

The benchmark therefore evaluated semantic fidelity alongside context reduction.

The scenarios included:

  • Exact facts that had to remain available
  • Similar technical identifiers
  • Precise paths and configuration values
  • Decisions that were later reversed
  • Large retrievable sources
  • Irrelevant conversational padding
  • Untrusted prompt-like content
  • Recall questions after compaction occurred

Across these scenarios, the system achieved:

  • 100% required-fact recall
  • 100% retrieval success
  • Zero unsupported facts
  • Zero contradictions
  • Zero stale decisions
  • Zero protected-fact losses

These results show that context reduction did not come at the expense of the information required to continue the evaluated workflows.


Protecting customer intent

Not every piece of context has equal importance.

The customer’s current request, explicit constraints, active decisions, exact identifiers, and authoritative source references must remain dependable throughout the workflow. These elements form protected context.

Compacted memory can supplement protected context, but it should never override it.

This distinction helps prevent common long-context failures:

  • Following an instruction the customer later reversed
  • Forgetting a required validation step
  • Confusing similar file paths or identifiers
  • Treating generated memory as more authoritative than the latest request
  • Claiming that a file was modified when no valid modification occurred
  • Reconstructing unavailable source material from uncertain memory

The evaluated scenarios recorded zero protected-fact losses and zero stale-decision errors.

For customers, this means a long-running interaction can remain aligned with the latest version of the task.


Retrieval instead of invention

Attachments, source files, and tool results can be too large to include fully in every subsequent model request.

Retaining all of that material indefinitely would consume context that could otherwise support new work. Removing it without preserving access would create a different problem: the assistant might attempt to reconstruct missing details.

A safer customer experience preserves awareness of authoritative source material and retrieves it again when exact information is required.

The benchmark recorded a 100% retrieval success rate across the evaluated retrieval scenarios.

This is especially valuable for workflows involving:

  • Source-code repositories
  • Technical specifications
  • Large documents
  • Build and test logs
  • Security evidence
  • Compliance records
  • Data exports
  • Extended tool output

The assistant can continue reasoning about the task without repeatedly carrying every source in full—and without pretending to remember information that must be retrieved.


Respecting decisions that change

Real work is rarely static.

Customers revise requirements, replace technical approaches, rename files, change deployment targets, and reverse earlier decisions. Long-running AI systems must understand that the newest valid decision supersedes the old one.

Weak context summarization can merge conflicting decisions or preserve both as active. This creates stale-decision risk: the assistant may confidently act on a choice the customer already abandoned.

The benchmark explicitly evaluated decision reversal and recorded:

  • Zero stale decisions
  • Zero contradictions

This supports more dependable multi-turn planning and reduces the need for customers to repeatedly restate their latest instructions.


Guarding against unsupported facts

Semantic memory can appear structurally correct while still containing unsupported information.

For example, a summary might preserve the correct file path but invent an implementation detail, combine two unrelated decisions, or present an assumption as confirmed fact.

That is why semantic quality must measure both recall and precision.

The evaluated scenarios achieved:

  • 100% required-fact recall
  • Zero unsupported facts

This combination is important. Perfect recall is not trustworthy if additional claims are invented, while zero unsupported facts is not useful if the assistant simply omits everything.

Reliable context management requires both coverage and evidence alignment.


Maintaining task and validation quality

Context optimization must not reduce the system’s ability to complete work.

Across the evaluated workflow:

  • Task success remained at 100%
  • Validation success remained at 100%
  • Context-overflow errors remained at zero
  • Fallback events remained at zero

The assistant retained the information necessary to complete the evaluated tasks and satisfy their validation requirements.


No observed foreground latency regression

Context compaction also needs to avoid adding noticeable delay to customer interactions.

The measured latency comparison showed:

  • Median latency changed from 2.60 seconds to 2.58 seconds
  • 95th-percentile latency changed from 4.35 seconds to 4.31 seconds

These changes are best interpreted as stable foreground performance rather than a material speed improvement.

The customer-facing result is that the evaluated context reduction introduced no observed foreground latency regression.


Understanding the token tradeoff

While eligible supplemental context decreased by 46%, total model input increased by approximately 3% in the benchmark comparison.

This reflects the distinction between raw context reduction and safe context management.

Whole-turn input includes more than historical conversation. It may also include protected instructions, retrieval references, safety information, and semantic safeguards required to preserve correctness.

The system therefore used a small amount of additional structured context while removing a much larger amount of lower-value supplemental material.

The accurate customer-facing claim is:

Cortex reduced eligible supplemental context by 46% while preserving complete required-fact recall and retrieval success.

The result should not be described as 46% fewer total model tokens.


Operational visibility without exposing customer content

Enterprise AI systems require measurable behavior.

Teams need to know when context was reduced, whether important information remained available, whether authoritative retrieval was required, and whether quality checks succeeded.

Useful operational signals include:

  • Compaction activation
  • Eligible context before and after compaction
  • Required-fact recall
  • Retrieval success
  • Protected-context retention
  • Contradiction detection
  • Stale-decision detection
  • Unsupported-fact detection
  • Fallback activity
  • Context-overflow rates
  • Foreground latency

These measurements provide visibility into system behavior without requiring raw customer content to appear in operational reporting.


What customers gain

Reliable semantic compaction creates a foundation for assistants that can support larger and longer-running workflows.

Customer benefits include:

  • Longer conversations with stronger continuity
  • More room for current instructions and new work
  • Better handling of large files and tool results
  • Lower risk of obsolete decisions resurfacing
  • More dependable recall of constraints and identifiers
  • Safer use of retrievable source material
  • Reduced context-pressure risk
  • Stable foreground performance
  • Greater confidence in multi-step workflows

The objective is not simply to shorten prompts. It is to preserve the right information, retain access to authoritative evidence, and keep the assistant aligned with the customer’s latest intent.


Benchmark summary

Across the evaluated semantic-compaction scenarios, Cortex delivered:

  • 46% reduction in eligible supplemental context
  • 89,392 fewer retained characters
  • 100% task success
  • 100% validation success
  • 100% required-fact recall
  • 100% retrieval success
  • Zero unsupported facts
  • Zero contradictions
  • Zero stale decisions
  • Zero protected-fact losses
  • Zero context-overflow errors
  • Zero fallback events
  • No observed foreground latency regression

The benchmark demonstrates that meaningful context reduction can coexist with semantic fidelity, source integrity, and stable customer-facing performance.

Scroll to Top