Agreement Graph · a research project

Contracts are
state machines.

A portfolio of agreements is a typed, auditable graph. Every state change guarded. Every transition recorded. Every dependency visible before you sign, renew, or terminate.

01

One agreement.

A master services agreement. Active, governing, binding. Most contract software stops here: a PDF in a folder.

02

It has children.

Two statements of work hang off it. Their terms, their renewal dates, their fate: inherited from the parent.

03

It gets amended.

A data-processing addendum rewrites the parent. From this moment, the original text alone is no longer the truth.

04

People are bound to it.

Signatories, counterparties, reviewers. Identity and authority sit on every transition, not in a spreadsheet next to it.

05

Now terminate it.

What breaks? Two SOWs and an addendum, surfaced instantly. The question that takes legal ops three days is answered in one query.

06

That is the Agreement Graph.

Typed edges. Guarded transitions. An append-only audit trail. Keep scrolling for the design, or jump straight to the playground.

The argument

A contract is not a flat file. It is a web of parties, obligations, and dependencies, and underneath it, a single enforceable event: the moment identity, intent, and authorization line up and a state changes.

Most contract software treats agreements as documents to store and search. That misses the point. The valuable thing isn't the text, it's the transition: who is bound, under what authority, from what state to what state, and whether you can prove it later.

The Agreement Graph models that directly. Every agreement is a node with a lifecycle. Every change of state is a guarded, audited transition. Every relationship between agreements, a master agreement to its SOW, an amendment to its original, a renewal that supersedes the old terms, is a typed edge in a graph the operator owns.

Agreements represent enforceable state transitions:
identity → intent → authorization → auditability → state change.

Who feels this

Three teams, one problem

01

Enterprise procurement

Managing 500+ active agreements where one MSA parents dozens of SOWs. A single renewal negotiation requires tracing every child, amendment, and addendum by hand. That takes days and still misses things.

The question they ask every quarter: what is this contract actually governing right now?

02

Legal ops

Asked "can we terminate this?" and spending three days manually tracing what depends on it before they can answer. The dependency chain exists in the contracts. Nobody has ever modeled it in a way you can query.

The question that stops them cold: what breaks if we do this?

03

M&A due diligence

Inheriting an acquired company's contract portfolio with no map of the relationships. Which agreements are active? Which are expiring? Which ones are children of something already superseded? The graph answers all of it in one pass.

The question that delays every close: what obligations are we actually inheriting?

Design principles

Three properties the system must hold

Each one is non-negotiable. Together they define what separates a contract repository from a contract system of record.

01

Guarded transitions

Every transition carries a guard: a pure rule that must pass before the state moves. submit requires at least one party and non-empty content. accept_for_review requires a party with the reviewer role. Guards are deterministic and free of side effects.

deterministic · no LLM in the guard
02

Append-only audit trail

Every successful transition emits an audit event recording the actor, source state, destination state, timestamp, and context. Events are never modified or deleted. The trail is the record of authority.

append-only · reconstructable
03

Typed graph relationships

Agreements link to each other through typed edges: parent_of, supersedes, amends, depends_on. The graph is the queryable asset: what depends on what, what is expiring, what was replaced.

typed edges · operator-owned

Lifecycle

The agreement state machine

Nine states. Eleven transitions. Each transition is a pure function: apply_transition(agreement, name, actor, context) returns a new agreement and an audit event, or raises. Storage is only written after both succeed.

Click any state to inspect its transitions

apply_transition( )

agreement.state = "draft"
transition      = "submit"
actor           = "acme-corp"

returns

agreement.state = "proposed"
audit_event = {
  from: "draft", to: "proposed",
  actor: "acme-corp", at: "…"
}

Graph model

Agreements and parties as a typed graph

A master agreement parents its statements of work. A renewal supersedes the old terms. Parties connect through roles. Hover a node to inspect its relationships; click to isolate the connected subgraph.

Ingestion pipeline

Bronze, Silver, Gold

A three-layer pipeline modeled on the Semantic Medallion pattern. Each layer is defined by what it delivers semantically, not by how it is stored. Bronze lands raw documents. Silver structures and identifies entities. Gold publishes the unified graph as RDF.

Constraints

Non-negotiable properties

Ownership first

Operator owns all data in plain, portable form. Git-friendly, no SaaS lock-in. The lesson from closed memory systems: if you can't export it, you don't own it.

No fact without a source

Every extracted contract fact cites the exact span it came from. Low-confidence extractions get flagged, never silently filled. The system never asserts what it can't point back to.

Standards over custom

W3C DCAT for catalog metadata, PROV-O for lineage, RDF + SPARQL at the Gold layer. Interoperable out of the box instead of a bespoke schema nobody else speaks.

Human at the checkpoint

The UNDER_REVIEW state is a built-in human gate. Nothing reaches APPROVED without an identified reviewer acting on it. AI augments the review; it doesn't replace the signature.

Interactive demo

A small procurement portfolio, live

One Master Service Agreement. Two Statements of Work that depend on it. A mutual NDA expiring in 18 days. A draft employment agreement under legal review. Click any contract to see what is at risk. Try to terminate the MSA and watch what breaks.

This demo runs on 5 contracts. At 1,000, manual tracking is roughly 3 full-time procurement roles. At 10,000+, manual tracking is impossible. The graph is the only way.

Run it on your own contracts. Upload a portfolio and watch it map itself. Parsed in your browser, so files never leave your machine.
Live portfolio graph
agreement / party parent of depends on amends references

Hover to trace relationships · click a node to open it · drag to rearrange

An academic exploration, your feedback welcome

Agreement Graph is a research project exploring contracts as enforceable state machines. If the model resonates, breaks, or sparks an idea, I'd genuinely like to hear it. Feedback, critiques, and contributions all shape where this goes next. The repository will be made public soon.