Skip to content

Releases: BaranziniLab/CDWAgent

CDWAgent v0.6.0

Choose a tag to compare

@github-actions github-actions released this 29 Sep 05:32
3dfebaf

CDWAgent 0.6.0

Long database operations can now run as detached local jobs through MCP or CLI.
Submission returns immediately; agents monitor phase, heartbeat, row/byte counts,
elapsed time and advisory ETA. Results stream to private CSV/JSONL files and are
published as complete only on success. Cancellation, wall-clock and disk budgets,
worker-loss detection and explicit cleanup are supported. Credentials remain in
the connector/worker or OS keyring, outside tool arguments and job-status data.

The repository now includes a deterministic installable BRXT, lockfile, checksum,
bundled query-job skill, installation documentation, tests and release automation.
No-argument CLI invocation remains an MCP stdio server.

CDW patient lookups use an explicit identifier type to prevent ambiguous patient matches. Use id_type="PatientKey" for surrogate IDs. Preview limits are 1–1000 with truncation notices. Metadata counts are labeled estimates; cohort errors no longer trigger a misleading surrogate-key fallback. Legacy CSV export requires a new filename and publishes atomically. Schema tools now paginate and distinguish the bundled dictionary from live DB truth. Raw SQL audit logging requires explicit opt-in.

Validation includes offline lifecycle/security/domain tests and live small queries,
10,000-row real-table exports, 100,000-row generated transfers, parameterized
queries, EXPLAIN jobs, CLI monitoring after submit exits, cancellation, and the
BioRouter agent execution path with a deterministic local provider fixture.
Clinical tests selected constants from real tables, not patient details.

Jobs survive MCP/chat disconnects, not host shutdown. Interrupted exports require
explicit resubmission; arbitrary queries do not have automatic checkpoint/resume.
Network, permissions, database resource limits and disk exhaustion can still fail.
These limits are reported; this release does not promise every query can succeed.

Dependency locks were refreshed to patched releases, including cryptography 50+.
The old Intel macOS compatibility cap was removed; Intel installations without a
compatible wheel may require Rust/OpenSSL build prerequisites. pip-audit found no
known vulnerabilities in the resolved dependency set on the test platform.

CDWAgent v0.5.1 — BioRouter Extension Bundle

Choose a tag to compare

@Broccolito Broccolito released this 20 Jun 23:46
c0207dd

CDWAgent v0.5.1 — BioRouter Extension Bundle

Major reliability, performance, and multimodal-coverage overhaul (v0.5.0 + v0.5.1),
verified end-to-end against the live UCSF CDW (CDW_NEW.deid_uf, 7.17M patients).

Highlights

  • New build_cohort tool (22 tools total) — answers "how many patients with X" /
    "find patients with X" in ONE call across 8 modalities: diagnosis, medication,
    procedure, lab, imaging/radiology, immunization, allergy, vitals/flowsheets.
    Returns the count, the matched codes/names (cohort transparency), and a reusable
    cohort_subquery for composing multi-step / cross-modality questions.
  • DATA MODALITIES guide in the server instructions for the long tail (surgical/OR,
    ADT/admissions, cancer staging, radiology report notes, note section headings).

Correctness fixes (found on live data)

  • Apostrophe diseases (Crohn's, Parkinson's, Graves') no longer crash SQL (escaped).
  • Removed a key-cap that undercounted broad cohorts >100× (type 2 diabetes 1,227 → 219,352).
  • RFC-4180 CSV so comma/quote/newline values (note text) don't corrupt output.
  • search_procedures_by_code uses ProcedureDim (the old terminology table had no key → dead end).
  • crossmap_patient no longer re-parses its own CSV.

Performance (live-measured)

  • Key resolution 3–6× faster: name terms = name-dim UNION terminology DisplayString
    (full recall); code terms prefix-match only the code column. diabetes 219,352 in ~17s
    (was ~57s); G35 13,516 / I10 457,980 in ~3s.
  • vital cohort no longer times out (resolves FlowsheetRowKey via FlowsheetRowDim first).
  • summarize_table one bounded pass (was up to 51 scans); cohort_summary one GROUPING SETS pass.
  • Per-query/login timeouts; opt-in approximate count (APPROX_COUNT_DISTINCT, ~3× faster).

Robustness

  • Invalid column/object name errors are enriched with the closest real names from the
    bundled schema reference, so the agent self-corrects after a CDW schema change.

See CHANGELOG.md and eval/ for the full methodology and the 100-question modality-complete suite.

CDWAgent v0.4.3 — BioRouter Extension Bundle

Choose a tag to compare

@Broccolito Broccolito released this 06 May 03:07

What's New

This release adds the .brxt BioRouter Extension Bundle format, enabling one-click installation directly from BioRouter.

How to Install

  1. Download cdwagent.brxt below
  2. Open BioRouter → Extensions tab → Add extension
  3. Drag and drop the .brxt file (or click Browse file…)
  4. Click Next: Configure → and fill in your UCSF credentials
  5. Click Install Extension

BioRouter will install the virtual environment automatically.

Environment Variables

Variable Required Default Description
CLINICAL_RECORDS_USERNAME ✅ — UCSF network username (e.g. CAMPUS\\youruser)
CLINICAL_RECORDS_PASSWORD ✅ — UCSF network password
CLINICAL_RECORDS_SERVER optional QCDIDDWDB001.ucsfmedicalcenter.org SQL Server hostname
CLINICAL_RECORDS_DATABASE optional CDW_NEW Database name
CDW_NAMESPACE optional CDW Tool namespace prefix
CDW_SCHEMA optional deid_uf SQL schema name
CDW_LOG_LEVEL optional INFO Logging level

Manual Installation (without BioRouter)

unzip cdwagent.brxt -d cdwagent
cd cdwagent
CLINICAL_RECORDS_USERNAME="CAMPUS\\youruser" CLINICAL_RECORDS_PASSWORD="yourpass" uv run cdwagent