Spaces:
Paused
Paused
Commit History
-
Merge pull request #6 from KevinIsInCoding/feat/stage4-kg-extraction
KevinIsInCodingUnverified signaturefeat(trials): LLM entity extraction + trial ranking fixcbc4a98 -
fix(app): use local SVG avatar to fix broken Gradio icon
KevinIsInCoding +1: Claude Sonnet 4.6Remote DiceBear URL in avatar_images fails on network errors and CORS. Replace with assets/flame.svg. Also document gradio run command in CLAUDE.md. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>5bd89ce -
fix(query): rank trials by status+relevance, raise cap from 5 to 10
KevinIsInCoding +1: Claude Sonnet 4.6Previously find_trials_for_entities() broke early on arbitrary set iteration order, silently dropping relevant trials (AMX0114 was position 7, never seen). - Collect all matching trial nodes before truncating - Score each trial by number of linked query entities - Sort: RECRUITING first, then ACTIVE_NOT_RECRUITING, then by score - Raise max_trials default 5 → 10 (agent call updated to match) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>eb40daa -
feat(trials): replace hardcoded entity regex with LLM extraction
KevinIsInCoding +1: Claude Sonnet 4.6- Remove _KNOWN_TARGETS regex list — cannot handle novel compounds like AMX0114 - Add extract_target_entities_llm(): batches 10 trials per Claude Haiku call, extracts biological target (gene/protein) not drug name, canonicalizes via extraction/normalizer. AMX0114 now correctly maps to TARDBP. - Add data/tools/extract_trial_targets.json tool schema - Add TRIAL_EXTRACTION_TOOLS export to tools.py - Widen default status filter from RECRUITING-only to also include NOT_YET_RECRUITING and ACTIVE_NOT_RECRUITING - ingest_trials.py: --status now accepts multiple values; creates Anthropic client and passes it to fetch_als_trials() Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>0569d05 -
perf(extraction): switch to Haiku + add per-paper retry for missed PMIDs
KevinIsInCoding +1: Claude Sonnet 4.6- EXTRACTION_MODEL: claude-sonnet-4-6 → claude-haiku-4-5-20251001 Expected: 60min → 10min, $1.50 → $0.12 for 500 papers - Refactor _extract_batch to use shared _call_claude() helper - Add retry loop: papers missed by Claude in a batch are retried individually before being recorded as empty (root cause: tool_choice=any only guarantees ≥1 call, not N calls) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>ac8f675 -
Merge pull request #5 from KevinIsInCoding/feat/stage4-kg-extraction
KevinIsInCodingUnverified signaturefeat: Stages 3–5 — full RAG pipeline, knowledge graph, Gradio UIb3e42fa
-
feat: Stage 5 — Gradio UI + HuggingFace Spaces deployment
KevinIsInCoding +1: Claude Sonnet 4.6- app.py: Gradio 6.20 Blocks UI with streaming chatbot, 6 example question buttons (two columns), status bar showing chunk/trial/KG counts, medical disclaimer footer - Streaming pattern: status updates shown as italic while waiting, tokens accumulate in real-time, input locked during generation - Module-level resource loading: BioLORD collection + KG graph + trials loaded once at startup (not per request) - requirements.txt: HF Spaces mirror of pyproject.toml deps - README.md: HF Spaces metadata header + full setup guide including offline pipeline run order, architecture diagram, data sources table Verified: app starts in <5s, serves on localhost:7860, all 510 chunks / 112 trials / 220 KG nodes loaded at startup. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>d515e2b -
Merge pull request #4 from KevinIsInCoding/feat/stage4-kg-extraction
KevinIsInCodingUnverified signatureFeat/stage4 kg extraction23b4a54 -
Merge pull request #3 from KevinIsInCoding/fix/pmc-elink-id-mapping
KevinIsInCodingUnverified signaturefeat: Stage 2 ingestion fixes + Stage 3 RAG pipeline57a87cc -
feat(rag): switch embedding model to BioLORD-2023-C
KevinIsInCoding +1: Claude Sonnet 4.6Replace all-MiniLM-L6-v2 with FremyCompany/BioLORD-2023-C. BioLORD is anchored to UMLS/SNOMED CT/MeSH ontologies during training, so it natively resolves biomedical synonyms (TARDBP↔TDP-43, SOD1↔superoxide dismutase) without relying on exact string matches. This improves retrieval quality for physician queries that use clinical phrasing rather than gene symbol abbreviations — the primary trust signal for a physician-facing tool. ChromaDB collection rebuilt: 510 chunks at 768d (vs 384d for MiniLM). Smoke test: query 'superoxide dismutase mutation motor neuron' returns all SOD1-specific papers at top-3 with no abbreviation in the query. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>3c9dd57 -
feat: Stage 4 — entity extraction + knowledge graph + KG-expanded RAG
KevinIsInCoding +1: Claude Sonnet 4.6Entity extraction pipeline: - extraction/normalizer.py: HGNC alias table (TDP-43→TARDBP, BIIB067→tofersen, etc.), compound/mechanism alias maps, CanonicalRegistry for persistent canonical_ids.json - extraction/extractor.py: Claude Sonnet NER, 10 papers/batch, uses full_text over abstract when available, resumable via .progress.json, rate-limit retry - scripts/extract_entities.py: CLI with --max for test runs, --reset to restart Knowledge graph: - graph/builder.py: NetworkX DiGraph, seed ALS entities (genes/compounds/mechanisms), upsert nodes+edges with running-average confidence, trial→target links - graph/query.py: expand_query_entities() (BFS, confidence-filtered), find_trials_for_entities() (KG-linked trial lookup) - graph/serializer.py: pickle (fast) + JSON (human-readable) save/load - scripts/build_graph.py: CLI runner Agent upgrade (KG+RAG): - agents/research_agent.py: step 1 = KG expansion of query entities before RAG; "tofersen" now surfaces SOD1 papers even if not …42fb3af -
feat: Stage 3 — RAG pipeline + working end-to-end query
KevinIsInCoding +1: Claude Sonnet 4.6- rag/indexer.py: ChromaDB collection builder with section-aware chunking (one chunk per PMC XML section, falls back to abstract) - rag/retriever.py: semantic search + entity search with citation-weighted re-ranking (score = similarity * log(citation_count + 2)) - agents/research_agent.py: streaming synthesis agent (mirrors beacon pattern) uses search_research_landscape tool → RAG + trial match → Claude synthesis - scripts/build_index.py: CLI to build ChromaDB index from papers.jsonl - main.py: Rich CLI interface with streaming output - Add openai dependency (required by llm.py provider abstraction) Verified: 510 chunks indexed from 499 papers, end-to-end query returns structured research landscape with PMIDs, mechanisms, and trial links. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>56fa10c -
Merge pull request #2 from KevinIsInCoding/fix/pmc-elink-id-mapping
KevinIsInCodingUnverified signaturefix(pmc): fix batch elink ID mapping bug and add progress bar5c88f56 -
fix(pmc): add rich progress bar to get_pmcids (499 calls, ~3 min)
KevinIsInCoding +1: Claude Sonnet 4.6Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>83263a0 -
fix(pmc): use per-PMID elink instead of batch to preserve ID mapping
KevinIsInCoding +1: Claude Sonnet 4.6Batch elink merges all source IDs into one LinkSet — no way to map which PMC ID belongs to which PMID. Send one at a time instead. Also removes defunct NCBI ID Converter API (returning 404). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>45900d6 -
Merge pull request #1 from KevinIsInCoding/docs/prfaq-dateline
KevinIsInCodingUnverified signaturedocs: add launch date to PRFAQ press release dateline5fb461d -
docs: add launch date to PRFAQ press release dateline
KevinIsInCoding +1: Claude Sonnet 4.6Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>0438b7f -
docs: correct ALS genetics claim in PRFAQ, strengthen rationale
KevinIsInCoding +1: Claude Sonnet 4.690% of ALS is sporadic — no identified genetic cause. Only ~10% is familial. Updated the 'why ALS' answer to reflect the real reasons: active but under-resourced research frontier, fast and fatal disease course demanding urgency, and scientific complexity (mechanism-level, not gene-level) that makes a knowledge graph uniquely valuable. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>9dab3bd -
docs: add PRFAQ for candle-fire
KevinIsInCoding +1: Claude Sonnet 4.6Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>fc09788 -
feat: initial project scaffold and Stage 2 ingestion pipeline
KevinIsInCoding +1: Claude Sonnet 4.6- Project foundation: config, models, tools, llm, logging, prompts - Tool schemas: extract_entities.json, search_landscape.json - Stage 2 ingestion: - ingestion/pubmed.py: PubMed Entrez client (batch fetch, rate-limit aware) - ingestion/pmc.py: PMC XML full-text fetcher (JATS section parser) - ingestion/semantic_scholar.py: citation count enrichment via S2 batch API - ingestion/clinicaltrials.py: ClinicalTrials.gov v2 ALS trials client - scripts/ingest_papers.py: orchestrates PubMed + PMC + citations - scripts/ingest_trials.py: fetches recruiting ALS trials - Stub modules for Stage 3-5 (rag/, graph/, agents/, app.py, main.py) - MIT License, .gitignore (excludes data/, .env, logs/) - CLAUDE.md architecture guide Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>0ccfe4a