explaingit

hamfree-code/literature-synthesis-engine

0PythonAudience · researcherComplexity · 5/5ActiveLicenseSetup · hard

TLDR

Disease-agnostic pipeline that pulls medical papers from PubMed Central and medRxiv, runs two-step Claude extraction with arbiter reconciliation, and writes researcher, pharma, and lay reports with literal-quote provenance.

Mindmap

mindmap
  root((literature-synthesis-engine))
    Inputs
      PubMed Central papers
      medRxiv preprints
      Topic query
    Outputs
      Researcher report
      Pharma due-diligence brief
      Executive summary PDF
    Use Cases
      Long COVID synthesis
      Rare disease scoping
      Drug target screening
    Tech Stack
      Python
      Claude API
      Supabase
      Flask

Things people build with this

USE CASE 1

Generate a multi-report literature synthesis for any PubMed-indexed condition

USE CASE 2

Run an arbiter-reconciled extraction over thousands of abstracts in about an hour

USE CASE 3

Build a Supabase-backed corpus with quote-level provenance for medical claims

USE CASE 4

Produce Vancouver-cited PDF briefs for pharma due diligence

Tech stack

PythonFlaskSupabaseClaudepgvectorAnthropic API

Getting it running

Difficulty · hard Time to first run · 1day+

Needs Anthropic API keys plus a Supabase project with pgvector, and a single run costs roughly 85 to 100 USD in model calls.

MIT license, free to use, modify, and redistribute with attribution.

In plain English

This project is an automated pipeline that reads large amounts of medical research papers and produces three written reports: one for researchers, one for pharmaceutical companies looking at drug targets, and one short summary for non-specialists. It is described as disease-agnostic, meaning it works for any condition that can be searched in PubMed Central. The main demonstration runs on Long COVID with about 4,666 papers processed in roughly one hour, and the README notes it has also been tested on Narcolepsy and Prostatic Neoplasms. The pipeline collects papers from PubMed Central and from medRxiv, then uses Anthropic's Claude Haiku model to read each abstract and pull out the study design, sample size, headline finding, and confidence score into a structured form. It then picks the top papers by a weighted score, downloads the full text from PubMed Central's open-access set, and runs a deeper extraction using Claude Sonnet. The deep extraction grades the paper on several standard scales used in evidence-based medicine, records effect sizes, and stores at least five literal quotes from the paper as proof for any claim it makes. The headline change in version 3.0 is that two separate model runs read each paper at different temperature settings, and a third model run reconciles them. The README says this removes a bias where the model anchors on its first reading. Other additions include splitting papers by their XML section tags so that the discussion and limitations are not cut off, linking extracted concepts to UMLS and MeSH medical vocabularies, computing Cohen's Kappa agreement against human ratings, and labelling each section of the final report as model inference, deterministic calculation, or arbiter consensus. Results are stored in Supabase tables for papers, extractions, provenance quotes, and contradictions, with pgvector embeddings. The system then pools effect sizes across studies, runs sensitivity checks, and produces Markdown reports that are converted to HTML and PDF with Vancouver-style citations. The README also describes a Flask user interface that runs a separate worker process so the page stays responsive during long runs, and notes a per-run cost of around 85 to 100 US dollars.

Copy-paste prompts

Prompt 1
Walk me through wiring this repo to a fresh Supabase project, including the papers, extractions, and provenance tables.
Prompt 2
Show me how to swap the Long COVID topic for Type 2 Diabetes and re-run the pipeline end to end.
Prompt 3
Help me reduce the per-run cost below 50 dollars by capping Sonnet calls and using the Batch API.
Prompt 4
Explain the two-step extraction plus arbiter flow and where I would add a third reviewer.
Prompt 5
Add a CLI flag that skips PDF rendering and only writes the Markdown research report.
Open on GitHub → Explain another repo

Generated 2026-05-22 · Model: sonnet-4-6 · Verify against the repo before relying on details.