Skip to content

About

Full-stack contract lifecycle management platform with AI-powered risk analysis, e-signatures, tamper detection, and multi-party signing workflows.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

30 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ContractPilot

Contract lifecycle management, powered by AI.

ContractPilot is a full-stack platform for creating, signing, and managing contracts. It has retrieval-augmented AI risk analysis, OTP-verified e-signatures, tamper detection, and a multi-party signing workflow.

Live: contractpilot-sooty.vercel.app


What it does

  • Draft or upload contracts. Start from templates with {{variable}} placeholders, or upload a PDF, DOCX or TXT file. Text is extracted and the original file is kept, with its SHA-256, for download.
  • Retrieval-augmented risk analysis.
    • The contract is split into clauses and indexed with FAISS (bge-small embeddings) plus BM25.
    • The clauses relevant to 20 risk topics are retrieved, and each is paired with the closest clause from your own clause library as a reference standard.
    • Claude rates each clause green, yellow or red against a JSON schema, citing clauses by number, so every finding links to an exact span of the contract.
    • It also lists protections the contract is missing.
  • Clause search. Semantic search within a contract ("can either party terminate without cause?").
  • AI contract summary. Extracts parties, value, governing law, key dates and payment terms as structured output.
  • E-signatures.
    • Expiring signing links.
    • A required email one-time code (bcrypt-hashed, single use, 15-minute expiry, locked after 5 wrong attempts).
    • Sequential or parallel signing, with signing order enforced by the server.
    • Decline with a reason, and owner revocation.
  • Tamper evidence.
    • The SHA-256 of the text is locked when signers are invited.
    • Once anyone signs, the content is frozen.
    • An edit before the first signature re-locks the new text and forces pending signers to verify again.
    • Signing is refused if the text no longer matches the lock.
    • The audit checks every signature's hash against the current text, so an edit made directly in the database is flagged.
  • Full audit trail. Every signer event is logged with IP and user agent: viewed, OTP sent, verified or failed, content changed, tamper blocked, signed, and declined. The signature certificate is built from it.
  • Version history, milestones, clause library, client-side PDF export.

Measured

Clause retrieval on CUAD (102 lawyer-annotated contracts, 799 queries) hit@3 0.603 · hit@5 0.681 · MRR 0.523 (hybrid). That beats BM25 alone (hit@5 0.635) and dense alone (0.622), with the top 5 covering a median of 7% of each contract.
Backend tests 19, against a real Postgres, covering the OTP lockout, signing order, frozen content, out-of-band tamper detection, uploads, retrieval and the RAG prompt

Method, per-category results and how to reproduce them: eval/README.md.


Tech Stack

Layer Technology
Frontend React 18, Vite, Tailwind CSS, shadcn/ui, React Router, Axios
Backend FastAPI, Python 3.11+, SQLAlchemy 2.0, Alembic
Database PostgreSQL via Supabase
Retrieval FAISS, fastembed (BAAI/bge-small-en-v1.5, ONNX), BM25, reciprocal rank fusion
Documents pypdf, python-docx
Auth JWT (python-jose), bcrypt (passlib)
AI Anthropic Claude API, structured outputs (claude-opus-4-8, configurable via ANTHROPIC_MODEL)
Email Gmail SMTP via aiosmtplib / SendGrid
Scheduling APScheduler (contract expiry reminders)
PDF jsPDF + html2canvas (client-side)
Deployment Render (backend) · Vercel (frontend)

Getting Started

See HOW_TO_USE.md for local setup, environment variables, deployment instructions, and the full API reference.

Tests

docker run -d --name contractpilot-test-db -e POSTGRES_PASSWORD=test \
  -e POSTGRES_DB=contractpilot -p 54329:5432 postgres:16-alpine
cd backend && pip install -r requirements-dev.txt && pytest

The tests build the schema from the Alembic migrations and never touch Supabase. Email and Claude are stubbed.

About

Full-stack contract lifecycle management platform with AI-powered risk analysis, e-signatures, tamper detection, and multi-party signing workflows.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages