Flag Risky Clauses by Meaning Against Your Playbook

Score a contract's clauses against your risk playbook by semantic similarity to surface the risky, non-standard, or missing language — self-hosted, so privileged documents never leave.

All recipes· legal· 5 minutesbeginnersql
Instance: localhost:8080

Opens your running SynapCores (Flag Risky Clauses by Meaning Against Your Playbook will be staged for a preview — nothing runs until you click Run). No instance yet? Install free in ~30s.

Share

Objective

Contract review is finding the clauses that deviate from your playbook. Keyword rules break on paraphrase; a "limitation of liability" can be written a hundred ways. This recipe matches each clause to your playbook risk patterns by meaning, so a reviewer sees the risky and non-standard language first — inside your environment, so privileged text never leaves.

Step 1: A playbook of risk patterns with embeddings

DROP TABLE IF EXISTS clause_playbook;

CREATE TABLE clause_playbook (
    rule_id TEXT PRIMARY KEY,
    risk    TEXT,
    pattern TEXT,
    emb     VECTOR(384)
);

INSERT INTO clause_playbook VALUES
 ('R-01','uncapped liability',
  'The party accepts unlimited liability with no cap on damages for any breach.',
  EMBED('The party accepts unlimited liability with no cap on damages for any breach.')),
 ('R-02','auto-renewal',
  'This agreement renews automatically for successive terms unless cancelled in advance.',
  EMBED('This agreement renews automatically for successive terms unless cancelled in advance.'));

Step 2: Score an incoming clause against the playbook

SELECT rule_id,
       risk,
       COSINE_SIMILARITY(
         emb,
         EMBED('Supplier shall be liable without limitation for all losses arising under this contract.')
       ) AS sim
FROM   clause_playbook
ORDER  BY sim DESC
LIMIT  1;

Result — the incoming clause matches the uncapped-liability risk pattern:

rule_id risk sim
R-01 uncapped liability 0.57

Why it matters

Every clause is scored against your own risk playbook, with a citation to the matching pattern a lawyer verifies — grounded review, not an unattributed summary. Turn the extracted terms into a queryable obligation graph, and log the review to a tamper-evident audit. See the agent form in agentic contract review.

Tags

legalcontract-reviewclause-riskvectorembeddingssimilarityplaybookself-hostedprivilege

Run this on your own machine

Install SynapCores Community Edition free, paste the SQL or Cypher above into the bundled web UI, and watch it run.

Download Free CE