cd /news/artificial-intelligence/trialtrace-ai-powered-evidence-revie… · home › topics › artificial-intelligence › article
[ARTICLE · art-178770] src=github.com ↗ pub= topic=artificial-intelligence verified=true sentiment=↑ positive

TrialTrace: AI-Powered Evidence Review for Clinical Trial Outcomes

TrialTrace, a Streamlit dashboard deployed on Google Cloud, combines ClinicalTrials.gov registry checks with an LLM abstract reader to verify whether registered trial outcomes are reported in linked PubMed abstracts, with every finding backed by a code-verified quote and human review. On 19 unseen trials, the LLM reader reached 91% precision (20 of 22) and 80% recall (20 of 25) against pre-registered targets of 90% and 80%, with 0 made-up quotes across 204 model calls; on a second frozen set of 19 trials and 72 outcomes it scored 85% precision and 85% recall, versus 31% recall for plain keyword code. Human reviewers agreed with the labels 90% of the time (27 of 30 pairs, kappa 0.85), and about 42% of outcomes are flagged "unclear" and routed to a reviewer; a planned v2 would add safety-statement extraction and adverse-event comparison.

recommendation

Validate LLM-extracted quotes with deterministic code before surfacing them, and route low-confidence cases to human review; the reader hit 0 fabricated quotes in 204 calls and 85% recall versus 31% for keyword matching.

more in playbook: Verifying model output
read11 min views6 publishedNov 30, 2026
TrialTrace: AI-Powered Evidence Review for Clinical Trial Outcomes
Image: Michielbdejong (auto-discovered)

Evidence-grounded review of clinical-trial reporting: registry checks, an LLM abstract reader with code-verified quotes, source evidence for every finding, and human review with an audit history. Deployed on Google Cloud with Google sign-in.

Registry Checks + LLM Abstract Reader + Quote Validation + Human Review + Pipeline Observability + CI/CD to Cloud Run

TrialTrace helps reviewers trace clinical-trial reporting back to its sources. It brings together ClinicalTrials.gov records and linked PubMed abstracts, checks whether registered outcomes are reported, and presents findings with supporting evidence and a review history.

The project combines deterministic registry checks, an LLM abstract reader, evidence validation, and human review in a Streamlit dashboard.

Version Scope Status
v1 · Registry and abstract validation Validate registered trial outcomes against results published in the registry and linked paper abstracts. Track changes between captured registry versions, results-posting status, completion timelines, and sponsor reporting counts Implemented
v2 · Safety Extract safety statements from abstracts and compare them with registry adverse-event evidence Planned extension

All safety-related work belongs to project v2. This includes adverse-event ingestion and parsing, database tables and migrations, statement extraction, numeric and time-window comparisons, assisted matching, review tools, and supporting documentation.

  • Inspect a trial. Open an NCT ID and explore registry outcomes, linked papers, findings, and cited evidence.
  • Check reporting. View results-posting status, time since primary completion, and differences between registered and posted outcomes.
  • Trace outcomes across papers. Review identified, unclear, and not-identified outcomes alongside highlighted abstract quotes.
  • Review findings. Accept, correct, or mark a finding as undetermined, with a reason and an audit history.
  • Explore the stored corpus. View sponsor reporting counts and fixed cross-trial queries.
  • Export findings. Download CSV and Markdown reports.

The dashboard provides All trials, One trial, Assisted review, Sponsors, and Patterns views. Review queues distinguish Needs review, Human-verified, and Unresolved findings, and can be sorted by risk (unclear first).

In One trial, a Pipeline status panel shows six stages (registry, raw backup, papers, matching, findings, review) with dates and run IDs, keeping "not started", "nothing to read", "failed" and "awaiting review" apart. Stage attempts are logged as structured events (pipeline_events), and a stage that started but has not reported back is shown as completion overdue. An Outcome overview lists one row per registered outcome (primary first) with its roll-up status, paper evidence and review progress; clicking a row filters the findings below. Counts in the panel are outcome-paper findings, not registered outcomes.

The LLM abstract reader was scored on trials it had never seen, against targets written down before the run (design decisions D93, D42, D101). Ranges are 95% Wilson intervals. Counts are small, so treat these as point estimates.

Measure Result 95% range Set
Precision (when it says "reported", is it right?) 91% (20 of 22) 72–97% 19 unseen trials, target 90%
Recall (reported outcomes found with a real quote) 80% (20 of 25) 61–91% same set, target 80%
Made-up quotes or failed reads 0 / 0 204 model calls; quotes are checked by code
Precision and recall on a second frozen set 85% / 85% 66–94% 19 trials, 72 outcomes
LLM reader vs plain keyword code (recall) 85% vs 31% 66–94% vs 17–50% second frozen set
Human agreement with the labels 90% (27 of 30), kappa 0.85 30 pairs labelled blind

About 42% of outcomes are called "unclear" and sent to a reviewer. That is routing, not a wrong answer. Labels were partly AI-drafted and checked by a person, and the sets are small.

Evidence-expansion verdict (2026-11-24): neither the fixed expansion baseline nor the agent showed enough practical benefit to justify shipping as part of V1. On 25 outcomes, V1 had 17 correct final statuses, the expansion baseline 18, and the agent 19. The agent's one-case advantage over the baseline does not establish a meaningful improvement; it used 350 tool/model calls versus 346. Both expansion approaches made one primary false upgrade, missing the target of zero.

The strict model-drafted labels classified 27 of 40 unresolved outcomes as not identified in the readable sources; only 165 of 344 fetched papers had open-access full text. This points to source coverage as the main limit in this experiment. V1 stays the core. Keep expansion code and guards as experimental work. These results do not prove either approach useless in general: the sample is small, labels had no human review, each configuration ran once, and run 2 followed fixes informed by locked-test errors.

This source-expansion baseline uses model calls and is separate from the keyword baseline in the V1 results above. Full-paper expansion was tested experimentally; it is not a shipped feature.

Locked test, 25 outcomes V1 Expansion baseline Agent
Correct final status 17 18 19
False upgrades (primary / secondary) 0 / 0 1 / 1 1 / 0
Tool and model calls 0 346 350

Limits: 25 outcomes, labels drafted by a model with no human review, one run each, and run 2 followed fixes informed by the locked-test errors.

A follow-up table audit found no missed results in the open-access tables of the 27 not-identified outcomes. Picture tables, figures and supplements were not read.

For every NCT ID the dashboard can answer "where did this trial get stuck, from registry download to human review?"

  • Pipeline status panel (One trial): six read-only lines, one per stage: registry, raw backup, papers, matching, findings, review. Each shows a state, a plain-language summary, a date and the run ID. It reads the tables that hold the facts, so nothing is copied or can disagree.
  • Clear states:* not started* ,nothing to read ,failed andawaiting review are different things and are shown differently. An unclear model answer is a finding to interpret, not a failure. An old failure next to a newer success is described as older, never as the current state.
  • Structured stage events: each stage attempt writes one JSON log line and one row inpipeline_events (stage, status, error code, duration, run ID, counts). Writing an event never stops the pipeline.
  • Overdue detection: a stage first writes a durablestarted event on its own connection, then a completion event. A start with no completion shows as running, then ascompletion overdue (possibly interrupted) after 15 minutes. That is not proof of a crash, because there is no heartbeat. A failure after an unexpected exception is also written on its own connection, so a rollback cannot erase it.
  • Raw backup status: whether the copy of each raw download reached Cloud Storage.
  • Verified on live Cloud SQL with a one-off Cloud Run job, including the separate-connection write.

Not built yet: an All trials "needs attention" filter, a heartbeat, and alerts. Cloud Run logs and metrics cover the deployed service itself.

flowchart TB
    subgraph Sources["External sources"]
        CT["ClinicalTrials.gov API"]
        PM["PubMed E-utilities"]
    end
    subgraph Pipeline["Python processing pipeline"]
        ING["Fetch and parse registry records and papers"]
        LINK["Check paper-to-trial links"]
        REG["v1 Registry checks"]
        MATCH["v1 Outcome-abstract matching"]
        GUARD["Validate quotes and trial identity"]
        ROLL["Combine evidence per outcome"]
        REPORT["Build findings and review queue"]
    end
    RAW[("Raw source files by content hash")]
    GCS[("Google Cloud Storage<br/>Raw files and metadata backup")]
    DB[("PostgreSQL<br/>Snapshots, evidence, papers, matches, reviews")]
    MODEL["OpenAI abstract reader"]
    DASH["Streamlit dashboard<br/>Google sign-in and reviewer decisions"]
    API["Optional FastAPI service<br/>Stored data, reviews, exports"]
    EXPORT["CSV and Markdown exports"]

    CT --> ING
    PM --> ING
    ING --> RAW
    ING -->|"Configured ingestion backup"| GCS
    ING --> DB
    DB --> LINK
    LINK --> MATCH
    DB --> MATCH
    MATCH <--> MODEL
    MATCH --> GUARD
    GUARD --> DB
    DB --> REG
    DB --> ROLL
    REG --> REPORT
    ROLL --> REPORT
    REPORT --> DB
    DB --> DASH
    DASH -->|"Append review decisions"| DB
    DB --> API
    DASH --> EXPORT
    API --> EXPORT

In production, the Streamlit dashboard runs on Google Cloud Run (built by GitHub Actions, stored in Artifact Registry), signs users in with Google, reads its evidence from Cloud SQL for PostgreSQL 16, gets its secrets from Secret Manager, and backs up raw source files to Cloud Storage. The OpenAI abstract reader is the only external model service. Locally, the same code runs against your own PostgreSQL. The dashboard uses the Python application and the database directly. The optional API exposes stored data, exports, and review operations. Ingestion saves raw downloads locally and, when TRIALTRACE_RAW_BUCKET is configured, uploads the files and metadata to Google Cloud Storage. The deployed bucket is gs://trialtrace-514821-raw in us-central1. The current hosted dashboard reads its evidence from PostgreSQL; bucket uploads are performed by the configured ingestion process.

  1. Capture the registry record. Save the raw response and metadata locally, copy them to the configured Cloud Storage bucket, and extract outcomes and citable evidence. Preserve each distinct content version with its hash.
  2. Collect candidate papers. Retrieve PubMed records and abstracts, then check their connection to the trial.
  3. Read each outcome-paper pair. Give the LLM the registered outcome and abstract. Store its answer, supporting quote, and model metadata. An optional rules baseline provides a separate comparison.
  4. Validate and combine evidence. Check quoted text and offsets, apply trial-identity safeguards, and combine paper-level answers into one finding per registered outcome.
  5. Review and export. Present source evidence and record reviewer decisions separately from original predictions.

Stored answers can be reused when inputs and model configuration match. The dashboard estimates new model calls and requests confirmation when an analysis needs more than five calls.

The v1 registry and abstract workflow uses outcomes from the latest saved registry snapshot. Registry-change detection compares the two most recently captured distinct versions in the database. With insufficient history, the result is unknown.

Each captured registry snapshot has a content hash and capture date, allowing findings to be traced to the record used for analysis.

Not identified in v1 means supporting reporting was not identified in the available abstract text. Full-paper text analysis was tested experimentally and not adopted. Findings describe evidence and differences for human review. Sponsor summaries describe the ingested corpus, and missing data retain an explicit unknown state.

Requires Python 3.12 or newer, PostgreSQL, and an OpenAI API key for model-based matching. An optional NCBI key increases PubMed request capacity.

pip install -e ".[dev,dashboard]"

Create a .env file at the project root.

TRIALTRACE_DATABASE_URL=postgresql://user:password@localhost:5432/trialtrace
OPENAI_API_KEY=your_openai_key
NCBI_API_KEY=your_ncbi_key
TRIALTRACE_DISABLE_LOGIN=1

Cloud raw-source backup is deployed in gs://trialtrace-514821-raw. To enable uploads from your ingestion environment, install pip install -e ".[cloud]", configure Application Default Credentials, and set TRIALTRACE_RAW_BUCKET=trialtrace-514821-raw. Each upload uses a create-only object precondition. An upload failure is logged while local ingestion continues, and an operator can reconcile missing objects. See the storage setup and recovery steps.

The database URL above is for a local PostgreSQL only. On Google Cloud the hosted dashboard gets its URL from Secret Manager, and it points to the separate Cloud SQL database (see the deployment guide). The two databases are not synced.

Start PostgreSQL with a database matching that connection string, then run the workflow.

python -m trialtrace.db.migrate
python -m trialtrace ingest NCT04644237
python -m trialtrace ingest-papers NCT04644237
python -m trialtrace match-papers NCT04644237
python -m trialtrace report
streamlit run dashboard/app.py

match-papers makes paid model calls for uncached pairs. Add --with-baseline to store a rules-based comparison, or --refresh to request new answers. Review findings through the command line with the following command.

python -m trialtrace review --reviewer "Your Name"

For Google sign-in, set TRIALTRACE_ALLOWED_EMAILS to a comma-separated allowlist, copy .streamlit/secrets.toml.example to .streamlit/secrets.toml, and configure Google OAuth credentials. Set TRIALTRACE_DISABLE_LOGIN=0 to enable authentication. An empty allowlist blocks access when authentication is enabled.

Keep .env and .streamlit/secrets.toml out of version control. See the Google Cloud deployment guide for hosted configuration.

docker compose up --build

Compose starts PostgreSQL, the API at http://localhost:8000, and the dashboard at http://localhost:8501. Supply the environment and login configuration described above.

To run the API separately, install its extra and start Uvicorn.

pip install -e ".[api]"
uvicorn trialtrace.api:app --port 8000

API documentation is available at http://localhost:8000/docs. The service supports inspecting stored trials and findings, estimating matching calls, submitting reviews, and exporting findings. Model execution is initiated through the CLI or dashboard.

python -m pytest

Database tests use a separate trialtrace_test database and roll back test transactions. The PostgreSQL account needs permission to create that database on the first run. Tests use mocked external services. The GitHub Actions workflow runs PostgreSQL-backed tests and a Docker image build on every push.

trialtrace/
  sources/          Registry and PubMed clients, raw-source storage
  parse/            Registry, posted-result, and paper parsers
  checks/           Results status, timelines, links, sponsor counts, patterns
  compare/          Registry differences and outcome-paper evidence matching
  safety/           v2 safety modules and safety migrations
  db/               PostgreSQL repository and core migrations
  review/           Review queues, decisions, highlighting, exports
  match_papers.py   v1 outcome-abstract matching, answer reuse, call estimates
  report.py         Findings and report generation
  api.py            Optional FastAPI service
  cli.py            Command-line entry points
dashboard/          Streamlit interface
evals/              Evaluation tools, local datasets and run records
tests/              Automated tests
docs/               Workflows, deployment, and design decisions

The dashboard is deployed using Google Cloud Run and Cloud SQL, with raw-source backup in Google Cloud Storage. CI/CD: every push to main runs the tests (ci.yml); when they pass, deploy.yml builds the Docker image, pushes it to Artifact Registry and updates the Cloud Run service. GitHub signs in to Google with Workload Identity Federation, so no key file is stored. The deployment guide describes its configuration, and workflow diagrams expand on the data flow.

── more in #artificial-intelligence 4 stories · sorted by recency
── more on @trialtrace 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/trialtrace-ai-powere…] indexed:0 read:11min 2026-11-30 · —