Skip to content

Add ClinicalxCRAFT: LLM-orchestrated cohort investigator over TCGA data - #3

Open
nitchakorn wants to merge 7 commits into
EmergenceAI:mainfrom
nitchakorn:clinicalxcraft
Open

Add ClinicalxCRAFT: LLM-orchestrated cohort investigator over TCGA data#3
nitchakorn wants to merge 7 commits into
EmergenceAI:mainfrom
nitchakorn:clinicalxcraft

Conversation

@nitchakorn

Copy link
Copy Markdown

Summary

  • Lets clinicians ask free-text questions about a cancer cohort (KIRC — kidney renal clear cell carcinoma, the deepest-covered cohort in the Pan-Cancer Atlas) and watch an LLM agent investigate it live via CRAFT MCP (schema discovery, NL-to-SQL, execution). Zero hand-written SQL anywhere.
  • Two entrypoints sharing one agent core: app.py (free-text investigator) and app_dashboard.py (opens on a live cohort snapshot + embedded per-patient specimen ledger, then takes a scoped follow-up question).
  • Reasoning model hosted on Nebius Token Factory (NVIDIA Nemotron 3 Super).

Test plan

  • py_compile passes on all modules
  • Live-verified against real CRAFT/Snowflake data (not mocked) — reproduces known TCGA KIRC biology (VHL→HIF→mTOR axis)
  • Reviewer: run streamlit run apps/clinicalq/app_dashboard.py with NEBIUS_API_KEY set and CRAFT OAuth configured

https://claude.ai/code/session_01TjFkCejVPKEfT1u9gLwCTG

nitchakorn and others added 3 commits July 11, 2026 17:07
Lets clinicians ask free-text questions about a cancer cohort and watch an
agent investigate it via CRAFT MCP (schema discovery, NL-to-SQL, execution) —
zero hand-written SQL anywhere. Ships two entrypoints: a free-text
investigator (app.py) and a dashboard version (app_dashboard.py) that opens
on a live cohort snapshot plus an embedded per-patient specimen ledger
before taking a scoped follow-up question. Cohort is KIRC (kidney renal
clear cell carcinoma), the deepest-covered cohort in the Pan-Cancer Atlas.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TjFkCejVPKEfT1u9gLwCTG
The per-patient table (imaging links, mutations, protein, purity) is the
useful thing to see first, not the aggregate bar-chart snapshot — that's
now collapsed into an expander below, still used as context for follow-up
questions.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TjFkCejVPKEfT1u9gLwCTG
Enables a public Streamlit Community Cloud deployment: no shell env and no
browser reachable from a hosted server for the interactive CRAFT OAuth
callback, so both get bootstrapped from st.secrets at startup instead. Falls
back silently to local env vars / token cache file when no secrets.toml
exists (local dev, unchanged).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TjFkCejVPKEfT1u9gLwCTG
@nitchakorn

Copy link
Copy Markdown
Author

nitchakorn and others added 4 commits July 11, 2026 18:15
asyncio TaskGroups (used internally by the mcp SDK's streamable HTTP
transport) wrap failures in an ExceptionGroup — str(e) on those only says
"unhandled errors in a TaskGroup (N sub-exception)", hiding what actually
failed. Recurse into .exceptions and also show the full traceback so a
failed connection is debuggable from the deployed app itself.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TjFkCejVPKEfT1u9gLwCTG
BUILD_YOUR_OWN_COHORT.md gives clinicians a copy-paste Claude Code prompt
that re-derives coverage numbers and driver genes for a new TCGA cohort from
scratch (no assumptions carried over from KIRC) and rebuilds the dashboard +
specimen ledger against real query results. Linked from the README.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TjFkCejVPKEfT1u9gLwCTG
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant