Inspiration

Before a clinical trial's data can go to regulators, the database has to be locked. Most teams only start cleaning it after the last patient's last visit. The industry average is 36+ days from that visit to lock (Tufts Center), and each day can cost a blockbuster drug up to $1,000,000 in lost patent life. Patients wait longer for therapies while that happens. We wanted cleanup to happen continuously every day instead of in one frantic push at the end.

What it does

Paritty is a continuous clean-to-lock copilot for clinical trials that speeds up timelines so life-saving treatments reach patients sooner, without compromising patient safety, data integrity, or human oversight. Data checks and queries: 25+ deterministic edit checks run on every new visit. Issues are ranked by priority (an unreported death outranks a misspelled surname). Queries are drafted, translated for international sites, and must be approved by a human before they are sent. Safety and lab reconciliation: Matches identical serious adverse events across the EDC and the safety database (such as "Acute myocardial infarction" and "Heart attack"). It triages discrepancies as acceptable, actionable, or critical, and catches lab unit mix-ups. Medical review: Real-time liver-safety monitoring using an eDISH plot for Hy's Law, along with CTCAE grading of lab shifts. Site risk monitoring: Eight key risk indicators generate a 0 to 100 risk score, complete with drafted visit agendas, follow-up letters, and an exportable scorecard PDF. Lock forecast: A Monte Carlo simulation provides P10, P50, and P90 lock dates, ranks data blockers by days saved, and models what-if scenarios. Trial operations hub: Includes a protocol Q&A assistant that escalates judgment calls, a data hub that resolves conflicting patient IDs, an actionable-insights agent, and a role-based "Today" work queue.

Social good and impact

Paritty is built directly around patient welfare, ethical data practices, and responsible engineering: Faster access to therapies: Continuous cleaning cuts the 36+ day post-trial lag before database lock. That directly reduces the time patients must wait for life-saving drugs to reach regulators while trimming substantial development overhead. Patient safety: Identifies dangerous clinical signals early—including Hy's Law liver-injury patterns and safety-database reporting discrepancies—and flags them immediately for medical review rather than leaving them buried until study closeout. Data integrity and trust: Empowers regulatory compliance by catching errors and underperforming sites early, using objective language ("reason to look") rather than punitive framing. Responsible AI: Humans approve every query, letter, and agenda. Gemini's outputs require strict citations and must pass a deterministic verification layer. The treatment arm remains blinded at all times, and every state change is audit-logged. Open and privacy-safe: Operates exclusively on public, synthetic, and augmented datasets with zero real patient health information, maintaining open-source access for the research community.

How we built it

Stack: A Next.js front end paired with a Python API over PostgreSQL. Detection logic runs deterministically, utilizing RapidFuzz for term matching and a RandomForest model for site-risk evaluation. Gemini: Gemini 2.5 Flash and Pro draft queries, translations, notes, and causality assessments while adjudicating borderline clinical term matches. Semantic search is powered by gemini-embedding-2. Every Gemini claim must carry citations and pass a deterministic verification step or it is blocked. Gemini never sees the treatment arm and never writes executable logic. Tiger Data: TimescaleDB hypertables, pgvectorscale embeddings, and pg_textsearch BM25 live within a single unified Postgres database, enabling hybrid search across structured data and vectors. The evaluation harness forks the database, executes multi-week simulations, benchmarks against planted answers, and tears down the fork. Data: Built on the CDISC pilot dataset combined with synthetic augmentation—no real patient data is ever used.

Challenges we ran into

Gemini free-tier limits: Rate limits and quota exhaustion prevented recording live Gemini output on certain execution paths. We implemented an open replay cache with template fallbacks to keep demonstrations fully stable and transparent. Embedding behavior: gemini-embedding-2 folds batches of inputs into a single vector, requiring us to serialize and embed texts individually. Blinding guarantees: Preventing unblinded treatment arms from leaking into prompts, context evidence, charts, or detector pipelines required rigorous database schema separation and end-to-end audit tracking. Tiger forks: Forking creates a distinct service instance. Because free-tier quotas limit active services and each fork took ~28 seconds to initialize, we leveraged local Docker forks for iteration and reserved Tiger forks for formal benchmark runs.

Accomplishments that we're proud of

Guaranteed human-in-the-loop governance: humans review and approve every query, communication, agenda, and agent action, with all state changes preserved in an immutable audit log. Deterministic safety enforcement: Gemini cannot emit uncited claims due to strict verification rules, and clinical detection rules remain transparent and deterministic. Unbiased scoring: Validated against 238 planted anomalies where detection logic is strictly isolated from the ground-truth answer key. Identical schema and migration parity across local Docker environments and Tiger Cloud. A comprehensive 4-minute demonstration walkthrough and pitch presentation.

What we learned

Verification is the prerequisite for deploying generative AI in regulated spaces. Pairing AI drafting with deterministic verification keeps systems reliable. Cosine similarity alone is insufficient for clinical terminology. "Heart attack" versus "myocardial infarction" registered an embedding similarity score of just 0.79, underscoring the necessity of combining dictionary mappings with LLM adjudication. Consolidating time-series logs, vector embeddings, and full-text search into a single PostgreSQL engine drastically minimizes infrastructure overhead. Rigorous, adversarial benchmarking reveals far more actionable signal than self-congratulatory metrics.

What's next for Paritty

Scale up Gemini evaluation runs using production tier quota to benchmark protocol Q&A and causality agreement against real-time API responses. Automate full-scale regression suites across Tiger Cloud database forks. Broaden the library of automated edit checks and build native connectors for industry-standard EDC and clinical safety platforms. Pilot the workflow with clinical trial teams under formal research governance, maintaining all blinding safeguards and human-approval gates.

Built With

Share this project:

Updates

Submission history