ContractReviewDesk

Documentation

Getting started

  1. Create a matter, upload contracts (.docx, .pdf, .txt). Files are encrypted with AES-256-GCM using a per-workspace key.
  2. Open a document → Review against playbook. Accept or edit redlines → Download redline opens in Word with tracked changes.
  3. Select many documents → Tabular review / DD. Export CSV.
  4. Research answers only from the corpus; the citation verifier removes anything it cannot find.

AI routing

Local model first (OpenAI-compatible vLLM, e.g. Qwen), Claude only as fallback when the local model errors, times out or fails an automatic check (JSON shape, citation guard, verbatim-quote check). With no AI configured, the app runs in rules-only mode.

LOCAL_LLM_URL=http://gpu-server:8000/v1
LOCAL_LLM_KEY=...
ANTHROPIC_API_KEY=...        # fallback (optional)
SARVAM_API_KEY=...           # Indian-language translation (optional)
SURGE_AIRGAP=1               # never call any external AI

Word add-in

  1. Settings → API keys → create a key.
  2. Download word-manifest.xml (points at contractreviewdesk.com). For a local dev server use word-manifest.dev.xml (https://localhost:6150).
  3. Word → Insert → Add-ins → My Add-ins → Upload My Add-in (or deploy centrally from the Microsoft 365 admin centre → Integrated apps).
  4. Open the ContractReviewDesk pane, paste the key, choose a playbook, click Review this document. Apply redline turns on Track Changes and replaces the clause text, so every edit is a revision.

Outlook add-in

Sideload outlook-manifest.xml. On any email: pick a matter → Save email to matter stores the subject and body in the vault (audit-logged).

API

Send Authorization: Bearer sl_….

POST /api/v1/verify     {"text": "..."}                         → citation report
POST /api/v1/review     {"text": "...", "playbookId": "pb_…"}  → findings
POST /api/v1/documents  {"matterId": "mt_…", "name": "x.txt", "text": "..."}
GET  /api/v1/playbooks                                          → playbooks, matters

Loading the full judgment corpus

The app ships with key sections of 21 Central Acts (section index for all) and landmark Supreme Court judgments (editorial summaries). The citation verifier only accepts authority that is in the corpus, so load full texts before relying on research for less-cited cases. Sources: the public Indian Supreme Court and High Court judgment datasets (AWS Open Data, CC-BY-4.0), court websites, India Code.

# folder of .txt / .json / .jsonl / .pdf judgments (recursive)
npm run corpus:ingest -- --dir D:\judgments\sc --court "Supreme Court of India"

# dataset metadata (CSV / JSONL) + the PDFs it names; convert parquet first (DuckDB: COPY ... TO 'meta.csv')
npm run corpus:ingest -- --metadata meta.csv --dir D:\judgments\pdfs --report ingest-report.json

# Act sections (India Code dump: {act, sections:[{sec, heading, body}]})
npm run corpus:ingest -- --acts D:\indiacode

# options: --dry-run · --limit N · --update (replace existing) · --court X

On-prem / air-gapped

docker compose up -d          # app + Postgres
docker compose --profile gpu up -d   # + vLLM serving Qwen on your GPU
# set SURGE_AIRGAP=1 so nothing leaves the server

SSO

OIDC is built in (Settings → Single sign-on). For SAML-only identity providers, run BoxyHQ SAML Jackson as a sidecar; it exposes an OIDC endpoint you enter as the issuer.

ContractReviewDesk is a tool for advocates and legal teams. It does not give legal advice. Stamp duty rates are indicative; court-filing profiles must be confirmed against the current practice directions.