Objective
Reviewing an inbound MSA against your playbook is a 4-hour paralegal job. The hard part isn't reading the contract — it's remembering what you agreed to in similar past deals. This recipe wires a contract-reviewer that retrieves your standard clauses + your closest precedent and produces a clause-by-clause delta.
Step 1: Create standard clauses, precedents, the inbound MSA
CREATE TABLE IF NOT EXISTS recipe_lg_standard_clauses (
clause_id INTEGER PRIMARY KEY,
topic TEXT,
body TEXT,
embedding VECTOR(384)
);
CREATE TABLE IF NOT EXISTS recipe_lg_precedents (
precedent_id INTEGER PRIMARY KEY,
counterparty TEXT,
industry TEXT,
acv_band TEXT,
notes TEXT,
embedding VECTOR(384)
);
CREATE TABLE IF NOT EXISTS recipe_lg_inbound_clauses (
inbound_id INTEGER PRIMARY KEY,
msa_name TEXT,
topic TEXT,
body TEXT
);
Step 2: Seed
INSERT INTO recipe_lg_standard_clauses (clause_id, topic, body) VALUES
(1,'Liability Cap','Total liability is capped at the fees paid in the 12 months preceding the claim, subject to standard carve-outs for IP indemnity, breach of confidentiality, and gross negligence.'),
(2,'IP Indemnity','Vendor will defend and indemnify customer against third-party claims that the service infringes patent, copyright, or trade secret rights.'),
(3,'Data Residency','Customer data is stored in the customer-selected region. Cross-region replication occurs only with customer consent and under the same residency commitment.'),
(4,'Termination for Convenience','Either party may terminate for convenience with 90 days written notice. Pre-paid unused fees are refunded pro-rata.'),
(5,'Auto-Renewal','Subscription auto-renews for successive 1-year terms unless either party gives 60 days written notice prior to the renewal date.');
INSERT INTO recipe_lg_precedents (precedent_id, counterparty, industry, acv_band, notes) VALUES
(1,'Acme Bank', 'Financial Services','$500k+','Forced "Liability Cap = 2x annual fees" — concession because of regulator pressure. Approved by GC.'),
(2,'Helios Hospital', 'Healthcare', '$100k-500k','Accepted BAA addendum + HIPAA carve-out for liability. No cap change.'),
(3,'NorthernHydro', 'Utilities', '$100k-500k','Data residency = EU-only, no cross-region replication permitted. Accepted.'),
(4,'Riverbed Devops', 'Software', '$50k-100k','Standard MSA accepted with no edits. 2-day cycle.'),
(5,'BlueTrust Insurance','Insurance', '$500k+','Required termination-for-convenience cut to 30 days; CFO declined; closed at 90 days standard.');
INSERT INTO recipe_lg_inbound_clauses (inbound_id, msa_name, topic, body) VALUES
(1,'Acme-2026-MSA','Liability Cap', 'Vendor''s total liability for any and all claims arising under this Agreement shall be capped at three (3) times the fees paid in the 24-month period preceding the claim.'),
(2,'Acme-2026-MSA','Termination for Convenience','Customer may terminate this Agreement for convenience upon thirty (30) days'' written notice. Vendor may not terminate for convenience.'),
(3,'Acme-2026-MSA','Data Residency', 'All Customer Data shall be stored exclusively within the United States. No cross-border transfer is permitted under any circumstance.');