Inspiration

Every week, freelancers and small business owners sign contracts they don't fully understand. Legal jargon, hidden liability clauses, one-sided IP assignments — these aren't edge cases, they're the norm. Hiring a lawyer to review a single contract costs $300–$500/hour. For a startup or a solo developer, that's simply not realistic.

We've all been there: a 24-page vendor agreement, a tight deadline, and zero legal budget. We wanted a tool that could sit beside us and say — here's the risk, here's the clause, and here's exactly what to say to fix it.

That's ContractPilot AI.


What it does

ContractPilot AI is a multi-agent contract negotiation copilot built on the Vercel + AWS stack. You upload a contract (PDF or DOCX) and five specialized AI agents go to work simultaneously:

  • Legal Analyst — flags problematic clauses with plain-language explanations and section references.
  • Risk Assessor — calculates a 0–100 risk score across financial, operational, and legal dimensions.
  • Compliance Checker — verifies alignment with applicable regulations (GDPR, standard SaaS terms).
  • Negotiation Strategist — generates ready-to-use counter-proposals and alternative clause wording, ranked by impact.
  • Summary Agent — produces an executive report any stakeholder can understand in under five minutes.

Key capabilities:

  • Contract risk scoring with High / Medium / Low breakdown per clause.
  • Clause-level negotiation recommendations with suggested alternative wording.
  • Interactive chat with the contract — ask anything, get answers with exact section references.
  • One-click export of a negotiation-ready PDF report.
  • Full audit trail of every analysis stored in Amazon DynamoDB.

Monetization & Commercial Model

To address Track 2 (Monetizable B2B App), ContractPilot AI is built on an extremely high-margin unit economic model (the actual AWS infrastructure cost per analysis is less than $0.01):

  1. Tiered B2B SaaS Subscriptions:
    • Solo/Freelancer Tier ($19/mo): up to 5 contract reviews/month, basic risk scoring, and interactive chat.
    • Startup/SMB Tier ($49/mo): up to 20 contract reviews/month, advanced negotiation recommendations, compliance checking, and PDF exports.
    • Enterprise Workspace Tier ($149/mo): unlimited reviews, team collaboration features, and custom benchmarking.
  2. Transactional Top-Ups: Charging users $5 per extra contract review beyond their tier.
  3. API Access: Monetizing our REST API endpoints on AWS Lambda by letting B2B legal tech, HR, or accounting platforms embed our contract analysis capabilities.

How we built it

Frontend — Vercel v0 + Next.js

The entire frontend was scaffolded using Vercel v0, which let us go from wireframe to production-ready Next.js UI in hours. v0 generated the dashboard layout, the clause explorer, the risk score gauge, and the chat interface — all as clean, editable React components. We iterated the design directly in v0, then deployed to Vercel with zero configuration.

Backend — ASP.NET Core (.NET 9)

The REST API and multi-agent orchestration layer are built in ASP.NET Core. Each agent is a distinct service with its own prompt context and typed output schema (risk entries, clause flags, negotiation suggestions). The backend merges agent outputs into a unified analysis report before persisting to the database.

Database — Amazon DynamoDB

We chose Amazon DynamoDB as our primary database. DynamoDB's fully serverless, pay-per-use scaling model made it an obvious fit: contract analysis workloads are bursty — heavy during upload/analysis, idle between sessions. DynamoDB scales compute capacity in milliseconds, keeping latency predictable and maintaining a $0 fixed cost when the application is idle.

Schema highlights:

  • contractpilot_contracts — stores document metadata, storage reference, score, summary, and lists of issues and recommendations.
  • contractpilot_chat_messages — stores full conversation history per contract session, ordered by timestamp.
  • contractpilot_agent_logs — stores execution duration, status, and raw agent outputs.

Connection from ASP.NET Core is handled via the official AWSSDK.DynamoDBv2 NuGet package with high-performance async client patterns.

AI Layer — Amazon Bedrock (Amazon Nova Lite)

The multi-agent pipeline runs on Amazon Bedrock, using Amazon Nova Lite as the foundation model. Each agent receives a structured prompt with its specific contract slice and returns typed JSON. Bedrock's managed API eliminates infrastructure overhead and fits naturally into the AWS ecosystem.

Document Processing

Uploaded PDFs and DOCX files go through an OCR + parsing pipeline on the backend that segments the document into clause units before routing to the agents. Contract files are stored in Amazon S3, referenced by UUID in DynamoDB.

Infrastructure

  • Frontend: Vercel (Next.js, automatic deployments from GitHub)
  • Backend: AWS Lambda + API Gateway (containerized ASP.NET Core on serverless execution layer)
  • Database: Amazon DynamoDB
  • Storage: Amazon S3 (contract documents)
  • AI: Amazon Bedrock (Amazon Nova Lite)

Architecture

💻 Client Browser (Next.js)(HTTPS REST API)AWS API Gateway

📡 AWS API Gateway(Serverless Invocation)AWS Lambda (.NET 9 API)

AWS Lambda orchestrates the workflow and integrates with:

• 📂 Amazon S3 (Secure PDF/DOCX contract storage)

• 🧠 Amazon Bedrock / Nova Lite (Runs the 5 specialized AI agents in parallel)

• 💾 Amazon DynamoDB (Serverless database for contracts, chat, and agent logs)

Challenges we ran into

Multi-agent coordination was harder than expected. Getting five agents to produce consistent, non-redundant outputs required strict JSON schemas, a deduplication merge layer in the backend, and careful prompt engineering to prevent agents from contradicting each other.

Cold starts on containerized Lambda functions initially added latency on first query. We optimized the container size, multi-stage Docker build, and pre-warmed connection pools to ensure the cold start is minimal (typically under 4 seconds) and subsequent requests respond in milliseconds.

Legal accuracy vs. hallucination is a real tension in this domain. A confidently wrong answer about a liability clause is worse than no answer. We implemented strict output schemas forcing the model to cite specific clause text, and added a confidence threshold below which the system flags uncertainty rather than generating a recommendation.

Clause segmentation in poorly formatted PDFs (scanned documents, inconsistent headers) was genuinely messy. We iterated multiple times on the parsing pipeline to reliably detect clause boundaries across different contract formats.


Accomplishments that we're proud of

The full pipeline working end-to-end — from raw PDF upload through five parallel agents to a structured risk report with negotiation counter-proposals — deployed on a production-grade AWS + Vercel stack. The fact that this runs on Amazon DynamoDB and Lambda means it could handle real traffic without any infrastructure changes and with a zero fixed operational cost.

The interactive chat that lets you ask natural language questions about your contract and get answers with specific section references feels genuinely useful. The negotiation counter-proposal feature — not just flagging a bad clause, but generating alternative wording you can paste directly into a reply — is the step most contract tools skip entirely.

Using v0.app to build the frontend cut our UI development time drastically and let us focus engineering effort on the agent pipeline and database architecture, which is where the real complexity lives.


What we learned

Amazon DynamoDB and AWS Lambda are genuinely well-suited to bursty AI workloads. The auto-scaling behavior matches the pattern of contract analysis perfectly — you need compute during the analysis window, then nothing until the next upload.

v0.app changes the frontend workflow fundamentally. Describing a UI in natural language and iterating on the generated component is faster than writing JSX from scratch, especially for data-dense dashboards. It's not magic — you still need to understand what you're doing — but the iteration speed is genuinely different.

Multi-agent architecture is about coordination, not just capability. More agents don't mean better output. We ended up with five well-scoped agents because that's the minimum to cover the domain cleanly. Each additional agent adds latency and a new failure surface.


What's next for ContractPilot AI

  • Expanded compliance coverage — GDPR, CCPA, and regional commercial law templates.
  • Clause benchmarking — compare a clause against anonymized historical data stored in DynamoDB to say "this liability cap is below industry standard for SaaS agreements".
  • Team workspaces — shared analysis and negotiation comments before responding, with DynamoDB handling multi-user session state.
  • API access — embed ContractPilot AI analysis in legal platforms, HR tools, and accounting software via REST API on AWS Lambda.

Our vision: every business, regardless of size or legal budget, should negotiate smarter and sign with confidence.


Built With

Share this project:

Updates