Lookahead

Tagline: Rehearse a clinical trial before you lock the protocol.

Inspiration

Most trial delays are decided before the first participant walks in. A visit schedule that's too heavy for participants, a consent form that disagrees with the protocol, or an ethics review sitting on the critical path usually surfaces only after the protocol is locked, when every fix costs an amendment. We wrote a fictional onboarding case (REST-101, a student joining a sleep-coaching trial) in which one missing training record and one serialized setup step cost two weeks of waiting. We also went through the 232 JSHS student abstracts that map to the hackathon tracks. Track 2 had a real gap: several projects improve assays or extract lab data, but none builds software for trial setup, recruitment, or site risk. Today's AI trial tools automate execution after the protocol is final. We wanted a way to rehearse the protocol before then.

What it does

Lookahead is a rehearsal workspace for a protocol that is still in draft.

  • Stakeholder rehearsal: describe a change, such as fewer visits, e-consent or evening hours, and see how 11 groups (participants, sites, oversight, sponsor, data) are likely to respond, as a knowledge graph and a stance table.
  • Evidence deliberation: five expert agents (trialist, participant-engagement scientist, biostatistician, regulatory/ethics reviewer, site-ops lead) debate the change using papers from OpenAlex, Europe PMC/PubMed and ClinicalTrials.gov, plus your own uploaded documents. Then a moderator writes a consensus. Every claim cites a source or is flagged as uncited.
  • Study build: paste a schedule of activities to get a visit × assessment matrix, a draft CRF, edit checks and burden figures. Paste a source note to get auto-generated queries.
  • Document preflight: cross-checks the protocol, consent and onboarding text for mismatched study IDs, visit counts and versions, pointing to the exact line.
  • Start-up timeline: delay any start-up step and see whether first-participant-in moves.

It runs in a free demo mode (illustrative agents, no model calls) or with your own OpenAI key. There's also a 60-agent interactive walkthrough of the REST-101 case that doesn't require an account.

How we built it

  • Vue 3 + Vite with Vue Flow and d3-force for the knowledge graph, shadcn-vue/Reka UI components, and a small Express server with a strict Content Security Policy. Deployed on Vercel, with Google sign-in through Auth.js.
  • Everything we could keep in the browser stays there. The OpenAI key goes straight from the browser to api.openai.com and is never stored server-side. The scholarly APIs are called from the browser too. Chats, research records and uploaded documents live in IndexedDB.
  • Local retrieval engine: uploaded PDFs and notes are chunked and embedded on-device with transformers.js (MiniLM in a Web Worker), stored as int8-quantized vectors (about 4× smaller than float32), and ranked with hybrid BM25 + vector search, reciprocal-rank fusion and MMR. Exact terms like NCT ids and doses still match.
  • Reproducible runs: every run, demo runs included, is saved as a research record. Each record holds the prompt, guardrail results, model, seed, prompt version, token counts and a SHA-256 fingerprint, and can be exported as CSV or JSON.
  • Guardrails run in layers: local screening for PII, secrets, prompt injection and individual medical questions, then OpenAI moderation, the model's own in-scope check, and moderation on the output.

Challenges we ran into

  • Finding literature sources a browser can call. Google Scholar has no API and Semantic Scholar blocks cross-origin requests, so we built on OpenAlex, Europe PMC and ClinicalTrials.gov. We normalize their results into one shape, dedupe them, drop retracted papers, and stagger requests with a retry on rate limits.
  • Keeping citations honest. Models invent source ids. We validate every S# against the evidence pack, drop invalid ones, and flag uncited claims instead of letting them through. We also compute an independent confidence-weighted cross-check of the agents' estimates.
  • Semantic scores lower than we expected. MiniLM cosine scores for short queries sit around 0.2–0.3 even for real matches. Our first threshold hid good results, so we tuned it to 0.2 and always show keyword matches instantly.
  • Browser quirks on the demo path. GSAP and requestAnimationFrame pause in background tabs, which froze the boot screen, so we added a timer fallback. motion-v's whileInView throws inside hidden panels, so we switched to animate.
  • Merging two prototypes. Two of us built separate workspaces in parallel. Combining them into one build without wiping anyone's saved data meant keeping the old storage keys and auth cookie names.

Accomplishments that we're proud of

  • Every number the agents produce can be traced to a query, a source and a credibility score in the provenance tab. Sources the agents never saw can't be cited.
  • A full retrieval stack (embeddings, hybrid search, quantized index) runs entirely in the browser, so the team's documents never leave the device. Only matched excerpts reach the model.
  • Over 200 automated tests cover the controller, guardrails, records, retrieval, evidence and the trial tools.
  • Mocked output is always labeled. Demo runs say "local demo", the graph says "illustrative topology", and the case study says "fictional".

What we learned

  • In clinical research, provenance matters more than fluent output. A cited "maybe" is worth more than an uncited "yes".
  • Keeping data local is a design constraint, not a feature you add later. It decided our architecture (in-browser embeddings, a browser-only key, no database).
  • The planning tools that need no model at all (preflight, critical-path timeline, study build) were some of the most convincing parts of the demo.

What's next for Lookahead

  1. Validate stakeholder predictions against real amendment and retention outcomes from ClinicalTrials.gov, so the scores are calibrated rather than self-reported.
  2. Export the study build (schedule of activities, CRF, edit checks) in a format execution-stage EDC tools can import, so rehearsal hands off directly to the build.
  3. Add OCR and Word support to the source library so teams can bring scanned site reports and real protocol drafts.

Built with

vue, vite, javascript, node.js, express, vue-flow, d3, transformers.js, onnx-runtime-web, orama, pdf.js, indexeddb, openai, openalex, europe-pmc, clinicaltrials.gov, auth.js, google-oauth, tailwindcss, reka-ui, gsap, vercel


Media checklist (not for Devpost text)

Screenshots

  1. Split view mid-run: chat on the left, stakeholder graph pulsing on the right.
  2. Evidence panel, consensus tab, with S# citations.
  3. Provenance tab: queries, source credibility breakdown, excluded links.
  4. Source library with an uploaded PDF and a cited "team document" passage.
  5. Study build: visit × assessment matrix and auto-queries.
  6. Document preflight with line-level findings.
  7. Start-up timeline with a delayed step moving first-participant-in.
  8. The REST-101 60-agent sample graph.

Demo video (≤ 2 min)

  • 0:00–0:15: the problem. Fixes found after protocol lock cost an amendment.
  • 0:15–0:50: type (or say) a protocol change, run it, watch the stakeholder graph, open an agent.
  • 0:50–1:20: the evidence deliberation consensus, then the provenance tab.
  • 1:20–1:45: quick tour of study build, preflight and timeline.
  • 1:45–2:00: privacy (key and documents stay in the browser) and what's next.

Links

  • Repo: github.com/kevinkiyosepyo/healtlink-avengers

Built With

Share this project:

Updates

Submission history