guideDifficulty: intermediateTime: 30mVersion: v1Services: contracts-api, llm-runtimeSDK: @lawie/sdkReviewed: 2025-01-05Reviewer: Docs PlatformTags: contracts, runtime, automation
Automate NDA Review with Lawie
Build an automated NDA triage workflow leveraging Lawie Contracts API plus the prompts service.
Overview
Learn how to ingest NDAs, classify deal metadata, and generate risk summaries programmatically.
Prerequisites
- API key created inside Lawie Admin with
contracts.readandcontracts.writescopes - Access to the sandbox tenant
- Node.js 18+
Architecture Diagram
The workflow uses Contracts ingestion + LLM runtime. Add your own diagram in MDX as needed.
Steps
- Upload the NDA using
/contracts/v1/upload. - Classify with
/contracts/v1/classifyto obtain counterparty, jurisdiction, and effective dates. - Run Risk Radar with
/contracts/v1/riskto get structured alerts. - Generate Summary via
POST /llm-runtime/v1/prompts/risk-ndacustomizing the system prompt.
import { LawieContracts } from '@lawie/sdk-node';
const client = new LawieContracts({ apiKey: process.env.LAWIE_KEY! });
const { contractId } = await client.contracts.upload({ filePath: './nda.pdf' });API Calls Referenced
POST /contracts/v1POST /contracts/v1/classifyPOST /contracts/v1/riskPOST /llm-runtime/v1/prompts/risk-nda
Troubleshooting
403→ API key missing scopes; revisit Lawie Admin.422→ File type unsupported; ensure PDF or DOCX.