Compilation is the step between what a person wrote and what an agent receives.

```text
Narrative knowledge
        |
   decomposition
        |
  grounded atoms
        |
    validation
        |
 completeness gate
```

It is not summarization. A summary is a shorter version of the same prose, and a shorter paragraph has exactly the same problem as a long one: nothing in it says which sentence is a requirement.

## Decomposition

The local model reads a memory, a rule or a skill and works out what it says operationally. The output is a set of typed atoms, in the [eight primitives](/docs/intelligence/knowledge-ir), rather than a rewritten paragraph.

One document usually produces several. A memory that says environment access must go through `getEnv()`, that this exists because direct access bypassed validation three times, and that new modules should be checked against it, is a CONSTRAINT, a RATIONALE and a CHECK.

## Grounding

Every atom carries where it came from in the source, and the distinction between the source's words and the extractor's is preserved rather than blurred.

An atom's corrective action, preferred choice or procedure step is **source-verbatim**. The condition or context it applies under is source-grounded where the source stated one explicitly, and marked as a paraphrase where it did not. That flag travels with the atom, so nothing downstream can present a paraphrase as though the source had said it.

This is the mechanism behind a specific promise: Pathrule delivers what your team wrote, not a plausible reconstruction of it.

## Validation

An atom that the source does not actually support does not survive.

This is the failure mode a generative step invites: a model reading a paragraph about payment handling can produce a confident, well-formed constraint that nobody in your team ever agreed to, and a confident constraint is worse than no constraint. Validation is what stands between an extraction and the knowledge layer.

## Write time, not delivery time

The interpretation is expensive, so it happens **once**, when knowledge is written or changed.

Everything after that is pure. Selecting the atoms relevant to one task and compiling them into an [Agent IR](/docs/intelligence/agent-ir) is deterministic and makes zero model calls. The same knowledge and the same task produce the same delivery, every time.

That property is load-bearing in two directions. It is why delivery is fast enough to happen before an agent's first tool call, and it is why the thing an agent received is reproducible rather than a fresh interpretation each turn.

## What compilation produces, and what happens if it is not good enough

The output is typed, grounded, validated knowledge, and the part of it a specific task needs is what reaches the agent.

Compilation can still fall short. A memory whose meaning lives in a relationship between two things can compile into atoms that keep one side of it. That is caught after the fact, by a deterministic gate that compares the actual delivery against the actual source, and when the compiled form does not represent the source well enough the delivery falls back to the source knowledge instead.

See [safety and fallback](/docs/intelligence/safety) for how that decision is made.
