Inspiration

Every day a clinical trial is delayed, patients with aggressive cancers, rare diseases, and chronic conditions wait longer for potentially life-saving therapies. Before a single patient can enroll, pharmaceutical sponsors like Regeneron and clinical research sites must negotiate a Clinical Trial Agreement (CTA) — a complex legal document covering IP ownership, indemnification, publication rights, HIPAA, and FDA reporting obligations. This process takes an average of 100+ days. At $800,000 to $1.4 million in lost pipeline value per day, that's not just a legal inconvenience — it's a humanitarian problem disguised as a paperwork problem.

For a company like Regeneron with 56 active clinical-stage programs, shaving 50 days off each negotiation unlocks over $2.24 billion in pipeline NPV. But more importantly, it means patients facing aggressive lymphomas or rare inflammatory diseases get access to potentially life-saving therapies nearly two months sooner. We didn't build ACTA AI to win a hackathon. We built it because the problem is real, the math is brutal, and nobody has actually solved it yet.

What it does

ACTA AI is a full-stack multi-agent contract intelligence platform built around three core pillars — plus four advanced features that go beyond anything available commercially today.

Pillar 1 — Ingestion & Decomposed Analysis We never throw a 30-page contract at an AI in one shot. The brief explicitly called this out as what bad teams do — so we went the other direction entirely. Our pipeline runs five discrete processing steps: parse → split → classify → analyze per clause → aggregate → executive summary Each clause is evaluated independently against a hardcoded ACTA baseline before results are combined. This is the architectural difference between a structured legal tool and a glorified chatbot.

Pillar 2 — ACTA Playbook Enforcement Seven ACTA rules are hardcoded into every analysis prompt as specific, verifiable assertions — not vague vibes: Rule ACTA Standard Publication review 60-day site review period Patent delay cap 90 days maximum Payment terms Net-30 invoicing Indemnification Mutual negligence-based only Confidentiality 5-year protection Indirect cost cap 26% F&A maximum Protocol deviation reporting 5 business days

Pillar 3 — Workflow & Version Tracking The WorkflowTracker pulls negotiation out of email, where contracts go to die. It tracks who holds the pen across a 5-stage pipeline (Draft → Sponsor Review → Site Legal → IRB → Executed), keeps full version history with timestamps, and projects live NPV impact so both parties can see, in dollars, what every day of delay is actually costing.

Advanced Feature 1 — Confidence Scoring Traffic Light Other legal AI tools treat every deviation equally. We triage them:

🟢 Aligned — matches ACTA baseline, move on 🟡 Minor — suboptimal, standard fix available 🔴 Critical — major deviation, will cause multi-week delay if left unresolved ⚫ Unknown — language we've never seen before, route to a human lawyer

A two-person legal team can now manage 50 simultaneous contracts by knowing exactly where to look first. That's not an incremental improvement — it's a different way of working.

Advanced Feature 2 — One-Click ACTA Mode The nuclear option. When a negotiation is completely stuck, one button rewrites every deviating clause to the ACTA baseline simultaneously. You get a side-by-side track-changes view — original struck through in red, ACTA replacement in green — plus a ready-to-send negotiation memo explaining every change to the other party. Nothing like this exists anywhere on the market today.

Advanced Feature 3 — Predictive Site Personas Not all hospitals negotiate the same way. An Academic Medical Center at Johns Hopkins and a regional community hospital have completely different legal priorities, reflexes, and red lines. Instead of sending the same contract to both and waiting to find out what breaks, ACTA AI predicts it in advance.

Advanced Feature 4 — Multi-Party Conflict Detector This is the one that surprised us most. Regeneron isn't negotiating one contract at a time — they're running dozens of trials across dozens of sites simultaneously. What happens when you accidentally grant exclusive IP rights to Site A and Site B for the same compound? Or promise conflicting publication windows to three different institutions? Right now, catching that requires a team of senior lawyers manually cross-referencing hundreds of documents. ACTA AI does it in seconds. Upload multiple CTAs, hit scan, and the system surfaces cross-contract inconsistencies that would otherwise surface as legal crises months later.

How we built it

Backend — Multi-Agent LangGraph Pipeline The core of ACTA AI is a 4-agent LangGraph pipeline that processes contracts in structured, sequential steps: Document Parser → ClauseExtractionAgent → RiskIdentificationAgent → ComplianceCheckAgent → SuggestionAgent Document Parser normalizes PDF, DOCX, and TXT inputs, detects headings, and sections the document so downstream agents reason by clause — not over one giant blob of text. ClauseExtractionAgent extracts structured clauses from raw text. Uses an LLM when available, falls back to rules and NLP when offline. Graceful degradation under pressure is a design principle throughout this codebase.

RiskIdentificationAgent scores each clause against the ACTA baseline using a hybrid approach: rule-based scanning first, then LLM enrichment, then a merge pass. This layered approach catches what either method alone misses.

ComplianceCheckAgent identifies missing expected clause types. The gaps in a contract are often more dangerous than what's actually present. SuggestionAgent produces redline suggestions and diff output, with a complete fallback path if the LLM is unavailable.

The shared state object (pipeline/state.py) is the backbone of the whole system — extracted clauses, risk findings, compliance findings, suggestions, risk score, version diff, and missing clause types all travel together through every agent step. Smart LLM Routing

We built a router that mirrors how law firms actually allocate work. Legal-heavy clauses — Indemnification, IP, Publication Rights, Governing Law — go to K2's legal reasoning model. Fast classification and summarization tasks go to Gemini 2.0 Flash. One-click ACTA rewrites and conflict detection run through Claude Sonnet. The right model for the right job, every time. Frontend — Next.js + TypeScript

Built with Next.js 15 and TypeScript, with a fully custom Sage Dream design system — warm creams, sage greens, and muted teals. The visual language was a deliberate choice: clinical software should feel trustworthy and calm, not like a crypto dashboard. Five interactive tabs, each one a complete workflow tool in itself.

Challenges We Ran Into

Agent architecture decisions. None of us had built a production LangGraph pipeline before. We spent the first several hours just debating architecture — how many agents, where to draw the boundaries, how state should flow between steps. We went through three different designs before landing on the one that actually made sense. Looking back, those arguments were the most valuable hours of the hackathon.

Model selection under real constraints. We started with one model doing everything and quickly realized that was wrong. Some tasks need speed. Some need legal reasoning depth. Some need general language quality. Getting the routing logic right — and making sure each model received prompts that matched its strengths — took far longer than we expected and involved a lot of failed experiments.

Structured output that actually holds. Getting LLMs to return clean, parseable JSON across every clause, including weird formatting edge cases and mid-sentence clause splits, required careful prompt engineering, a JSON cleaning layer, and fallback defaults at every agent step. Even then it broke. We fixed it and it broke again. This is the unglamorous work that makes or breaks a legal AI product.

Version control with four people moving fast. At hour 20, we had three people pushing conflicting changes to the same files simultaneously. We had a merge conflict during a live demo test. We handled it like professionals, which in this case meant one person screaming quietly while the others pretended not to notice. We got through it. Not sleeping. This one is self-explanatory.

Accomplishments that we're proud of

We're proud that the backend actually works and the front-end is really user-friendly, elegant, and minimalist. Not "demo works if you ask it the right question" works — genuinely works on real Clinical Trial Agreement documents with messy formatting, unusual clause ordering, and legal language we'd never seen before. The LangGraph pipeline handles edge cases gracefully, falls back cleanly when models are unavailable, and returns structured, accurate analysis consistently.

We're proud of the Multi-Party Conflict Detector. It was a late addition that almost didn't make it in. It took us three hours to build, and it's probably the most commercially valuable thing in the entire product.

We're proud that we shipped all five features in 36 hours while also redesigning the entire frontend twice. We did not sleep much. We have no regrets.

What we learned

LangGraph from zero. None of us had touched LangGraph before this weekend. We went from reading the docs Friday night to running a 4-agent production pipeline by Saturday afternoon. That's the kind of learning that only happens when you have no choice and a hard deadline. Agentic AI architecture is a craft. Breaking a problem into agents that each do one thing well, passing state cleanly between them, and designing fallback behavior that degrades gracefully — this is genuinely hard to get right. We have a much deeper respect for it now.

Teamwork is the actual product. This sounds like something you'd put on a motivational poster, but we mean it literally. The moments where things worked were the moments where we were communicating clearly, respecting each other's judgment, and staying honest when something wasn't working. The moments where things broke were when we weren't. We came in as teammates and came out closer than that.

Being respectful to your team under pressure is a skill. At hour 28, tired and stressed, it would have been very easy to snap at each other. We didn't. We're proud of that more than the code. How to not sleep and still write clean code. Turns out the secret is coffee, good music, and genuinely caring about what you're building. If you're doing it for the right reasons, it doesn't feel like suffering.

What's next for ACTA AI

A production-grade Multi-Party Conflict Detector. What we shipped is a working prototype — and it already surfaces real cross-contract inconsistencies. But we want to go deeper: persistent contract storage, conflict history tracking, automated alerts when a new contract creates a conflict with an existing one, and network visualization showing which sites share overlapping legal terms. This feature alone could save Regeneron's legal team hundreds of hours per trial cycle.

Privacy-first architecture. Clinical Trial Agreements contain sensitive information about both patients and organizations. The next version needs end-to-end encryption, role-based access controls, and a data handling framework that satisfies HIPAA and sponsor confidentiality requirements. Trust is the foundation of any legal product. We want to earn it properly. Agent learning from real cases. Right now our agents reason from hardcoded ACTA rules. The next step is feeding real negotiation outcomes back into the system — which deviations actually caused delays, which redlines got accepted, which site types pushed back hardest on which clauses — and letting the agents refine their risk models over time. The system should get smarter with every contract it processes.

Longitudinal negotiation intelligence. Imagine a feature that tells you: "This site has negotiated 4 previous CTAs with sponsors. In 3 of them, they pushed back on publication rights within 7 days of receiving the draft. Here's the language they accepted in the end." That's the kind of institutional memory that currently lives in the heads of individual lawyers. We want to make it accessible to everyone on the team.

A dedicated clinical trial manager interface. Non-lawyers shouldn't need to understand legal terminology to use this product. We want to build a simplified view — plain English summaries, traffic light dashboards, and one-click actions — designed specifically for clinical trial coordinators and program managers who need answers without the legal jargon.

Built With

  • fastapi
  • langgraph
  • nextjs
  • react
Share this project:

Updates