What is Precedent?
Precedent is the decision layer for AI coding agents — the decision of record, plus a permission
layer. It is not a memory layer: the unit isn't an arbitrary observation, it's a decision —
situation → decision → why → authority — that can override an agent's judgment and is enforced
at the merge gate.
The problem
Coding agents re-derive the same choices over and over, with no memory of what the team already decided or why. They repeat banned patterns, re-litigate settled trade-offs, and touch payments or auth with no guardrail. Documentation goes stale; the real rules live in reviewers' heads.
How it works — one loop
Retrieve before you choose · Govern before you merge · Record after you choose.
- Consume — before an agent acts, it asks whether a decision already covers the change. A guardrail comes back at binding authority; the agent complies instead of guessing.
- Enforce — at the merge gate, the same decisions block a violating PR and auto-merge a compliant one. Enforcement is deterministic and runs in your repos.
- Govern — browse, query in natural language, and promote what should bind — from the console.
Why "decision," not "memory"
| Memory layer | Precedent (decision layer) | |
|---|---|---|
| Unit | any observation | a decision, with authority |
| Effect | informs (soft) | binds (a guardrail overrides the agent) |
| Action | recall | recall + govern/enforce |
| Lifecycle | store/forget | promote · deprecate · supersede (human-confirmed) |
A memory tells the agent what happened. A decision tells it what it may do — and stops it at the gate when it's about to break a rule.
Example
A team decided "Redux is banned for server-state caching; use React Query" (a guardrail). Later an agent starts to add Redux to a dashboard. Precedent retrieves the guardrail before the agent commits, and the merge gate blocks the PR — citing the decision and the why — instead of a reviewer catching it days later, or worse, not at all.
Start with the Quickstart.