Medical AI content integrity monitor for the Google Cloud Rapid Agent Hackathon - Arize track.
Paste AI-generated health content and get a PASS / FAIL verdict with full evidence. MedCred combines OpenFDA checks, external API verification, Phoenix trace-informed judging, and calibration-gated self-improvement.
Calibration: 99% label agreement on a 100-case held-out set (40 PASS / 40 FAIL / 20 edge). Reproduce with POST /calibration/run?mode=fast.
OpenFDA extraction feeds the Gemini judge; a deterministic safety gate enforces FAIL after the verdict for invented drugs, deprecated treatments, and high-risk patterns. Phoenix handles subtler fraud the gate cannot catch (fake PMIDs, inflated efficacy claims).
Grounding → External APIs → OpenFDA → Phoenix MCP → phoenix_context → Judge → Gate → Annotate → Correction
Every 5 evaluations: read FAIL spans → propose prompt update → A/B test on held-out calibration set → promote only if agreement meets or exceeds baseline.
- Python 3.13+, uv
- Node.js 18+ (frontend)
- GCP project with Vertex AI + Agent Builder (optional grounding)
- Arize Phoenix API key
git clone https://github.com/shaileshdev4/medcred
cd medcred/backend
cp .env.example .env
# Set: PHOENIX_API_KEY, PHOENIX_SPACE, GOOGLE_CLOUD_PROJECT, GOOGLE_GENAI_USE_VERTEXAI=1
uv pip install -r requirements.txt
uv run python main.pyHealth check: curl http://localhost:8000/health
cd medcred/frontend
cp .env.example .env.local
# Set NEXT_PUBLIC_API_URL=http://localhost:8000
npm install && npm run dev| Preset | What it proves |
|---|---|
| Fake drug (synaptol) | OpenFDA + gate → FAIL |
| Citation fraud (lisinopril + fake PMID) | Phoenix trace + judge → FAIL (gate does not trigger) |
| Dangerous dosing | Deterministic gate → FAIL |
cd medcred/backend
uv pip install -r requirements-dev.txt
uv run pytest tests/ -qPreflight (DNS + Phoenix + Vertex):
uv run python agent.py --preflight-onlyADK batch smoke (1 article):
uv run python agent.py healthgpt --smokePhoenix OTLP smoke:
uv run python scripts/verify_phoenix_trace.pyCalibration (100 cases, ~25 min; batch if you hit Vertex 429):
uv run python scripts/run_calibration_report.py
# or: curl -X POST "http://localhost:8000/calibration/run?mode=fast"Pre-seed Phoenix traces before demo (25 evals):
uv run python scripts/preseed_phoenix_traces.py| Endpoint | Description |
|---|---|
POST /analyze/stream |
SSE paste-audit pipeline |
POST /evaluate/{publisher_id} |
ADK batch evaluation |
GET /evaluate/{publisher_id}/live |
Theater SSE stream |
POST /calibration/run?mode=fast |
Label agreement on calibration set |
POST /improvements/run?force=true |
Trigger self-improve cycle |
GET /health |
Service + Phoenix/Postgres status |
medcred/
├── backend/
│ ├── agent.py # ADK SequentialAgent + CLI
│ ├── main.py # FastAPI API
│ ├── core/ # Phoenix tracing, evaluator base, self-improve
│ ├── single_eval.py # Analyze pipeline
│ ├── sse_handler.py # Theater SSE
│ ├── phoenix_mcp.py # ADK McpToolset → @arizeai/phoenix-mcp
│ ├── phoenix_context.py # Drug-aware trace injection
│ ├── calibration_runner.py # Label agreement + promotion gate
│ ├── evaluators/ # Gemini medical judge
│ ├── calibration_dataset.json
│ ├── scripts/ # Smoke, calibration, preseed
│ └── tests/ # 53 tests
├── frontend/ # Next.js 14 dashboard
├── images/ # Architecture diagrams
├── docs/
│ ├── SUBMISSION.md # Deploy + Devpost checklist
│ └── AGENT_BUILDER_MEDCRED.md
├── medcred_devpost.md # Devpost write-up
└── LICENSE
See docs/SUBMISSION.md for Railway (backend), Vercel (frontend), and Neon (Postgres).
Docker:
docker build -t medcred-backend ./backend
docker build -t medcred-frontend ./frontendPython, FastAPI, Next.js, Google ADK, Gemini 2.5 Flash, Vertex AI, Arize Phoenix, phoenix-mcp, OpenFDA, DailyMed, PubMed, ClinicalTrials.gov, MedlinePlus, PostgreSQL, Neon.
Full Devpost narrative: medcred_devpost.md
MIT - see LICENSE.



