Pathrule is the intelligence layer between you, your workspace, and the coding agents you run.

That sentence is doing specific work, so it is worth unpacking one clause at a time. **Between you and your agents**, because half of what Pathrule learns is about how you prefer to work, not about the code. **Between your workspace and your agents**, because the other half is what one repository has learned about itself. **A layer**, because it is not inside any agent: switching from Claude to Codex changes who executes, not what is known.

What Pathrule is not: a coding model. It does not write your application code. The model it runs on your machine exists to understand knowledge, not to produce software.

## The shape of the system

```text
                    YOU
                     |
                     v
             USER INTELLIGENCE
                     |
WORKSPACE  -->  WORKSPACE INTELLIGENCE
                     |
                     v
              TASK INTELLIGENCE
                     |
                     v
                  AGENT IR
                     |
                     v
          Claude / Codex / agents
```

Two sources of learning converge. For a given piece of work, the part of both that matters is selected and compiled into one compact representation, and that representation is what an agent receives.

Above all of it sits the surface where a person joins in:

```text
               PATHRULE STUDIO
                     |
        ask / teach / inspect / direct
                     |
                     v
              Pathrule itself
```

## The six layers

| Layer | What it does |
| --- | --- |
| Pathrule Intelligence | Understands knowledge and compiles it, with inference running on your device. |
| Workspace Intelligence | Learns how one project works. |
| User Intelligence | Learns how you prefer to work, across projects. |
| Pathrule Runtime | Delivers compiled knowledge, enforces constraints and checks, records what happened. |
| Pathrule Studio | The interface where you talk to, inspect and direct the intelligence. |
| Pathrule CLI | The same intelligence and runtime, in a terminal or a headless pipeline. |

## The lifecycle

Six stages, and every one of them is a real step in the product rather than a diagram.

**Observe.** Instructions, corrections, decisions, agent sessions, failures and the fixes that resolved them are all evidence. Each carries where it came from.

**Understand.** The local model reads narrative knowledge and works out what it means operationally: what is forbidden, what must be verified, what is preferred under which condition, what is merely true and useful.

**Compile.** Meaning becomes typed, structured knowledge, and for one task the relevant part of that structure becomes an [Agent IR](/docs/intelligence/agent-ir). The expensive interpretation happens once, at write time, not on every prompt.

**Enforce.** Constraints and checks are handled by the runtime. A rule that must not be broken is not delivered as a paragraph and hoped for.

**Verify.** What was delivered, what the agent actually consulted, how many tool calls the turn took and how many failed are recorded, which makes the effect of a piece of knowledge a measurement rather than an impression.

**Learn.** Evidence accumulates. Repeated corrections strengthen a working preference; a remedy that keeps applying earns its standing; knowledge the code has moved past loses ground.

## Words that are not synonyms

The rest of these docs depends on keeping these apart.

- **Memory** is what was recorded. A note about a decision, written at a moment in time.
- **Knowledge** is the structured representation of what that record means, with the evidence that supports it.
- **Intelligence** is the system that decides what that knowledge means and when it matters.
- **Context** is the answer for one task: what matters, here, now.
- **Agent IR** is the compiled representation an agent actually receives.
- **Runtime** is the layer that delivers, enforces, verifies and observes.

A memory is an input. Context is an output. Neither is the product.

## Where to go next

- [Workspace Intelligence](/docs/intelligence/workspace-intelligence): scope, authority, sources, lifecycle.
- [User Intelligence](/docs/intelligence/user-intelligence): how it learns, what you control, and how it interacts with workspace requirements.
- [The local model](/docs/intelligence/local-model): install, size, platform, updates, offline behaviour.
- [Knowledge IR](/docs/intelligence/knowledge-ir): the eight primitives.
- [Compilation](/docs/intelligence/compilation): narrative to atoms to grounded, validated knowledge.
- [Agent IR](/docs/intelligence/agent-ir): what an agent receives for one execution.
- [Safety and fallback](/docs/intelligence/safety): the completeness gate and what happens when compilation is not good enough.
