brianletort.ai
Zenodo preprints

Context Compilation Trilogy

Enterprise AI needs a full context stack, not just retrieval and longer windows. This research program starts with a foundational paper that introduces Context Compilation Theory, then continues with a three-paper trilogy that splits the stack into representation and semantics, runtime and lifecycle, and optimization and efficiency. Companion code and manuscripts live in the MemoryOS GitHub repo.

foundational theory -> IR/compiler -> runtime/lifecycle -> quantized context

PDFs and DOIs on Zenodo · manuscripts and code on GitHub.

Reading order
How to read the four-paper program
A four-paper view of enterprise context systems: the foundational theory paper establishes the frame, then the trilogy extends it through representation, runtime, and precision-aware optimization.

Step 1

Start with the foundational paper

Use the precursor theory paper for motivation, definitions, and the original framing of Context Compilation before moving into the trilogy.

Step 2

Read the trilogy in order

Paper 1: representation and semantics

Paper 2: runtime and lifecycle

Paper 3: optimization and efficiency

The detailed paper cards below are the canonical place to open the three trilogy papers, Zenodo records, and manuscript links.

Where to start
Precursor and companion code
Start with the foundational paper for motivation and definitions. Then read Paper 1 for the IR and compiler formalization, followed by Papers 2 and 3 for runtime and precision control.

Precursor theory paper

Toward a Theory of Context Compilation for Human-AI Systems

Precursor theory paper. Start here for motivation and definitions, then read the trilogy hub for the full IR -> runtime -> quantization stack.

Companion repo

Manuscripts and code live in MemoryOS on the context-compilation-paper branch.

Trilogy papers

Read each paper directly on its research page, jump to Zenodo for the stable DOI artifact, or open the GitHub-readable manuscript in the companion repo.

Paper 1Representation and semantics
Defines a four-level Context IR, a taxonomy of compiler passes for enterprise context pipelines, formalizes context graph breaks, and treats governance as intrinsic to compilation through policy-as-types and a portable Context ABI.
DOI: 10.5281/zenodo.19546798
Paper 2Runtime and lifecycle
Treats context as a semantic runtime: evidence blocks, working sets, locality, paging-style discipline, prediction and speculation, context GC, linking, and provenance as a causality graph with policy-preserving lifecycle transitions.
DOI: 10.5281/zenodo.19546800
Paper 3Optimization and efficiency
Reframes compression as precision control with mixed-precision context assembly, distortion typing, semantic outlier protection, and recovery paths so systems stay cheap until risk demands higher fidelity.
DOI: 10.5281/zenodo.19546802