Inspiration
Freelancers routinely lose money and time to unclear or unfair contract terms; formal legal review is too costly for many. ContractGuard AI was built for the Agentic AI Unleashed AWS & NVIDIA Hackathon to make practical, negotiation-ready contract analysis accessible — combining fast LLM-powered insight with industry benchmarking so non-lawyers can spot risk and propose fixes quickly.
What it does
- Accepts contract uploads (PDF/DOCX) and extracts clauses.
- Produces clause-level risk scores and plain-English explanations.
- Compares clauses to industry benchmarks and similar contracts stored in the vector DB.
- Generates redlined counter-proposals and negotiation talking points tailored to the user.
- Supports interactive Q&A about specific terms so freelancers can understand tradeoffs before negotiating.
How we built it
- Frontend: React app with file upload and chat interface.
- API / Orchestration: FastAPI server that orchestrates agentic workflows (risk agent, industry agent, negotiation agent, template generator).
- LLMs & Embeddings: Llama-3.1 (Nemotron) served via SageMaker/NVIDIA NIM; NeMo Retriever embeddings for semantic search.
- Vector + data layer: PostgreSQL + pgvector for embeddings, Redis for caching, S3 for contract storage.
- Infrastructure: Deployed in AWS EKS with NVIDIA NIM containers; orchestration leveraging LangChain plus a custom agent framework.
Challenges we ran into
- Clause segmentation & noisy extraction: PDF/DOCX parsing creates edge cases (tables, footnotes, weird formatting) that hurt downstream embeddings and scoring.
- Calibration of risk scoring: Turning LLM explanations into reproducible numeric scores requires careful prompt design, feature engineering, and human validation.
- Latency & cost tradeoffs: Running larger LLMs (even via NIM/SageMaker) must be balanced with response time and cost for interactive use.
- Benchmark data & privacy: Building useful industry comparisons needs curated contract corpora while protecting user confidentiality.
Accomplishments that we're proud of
- Built an agentic pipeline that produces actionable negotiation artifacts (redlines + talking points) not just explanations.
- Integrated embeddings + vector DB so the system can compare clauses against industry examples for contextualized risk assessments.
- Created a full-stack prototype (React frontend + FastAPI backend + NIM-powered LLMs) deployable on AWS EKS.
What we learned
- Practical legal AI needs tightly coupled extraction → embedding → LLM prompting loops; weak links in any stage amplify errors.
- Agentic orchestration (distinct agents for risk, industry comparison, negotiation strategy) makes the product more modular and easier to iterate.
- Human validation and clear UI phrasing are essential: users must understand uncertainty and be given conservative guidance.
What's next for ContractGuard AI
- Improve robust clause extraction (better DOCX/PDF parsers and layout-aware models).
- Add outcome-driven learning so the system improves from negotiation results (A/B test counter-proposal styles).
- Expand industry templates and build a privacy-first contracts corpus for better benchmarking.
- Explore light-weight on-edge inference options to reduce latency and cost for basic checks.
Built With
- docusign
- fastapi
- langchain
- llama
- nim
- postgresql
- python
- react
- s3
- sagemaker
- tailwind
Log in or sign up for Devpost to join the conversation.