CPLOM · Research Notes · 2026-09-19

From Control to Memory

CPLOM as an Architecture for Long-Term Context Organization

Author: Dmitry ChistyakovPublished: Version: 1.0

Abstract

CPLOM developed around a governance problem: how to evaluate and constrain model outputs before they affect an operational system. Its extension to long-term memory applies the same architectural question upstream: how should a system determine which prior information is admissible, relevant, current and sufficient for a new decision? This paper describes a memory architecture that separates persistent Context Storage from the bounded working context of an individual model invocation. Memory objects are organized through a hierarchical metadata index, routed by inexpensive relevance analysis, and assembled into competing evidence contexts. Independent reasoning sessions produce candidate answers that guide further retrieval, including explicit searches for counter-evidence.

The contribution is an architectural synthesis and a set of explicit interfaces and research requirements, rather than a new foundation model or a claim of benchmark superiority. We distinguish retrieval relevance from evidential support, procedural confidence from calibrated probability, and persistent sources from generated hypotheses. We also identify the lifecycle mechanisms needed for memory to remain useful: consolidation, provenance, contradiction handling, temporal validity, aging and controlled forgetting. Small, offline Python examples make the control flow reproducible without disclosing production implementation details.

1. Research lineage: from correction to memory governance

The original CPLOM white paper describes predictive control across coupled logistics layers, with a verification meta-layer between prediction and action. The early deployment account and predictive governance paper develop the importance of representing system state and constraining unstable recommendations. These are the operational origins of CPLOM; memory organization extends that research line beyond its initial logistics setting.

From Correction to Adjudication shifts attention toward competing interpretations and procedural evaluation. Why AI Needs Architecture to Become Infrastructure then separates model capability from the process surrounding a decision. The present paper carries this distinction into the construction of context itself. An adjudicator cannot resolve a disagreement responsibly if every participant receives an incomplete, stale or systematically biased selection of evidence.

Agent-control work, including work motivated by OpenClaw-style autonomous agents, exposed this upstream limitation. Restricting actions does not by itself organize experience accumulated across tasks. This observation does not depend on any particular agent framework succeeding or disappearing. It concerns a persistent systems problem: an agent needs a controlled process for remembering, just as it needs a controlled process for acting.

The extension is therefore continuous: correction governs outputs; adjudication governs competing decisions; memory governance governs the evidence from which decisions can be formed. These functions remain coupled. A retrieved item can be relevant but inadmissible, and a plausible answer can remain unsupported even after several models agree.

2. The context window is working memory, not storage

A context window is the bounded input available to a model during an inference call. It can hold instructions, recent interaction, selected documents and tool results. It does not, by itself, provide durable indexing, provenance, versioning, access control or deletion. Persistent application state and information encoded in model parameters are different mechanisms. Calling all three “memory” obscures the design choices between them.

Increasing the window can be useful, but it does not remove the selection problem. A longer history can contain superseded facts, repeated summaries and incompatible accounts. Even when all text fits, the system must determine which evidence applies. Research on positional sensitivity in long contexts illustrates why nominal capacity and effective use must be measured separately [1]; those results concern the evaluated models and tasks, not a universal limit on every subsequent model.

Let M be persistent memory, q a query, π an access and retrieval policy, and W the selected working context:

W = Select(q, M, π)
tokens(instructions) + tokens(q) + tokens(W) + output_reserve ≤ B

The model-window budget B bounds each session. The size of M is bounded by storage and operational resources, independently of that window. “Potentially unbounded Context Storage” means that there is no fixed model-window ceiling on the number of stored objects. It does not mean infinite hardware, constant-time retrieval or lossless access to every historical detail.

Bytes and tokens are also distinct units. A corpus measured in hundreds of megabytes is not a context-window specification. The relevant operational quantities include indexed objects, selected payload bytes, input tokens per session, aggregate tokens across sessions, and end-to-end latency.

3. Hierarchical Context Storage

Context Storage is a collection of addressable memory objects and an index that describes their contents. Files are one possible representation; database rows or object-store records are equally compatible. The hierarchy provides a navigation structure, while typed links represent relationships that cross branches. A release policy, for example, can apply to several projects without being copied into each project’s history.

Context StoragePersistent index · source IDs · access scope
Projects / AtlasPlans → events → decisions
Object references
Tags · summaries · versions
Policies / ReleasesRequirements → exceptions
Object references
Validity · provenance
Assurance / SecurityReviews → open findings
Object references
Evidence · contradictions
Cross-links: applies-to · supports · contradicts · supersedes
Figure 1. A hierarchy narrows navigation; cross-links preserve relationships between branches. Leaf references lead to original evidence. The figure does not imply loading the entire tree into a model prompt.

A useful memory object has more structure than a text fragment:

Proposed memory object contract
Field groupPurpose
Stable ID, payload reference, version or digestAddress an exact source and detect changes.
Tags, entities, topic path, summaryRoute queries without repeatedly reading full payloads.
Source, author or origin, observation timeTrack where a statement came from and when it was recorded.
Valid-from / valid-to, event timeSeparate what was believed then from what applies now.
Status, confidence annotation, evidence linksDistinguish observation, assertion, hypothesis and derived summary.
Access scope, retention class, deletion stateConstrain retrieval and subsequent reuse.

Index summaries are navigation aids, not substitutes for evidence. A summary can omit a qualification or fail to reflect an update. An evidence-bearing answer therefore resolves source references and checks their versions. Access filtering must apply before routing exposes protected metadata and again before payload use; an inaccessible object must not leak through a branch summary.

Ingestion should validate schema, preserve provenance, identify exact duplicates and update ancestor metadata. A reliable implementation must handle partially updated branches and concurrent writes. Reading against a recorded index snapshot makes an answer auditable even if storage changes during the request. These consistency requirements are separate from the language model’s ability to interpret text.

4. Retrieval and fast-model relevance routing

Routing begins by decomposing a question into entities, topics, time constraints and information needs. Fast models compare these needs with tags and descriptions at successive index levels. They propose branches and candidate objects; deterministic filters enforce access and scope. Payload retrieval and deeper analysis follow only for selected candidates. An implementation can combine lexical, embedding and model-based signals instead of treating any single signal as sufficient.

A conceptual relevance score can be written as:

r(m, q) = α·topic_match + β·entity_match + γ·temporal_fit + δ·task_fit

The terms must be normalized for a chosen task and the coefficients validated on held-out queries. This expression is a reference formulation, not a disclosure of production coefficients. Relevance measures usefulness for the question; it does not certify that a statement is true. Source reliability and claim-level support remain separate attributes.

Hierarchy creates a trade-off. Pruning reduces the amount of metadata examined, but a mistaken branch decision can hide the only decisive source. Useful safeguards include multiple candidate branches, cross-links, targeted broadening when confidence is low, and a reserved exploration budget. Worst-case search can still approach a scan of all indexed metadata. Claims of logarithmic retrieval require assumptions about branch balance and relevance distribution that this paper does not establish.

Parallelism and its actual meaning

The current implementation is reported to permit up to 500 concurrent analysis operations per request. This is a concurrency ceiling, not a guarantee that every query uses 500 operations, that each operation is an operating-system thread, or that every operation reads a full document. Metadata inspection, payload assessment and other analysis can have different resource profiles.

For N independent tasks of equal duration L, an idealized pool of C workers requires approximately ceil(N / C) × L of service time, plus routing and aggregation. Real workloads include unequal durations, queueing, rate limits, retries and shared bottlenecks. Parallel execution reduces elapsed time only where work and capacity permit; it does not remove the aggregate inference and I/O work.

A scheduler needs bounded queues, per-request and global concurrency limits, deadlines, cancellation and backpressure. If 500 requests each admit 500 operations, the resulting demand is not governed by a per-request cap alone. Failed and timed-out analyses must be marked unknown. They cannot be counted as evidence that no relevant information exists.

5. Candidate-context competition and independent reasoning sessions

Retrieving the highest-scoring objects and concatenating them into one prompt is only one policy. CPLOM’s memory architecture instead allows several candidate contexts to compete. Each is a bounded evidence set organized around a different interpretation, time period or source family. The goal is to preserve useful disagreement before one narrative dominates the working context.

Query + scopeQuestion, permissions, time, budget
Hierarchical routingFast relevance analysis over metadata
Bounded parallel retrievalSource payloads, versions, failure records
Context ASupporting evidence
Independent session A
Context BCounter-evidence
Independent session B
Context CAlternative explanation
Independent session C
Evidence adjudicationCompare claims, citations, conflicts and missing evidence
Answer or abstainSupported claims + uncertainty
Refine retrieval ↺Candidate hypotheses become new queries
Figure 2. The retrieval–reasoning loop. Sources remain distinct from generated hypotheses. The final answer and any persistent memory write pass separate gates.

Context assembly is a constrained selection problem. For a candidate set S, an illustrative objective balances relevance, coverage and redundancy:

maximize Σ r(m,q) + λ·coverage(S) − μ·redundancy(S)
subject to token_cost(S) ≤ B_context and access(m, π) = allowed

Coverage may include distinct claims, source families and time periods. A dedicated counter-evidence allocation helps prevent numerous similar supporting records from exhausting the budget. A tokenizer, rather than a byte count, must measure the actual prompt budget. Relevant records that cannot fit remain available for a later pass.

Sessions are independent in the operational sense: they have separate working contexts and produce initial assessments before seeing each other’s candidate answers. This is not statistical independence. Shared models, training data and sources can produce correlated errors. More sessions or different prompts do not automatically create more independent evidence.

Each session should return a compact, inspectable artifact: candidate claims, cited source IDs and versions, explicit assumptions, unresolved contradictions and proposed follow-up searches. The coordinator needs these evidence records, not private internal reasoning traces. It evaluates whether the claims survive source checking and challenge; majority agreement alone is insufficient.

6. Memory inference: retrieval guided by provisional answers

Memory inference, or memory reasoning, denotes inference about what stored information is needed, which records can be used together, and how new evidence changes a candidate conclusion. It includes resolving references, distinguishing event time from record time, following dependencies and identifying gaps. It does not mean that the database itself acquires model intelligence.

Let Hₜ be candidate hypotheses after pass t, Eₜ the retrieved evidence, and Uₜ unresolved information needs:

Qₜ₊₁ = Expand(q, Hₜ, Uₜ, challenges(Hₜ))
Eₜ₊₁ = Eₜ ∪ Retrieve(Qₜ₊₁, M, π)
Hₜ₊₁ = Evaluate(q, Eₜ₊₁)

Candidate answers supply search terms and testable propositions. They are not added to E as if they were external facts. Otherwise, a generated mistake can be retrieved in a later pass and appear to confirm itself. Derived records must retain their status and provenance even when deliberately persisted.

A small worked example

A query asks whether Project Atlas can launch on its planned date. Initial routing finds a launch plan and a capacity check. A provisional answer says the launch is planned, but the plan is conditional on security approval. The next pass searches for both approval and exceptions. It discovers an unresolved security review in a different branch and a release policy stating that such a finding blocks release.

The revised answer distinguishes scheduling from authorization: capacity is available, but the evidence does not authorize launch. The old plan need not be false. Its condition is unsatisfied. Contradiction handling therefore requires temporal and logical interpretation rather than simply deleting the older record or preferring whichever source has the highest relevance score.

Evidence and counter-evidence passes

A supporting pass asks which sources establish each required premise. A counter-evidence pass asks which source would invalidate the answer, reveal an exception, or show that a cited rule no longer applies. An alternative-explanation pass can test whether the same observations support another conclusion. The absence of retrieved opposition is a statement about search coverage, not proof of truth.

Iteration stops when the evidence requirements are satisfied, no materially new sources are found, the candidates remain stable under challenge, or the request reaches its time, token or round limit. A stop caused by exhausted resources should produce an explicit limitation or abstention. Endless refinement is not an acceptable memory policy.

7. Memory organization is a lifecycle problem

Retrieval makes stored information accessible. Organization determines whether that information remains coherent across months of updates. The following mechanisms define the next research agenda; this paper does not claim that all are already complete or validated in production.

IngestSource + time + scope
IndexTags + links + versions
Use and challengeClaims + source checks
ConsolidateDerived records + provenance
Retain or forgetPolicy + dependency updates
Figure 3. Proposed memory lifecycle. Every transition is auditable. Consolidation preserves links to sources; forgetting propagates to dependent summaries and indexes.

Consolidation without erasing qualifications

Exact duplicates can share storage. Semantically similar observations can be grouped, but repeated copies of one source must not be counted as independent corroboration. Consolidated summaries should retain source references, disagreement and temporal scope. Replacing many records with a fluent paragraph can destroy precisely the exception that a later query needs.

Contradiction handling and versioning

A useful relation vocabulary distinguishes contradicts, supersedes, qualifies and applies under different conditions. Two incompatible assertions may both need retention while their conflict is unresolved. A newer record is not necessarily more authoritative, and an authoritative policy can be valid only for a particular period. Conflict resolution should record the applicable rule and evidence instead of silently overwriting a loser.

Confidence, aging and forgetting

Confidence should be represented through separate components: source reliability, directness of evidence, agreement among independent sources, temporal applicability and unresolved conflict. Combining these into a scalar may be convenient for routing, but it becomes a probability only after calibration against labeled outcomes. CPLOM’s historical confidence-oriented governance motivates this requirement; it does not supply an automatic calibration for memory.

Aging is task-dependent. A temporary service status can lose usefulness quickly; a historical event does not become less true because it is old. An illustrative salience decay s(t) = s₀ exp(−κΔt) can prioritize review or retrieval, but it must not be mistaken for truth decay. The decay parameter should depend on record class, with retention requirements enforced separately.

Forgetting includes reversible demotion, archival and policy-driven deletion. Actual deletion requires updating indexes, cached contexts and derived summaries so that removed information is not reintroduced through a secondary representation. Conversely, low retrieval frequency is not sufficient grounds for removing a rare but important exception. The system needs a way to measure both unnecessary retention and consequential forgetting.

Memory weights in this architecture are retrieval and governance metadata. Strengthening a useful association or lowering the salience of an obsolete record does not modify the foundation model’s learned weights. Persistent writes must be governed separately from answer generation: a plausible answer should never silently become a trusted fact.

9. Evaluation protocol and limitations

A convincing evaluation must hold model capability and resource budgets sufficiently constant to isolate memory architecture. An initial study should compare full-history context where it fits, flat lexical or dense retrieval, hierarchical routing, and the same routing with iterative challenge. Fix the answering model and report any additional router models, context limits and total inference work. Compare both matched-resource and unconstrained-quality settings rather than attributing extra compute to architecture alone.

Proposed evaluation matrix — no measured results are asserted
QuestionMeasurementsStress cases
Does routing find decisive evidence?Source recall@k, branch miss rate, payloads readMissing tags, synonyms, cross-branch dependencies
Is the answer supported?Claim-level citation precision, unsupported claims, abstention qualityStrong distractors, repeated copies, insufficient evidence
Does memory respect time?Temporal validity errors, supersession accuracyLate-arriving events, policy revisions, historical questions
Does challenge change weak conclusions?Contradiction detection, correction rate, harmful answer reversalsHidden exceptions, conflicting sources, false hypotheses
Can the system operate within bounds?p50/p95 latency, tokens, I/O, queue depth, timeout and cancellation rateUnequal task durations, concurrent users, partial failures
Does organization preserve useful memory?Summary fidelity, deletion propagation, retention-related recall lossRare exceptions, stale summaries, derived records

Use timestamped corpora with source-level labels and temporally separated development and test sets. Include answerable and deliberately unanswerable questions. Preserve the index version and retrieved source IDs for each run. Report repeated-run variability, judge agreement and uncertainty intervals; automated model judgments should be checked against a human-labeled subset.

Ablations should remove hierarchy, metadata summaries, context diversity, counter-evidence passes and hypothesis expansion one at a time. Model substitution should be a separate experiment. The central hypothesis is that memory organization changes evidence quality even with a fixed reasoning model; this remains an empirical question.

Several failure modes remain fundamental. Bad metadata can conceal a source; several sessions can share a bias; a false hypothesis can narrow search prematurely; a summarizer can erase a qualification. Retrieved content can also contain instructions intended to redirect an agent. Memory payloads must remain untrusted data rather than acquiring the authority of system instructions. A provenance record helps diagnose these failures but cannot make a false source true.

No asymptotic storage claim establishes practical scalability, and the reported concurrency ceiling establishes no latency guarantee. This paper leaves those measurements open.

10. Runnable reference implementations

The companion examples use Python 3.10 or later and only the standard library. They make no network calls and require no credentials. Synthetic records illustrate a plan, a capacity check, an unresolved review and an applicable policy. The implementations are intentionally small enough to inspect.

  1. memory_index.py — typed records and an iterative hierarchical index traversal.
  2. routing.py — tag pruning and metadata relevance scoring.
  3. parallel_relevance.py — a bounded worker pool, timeouts and explicit failure records.
  4. iterative_retrieval.py — hypothesis-guided searches and evidence-driven revision.

Download all examples, README and tests (ZIP) · Reference Implementations

python -B memory_index.py
python -B routing.py
python -B parallel_relevance.py
python -B iterative_retrieval.py
python -B -m unittest -v test_reference

Extract the archive and run these commands inside its directory. Keep all modules together. The README describes expected output and boundaries. Lexical overlap stands in for fast-model scoring, and explicit case-specific rules stand in for hypothesis evaluation. The examples do not implement semantic reasoning, durable storage, calibrated confidence or the complete lifecycle described above. They demonstrate control flow, not production CPLOM or a performance benchmark.

11. Research direction: intelligence and memory architecture

A reasoning model and its memory system solve related but separable problems. The model interprets a bounded context. The surrounding architecture determines what persists, what can be retrieved, what evidence enters that context, and how later discoveries revise earlier conclusions. Better models can improve each stage; they do not eliminate the need to define the stages.

CPLOM’s research direction is to make memory an organized, inspectable part of governed inference. The objective is not to remember everything in every prompt. It is to preserve source information across time while selecting and testing the evidence needed now. Progress should be demonstrated through reproducible improvements in recall, evidential support, temporal correctness and controlled forgetting, rather than through window size or concurrency alone.

References

  1. Liu, N. F., et al. (2023). Lost in the Middle: How Language Models Use Long Contexts.
  2. Lewis, P., et al. (2020). Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks.
  3. Packer, C., et al. (2023). MemGPT: Towards LLMs as Operating Systems.
  4. Sarthi, P., et al. (2024). RAPTOR: Recursive Abstractive Processing for Tree-Organized Retrieval.
  5. Trivedi, H., et al. (2022). Interleaving Retrieval with Chain-of-Thought Reasoning for Knowledge-Intensive Multi-Step Questions.
  6. Gao, L., et al. (2022). Precise Zero-Shot Dense Retrieval without Relevance Labels.
  7. Asai, A., et al. (2023). Self-RAG: Learning to Retrieve, Generate, and Critique through Self-Reflection.

Years above refer to the initial preprints. Earlier CPLOM materials are linked in Section 1 and collected in the publication archive.