Skip to main content

What You’ll Build

A contract analysis pipeline that:
  1. Uploads contracts to a searchable vault
  2. Extracts key terms (parties, dates, amounts, obligations)
  3. Identifies risky clauses with severity ratings
  4. Compares similar clauses across multiple contracts
  5. Generates a formatted risk report
Time to complete: 25 minutes

Architecture

Prerequisites

  • Case.dev API key (get one here)
  • Contract documents (PDF, DOCX, or images)

Step 1: Create a Contract Vault

Set up a vault to store and index your contracts:

Step 2: Upload and Index a Contract

Upload a contract, run OCR if needed, and index it for search:
Ingestion handles everything. Vault ingestion automatically runs OCR on scanned PDFs, chunks the text, and generates embeddings. You don’t need to call OCR separately.

Step 3: Extract Key Terms

Use vault search to retrieve the contract text and extract structured terms:
Example Output

Step 4: Compare Clauses Across Contracts

Search your vault to find and compare similar clauses across multiple contracts:

Production Tips

Error Handling

Use Webhooks for Production Pipelines

Instead of polling for ingestion status, subscribe to vault events:
Use temperature: 0 for key term extraction and risk identification. The lower temperature ensures more deterministic, factual outputs.

Next Steps