Skip to content

← all research

Prototype

Virtual Context Windows

A prototype mechanism: treat external storage (files, DB) as an extension of the context window, not a separate retrieval system. The agent reads from disk the way a process reads from swap.


Virtual Context Windows

A virtual context window is not simply a larger context window.

It coordinates three separate systems:

1. Memory storage
   What information exists and how it is represented.

2. Retrieval policy
   When missing information may be needed and which memories to retrieve.

3. Context management policy
   What enters active context, remains an unloaded reference, or leaves the working set.

Traditional virtual memory receives an objective access signal from hardware. Agent memory systems must infer that access semantically.

Virtual Context Windows treat external memory as a software-managed context overlay. Compact references remain outside active context until a learned need-recognition policy - or an explicit agent decision - requests expansion.


What was built

The prototype demonstrates selective, model-initiated expansion of external memory references in CSM.

Implemented:

The prototype does not demonstrate reliable need recognition, adaptive working sets, durable promotion, retrieval correctness, or decay and demotion.


What the prototype exposed

The prototype surfaced three distinct failure modes in the retrieval and context management pipeline.

Semantic need recognition

The agent must infer that unavailable information could affect its reasoning before seeing that information.

This creates three distinct failures:

Threshold tuning can improve retrieval policy, but it cannot eliminate failures caused by imperfect knowledge-gap recognition.

Retrieval waste

Some retrieved context does not contribute to any reasoning step or decision. This is mostly instrumentable: track which references are retrieved but never cited or referenced in downstream reasoning.

Contamination

Wrong, stale, or irrelevant memory can influence reasoning in ways that are not immediately visible. Contamination is more expensive to evaluate than ordinary retrieval telemetry because it requires an arbiter whose reliability must also be measured.

judgment_source:
  human
  evaluator_model
  automated_signal

Next experiments

All four mechanisms below are proposed, not implemented.

Session working-set promotion

Track fault demand over a rolling turn window.

Refault detection

A refault is:

resolved
-> removed from active context
-> requested again shortly afterward

A refault is evidence that the context-management policy - not the memory - was misclassified.

WEAVE graph readahead

When memory M resolves, optionally expose highly ranked one-hop causal neighbors as compact stubs rather than full memories.

Graph readahead is conditional on adjacency lookup remaining within the retrieval budget. High-frequency paths may require cached or precomputed neighbor summaries.

Utilization tracking

Classify retrieved references as:


Importance timescales

Two different signals must be distinguished.

Session working-set importance

Represents temporary task locality. Possible signals:

Durable importance

Represents demonstrated value across sessions. Possible signals:

The invariant:

Retrieval event
    -> session evidence
    -> promotion proposal
    -> independent evaluation
    -> possible durable update

Never:

fault -> important forever

Cross-session aggregation thresholds - session count, decay window, evidence confidence, and minimum usefulness - are experimental parameters derived from held-out session evaluation rather than settled architectural constants.


Failure model

Failure modeMeaningObservability
Semantic missRelevant memory was not requestedEvaluation required
Retrieval wasteRetrieved context did not contributeMostly instrumentable
RefaultPreviously resolved context had to be loaded againAutomatic
Retrieval contaminationWrong, stale, or irrelevant memory influenced reasoningRetrospective judgment
Promotion driftTemporary locality became unjustified durable importanceGovernance evaluation
Promotion cyclingA reference repeatedly promotes, decays, refaults, and promotes againAutomatic lifecycle telemetry

Not all metrics are equally objective or equally cheap to collect.


Lifecycle stability

Hysteresis is the proposed stabilization shape:

promotion threshold
    >
retention threshold
    >
demotion threshold

Future lifecycle metrics:

promotion_cycle_count
time_between_promotion_and_demotion
time_between_demotion_and_refault
post_promotion_usefulness
rollback_frequency

These thresholds are not validated. They require independent evaluation.


Evaluation target

Recover X% of manually labeled consequential context gaps within N reasoning steps while keeping irrelevant retrieved context below Y%.

Supporting benchmark outputs:

X, N, Y, promotion thresholds, decay windows, and hysteresis boundaries are experimental parameters derived from held-out session evaluation.


Implementation status

MechanismStatusCurrent or initial policy
Compact unresolved referencesImplementedReturned through csm_reentry_preview
Specific-reference resolutionImplementedcontext_fault
Semantic memory retrievalImplementedcontext_search
Eager production injectionImplementedRemains the default path
Refault telemetryProposedDetect repeated load after context removal
Session working-set promotionProposedNo production threshold selected
WEAVE neighbor stubsProposedBounded, latency-budgeted one-hop summaries
Retrieval utilization trackingProposedEvidence-linked outcome classifications
Durable promotion proposalsAspirationalEvidence schema and aggregation policy required
Promotion governorAspirationalManual approval for the earliest implementation
Decay and demotionAspirationalNo automatic decay in the initial version
Retrieval-contamination evaluationResearch-onlyHuman-labeled or judge-labeled benchmark sets
Promotion-governance evaluationResearch-onlyValidate promotion, retention, demotion, cycling, and fast-refault behavior on held-out sessions

The current prototype implements selective reference resolution. Adaptive working sets, graph readahead, promotion governance, contamination evaluation, hysteresis, and durable decay are not current CSM behavior.


Scope boundary

The prototype demonstrates selective, model-initiated context retrieval. It does not solve semantic need recognition or durable knowledge governance. Those are separate research problems exposed by the prototype, not capabilities already delivered by it.

Future document

Adaptive Memory Governance - a separate specification that will own evidence schemas, promotion proposal records, evaluator authority, commit and rollback rules, decay functions, hysteresis benchmarks, judge reliability, cross-session aggregation, and promotion-drift audits.