Elastic Track ยท Hackathon Prototype โ€” Research Use Only

The Digital Pharmacist.
Evidence-Backed.

Submit a patient's medical history and proposed medications. Four Gemini-powered agents query the FDA drug label database live via Elasticsearch, evaluate every drug against that patient's specific conditions, and return a full safety report โ€” with verbatim FDA citations โ€” in under 1 minute.

View on GitHub
The Pipeline

How it works

1

Submit the Case

A clinician uploads a patient's medical history and proposed medications. No rigid format required โ€” the system handles free-form clinical notes, uploaded PDFs, and CSV lab data.

2

Query the FDA

The ClinicalPharmacistAgent writes and executes ES|QL queries against the fda_drug_labels Elasticsearch index for each drug โ€” retrieving live contraindication and warning text via Elastic's MCP Toolbox.

3

Receive the Report

Every drug is classified as Approved, Caution, or Contraindicated โ€” each verdict citing the verbatim FDA label text that applies to that patient's specific conditions.

hub
GOOGLE_ADK ยท SEQUENTIAL

4-Agent Sequential Pipeline

Each agent has a specific task, uses the output of the previous one, and produces a concrete artifact. The pipeline goes beyond answering a question โ€” it reads a database, reasons over patient data, and writes a clinical document.

medication
ProposePrescriptionAgent
Generates a medication list from clinical history alone, when none is provided
optional
science
ClinicalPharmacistAgent
Writes ES|QL queries ยท retrieves FDA label text ยท produces Markdown evaluation
ES|QL
data_object
ParseEvaluationToJson
Converts Markdown evaluation โ†’ structured JSON with per-drug status fields
description
JsonToHTML
Renders JSON โ†’ print-ready clinical HTML report using Tailwind CSS
search

Live ES|QL Queries

Elasticsearch is not a supporting tool โ€” it's the intelligence layer. The agent has no hardcoded drug knowledge. Every clinical determination comes from a live ES|QL query against the fda_drug_labels index via Elastic's MCP Toolbox.

FROM fda_drug_labels
| WHERE generic_name
    LIKE "*ibuprofen*"
| KEEP generic_name,
    contraindications,
    warnings_and_cautions
| LIMIT 1
format_quote

Verbatim FDA Evidence

Not a generic alert. Not a chatbot answer. The actual warning text from the FDA label, matched to that specific patient's conditions โ€” surfaced automatically by the agent.

format_quote

"Treatment with Ibuprofen tablets is not recommended in patients with advanced renal disease. NSAIDs can lead to onset of new hypertension or worsening of preexisting hypertension."

FDA Drug Label ยท Ibuprofen ยท Patient: CKD Stage 4, BP 165/92 CONTRAINDICATED
warning

Why Existing Systems Fail

EHR alert systems are rule-based and fire so many warnings that clinicians click through over 90% of them without reading. The alerts are untrusted because they don't explain their reasoning with patient-specific context.

The gap is not a knowledge problem. It's an information retrieval problem: the right evidence, for the right patient, at the right moment.