Template. Fork it, customize it, and deploy your own contract review agent.
Open-source contract review agent template built on Vercel's Eve — the filesystem-first framework for durable AI agents. Upload a PDF or DOCX contract, watch the Eve agent stream a tool-call review, and walk away with a risk report you can act on before signing.
Eve is the same framework Vercel uses to run its own agents (vercel.com/eve). This template is what you ship when you need a vertical/legal agent: instructions in Markdown, tools in TypeScript, durable sessions by default, deploy with one click.
| Need | Template answer |
|---|---|
| Vercel Eve starter | ✅ Two-service vercel.json (web + eve), Next.js app + Eve runtime |
| AI contract review | ✅ Risk report, missing clauses, negotiation points — streamed |
| Real file parsing | ✅ PDF (pdf-parse) and DOCX (mammoth), text only, not persisted |
| Visible agent reasoning | ✅ Streaming tool calls rendered in the UI, not a black-box |
| Follow-up chat | ✅ Floating prompt input resumes the same Eve session |
| Production-shaped | ✅ Anthropic model, evals scaffold, type-safe tools |
A real Eve session — numbered negotiation points (raw-material cap, force majeure, power of entry, coupon pricing, insurance, contract blanks), a Signing Tradeoffs section, and a follow-up prompt that resumes the same session. The reminder chip at the bottom tracks unresolved items across the durable conversation.
Upload real PDF and DOCX contracts from the web app. Files are parsed per request and are not persisted by the template — each review starts from a clean slate.
The Eve agent streams its review with visible tool calls (build_contract_review_state, review_contract_text, review_clause_dual, evaluate_contract_risk_dimensions, route_contract_revision), so users see the methodology instead of getting a static black-box report.
Every review focuses on plain-English summary, business risks, missing or unclear clauses, unusual terms, and suggested negotiation points — never a signing recommendation.
The agent uses validity-first gates, clause coverage checks, consistency review, six risk dimensions, and revision routing adapted from Contract Review Pro. See agent/skills/contract-review-methodology.md.
After the first review, keep chatting with the same Eve session from a floating prompt input. Durable sessions survive refreshes, deploys, and long pauses.
PDF / DOCX upload
│
▼
Next.js upload API
│
▼
PDF / DOCX parser
│
▼
Eve agent session ─────────────► contract-review skill
│ ├─ build_contract_review_state
│ ├─ review_contract_text
│ ├─ review_clause_dual
│ ├─ evaluate_contract_risk_dimensions
│ └─ route_contract_revision
▼
Streaming risk report + follow-up chat
On Vercel, vercel.json defines two services: web for the Next.js app and eve for the Eve agent runtime.
Requirements: Node.js 24+, npm
git clone https://github.com/Nainish-Rai/contract-review-agent.git
cd contract-review-agent
npm install
cp .env.example .env.local
npm run devOpen the local URL printed by Next.js and upload a .pdf or .docx contract.
Required environment variables:
ANTHROPIC_API_KEY=...Optional:
ANTHROPIC_MODEL=claude-sonnet-4.6- Change
agent/instructions.mdto adjust the agent identity and guardrails. - Edit
agent/skills/contract-review-methodology.mdto tune the review workflow. - Add or change tools in
agent/tools/for new review checks. - Update
lib/contract-review/review.tsfor deterministic risk rules. - Adjust
app/_components/contract-review-app.tsxfor the upload and review UI. - Rename in
lib/site.ts(siteName,siteDescription) andapp/layout.tsxmetadata to rebrand as your own agent.
npm run dev # Start Next.js with Eve
npm run typecheck # TypeScript check
npm run build # Production buildSee AGENTS.md for notes aimed at AI coding assistants, and CONTEXT.md for the project's domain language.
- Eve — Vercel's filesystem-first framework for durable AI agents
- Next.js — React framework
- AI SDK Elements — Agent UI primitives (streaming tool calls)
- shadcn/ui — UI component patterns
- pdf-parse — PDF text extraction
- Mammoth — DOCX text extraction
- Vercel — One-click deploy, Workflows, Sandbox, AI Gateway
- vercel-labs/personal-agent-template — durable personal AI agent with web chat, Slack, Linear, memory
- vercel-labs/eve-chat-template — persisted Next.js chat template for Eve
- vercel-labs/eve-slack-agent-template — starter Slack bot built on Eve
- This repo — vertical/legal contract review agent template
This template surfaces practical contract-review issues. It is not legal advice and should not be treated as a signing recommendation.
