-
-
ClearPrice AI Landing Page – An elegant, premium user interface
-
System Architecture – 5 specialized Gemini 2.5 Pro agents orchestrated via the Google ADK and hosted on Vertex AI Agent Runtime
-
Conversational Patient Interface – A sleek, glassmorphic chat design featuring native Event-Stream token streaming
-
Patient Inquiry – Users can enter complex, natural-language pricing questions like 'What does a knee replacement cost near zip 94102?'
-
AI-Generated Ranked Results – The orchestrator aggregates data from multiple background tools
-
Context-Aware Follow-up – Dynamic suggestion chips adapt to the user's conversation
-
Market Insights & Price Distribution – Live, secure MongoDB Atlas Charts embedded directly in the frontend
-
Ranked Hospital Pricing Table – A comprehensive comparison grid showing exact hospital names
-
Interactive Proximity Map – Quality-color-coded geospatial hospital markers within a 25-mile radius,
## Inspiration
In 2021, the US government passed a law requiring every hospital to publish their prices as machine-readable files. It sounded like a breakthrough for patients. Then the files came out.
UCSF published a 500,000-row CSV with column names like rev_cd and drg_cd. Prices were buried under payer aliases like "BCBS CA", "Blue Cross of California", and "Anthem Blue Cross" — all the same insurer. No human could compare prices across hospitals. No patient could use this data to make an informed decision before their procedure.
That law has been on the books for four years. The data is public, but nobody made it usable.
ClearPrice is our attempt to fix that.
## What it does
ClearPrice is a multi-agent AI system that answers patient questions about hospital costs in plain English.
You type: "What will a knee replacement cost near zip 94102?"
Within 8 seconds:
- A Procedure Agent maps "knee replacement" → DRG 470/469 using semantic vector search.
- A Hospital Discovery Agent finds 20+ hospitals within 25 miles using geospatial queries.
- A Price Intelligence Agent retrieves real Medicare payment data for each hospital.
- A Quality & Financial Agent pulls CMS star ratings, Leapfrog safety grades, and charity care ratios.
- The Orchestrator ranks all hospitals by a composite score: price (35%) + quality (30%) + distance (15%) + ratings (20%).
Results appear dynamically as:
- Interactive Map: Quality-color-coded hospital pins (green = 4-5★, amber = 3★, red ≤ 2★).
- Price Comparison Table: Ranked comparison with Medicare payment, % vs national median, CMS stars, and Google rating.
- Market Insights: Live MongoDB Atlas Charts showing national price distribution and trends.
The system also displays:
- Ambulatory Surgery Center (ASC) alternatives — often 60-70% cheaper for the same outpatient procedure.
- Charity care ratios for uninsured patients.
- Data freshness indicators via live Change Streams: "Price data updated 3 days ago".
## How we built it
Multi-Agent Architecture
We built 5 specialized AI agents orchestrated by the Google ADK (@google/adk), powered by Gemini 2.5 Pro, and deployed to Vertex AI Agent Runtime (Google Cloud Agent Builder):
orchestrator: Receives the user query, decomposes it into parallel workstreams, and synthesizes the ranked response.procedure_agent: Maps NL → DRG/APC medical codes via Atlas Vector Search.hospital_discovery_agent: Executes geospatial hospital searches with filters.price_intel_agent: Aggregates pricing data against national benchmarks.quality_financial_agent: Inspects CMS quality ratings, Leapfrog grades, and charity care.
Custom MCP Server (The MongoDB Bridge)
Our Model Context Protocol (MCP) server acts as the domain layer between the agents and MongoDB Atlas. It exposes 10 semantic tools:
search_procedures, find_hospitals_near, get_price_data, get_asc_prices, get_quality_scores, get_financial_assistance, get_providers, get_provider_ratings, rank_hospitals, session
Every agent connects to this MCP server via MCPToolset with specific toolFilters, ensuring each agent only accesses the tools it needs.
MongoDB Atlas Features Used
- Atlas Vector Search: Semantic medical code matching on 768-dim embeddings (
textembedding-gecko@003). $medianAggregation Operator: Real-time national price benchmark calculations on-the-fly.$nearGeospatial Operator: Efficient radial location queries.$geoNearPipeline: Nearby ambulatory surgery center (ASC) alternative matching.- Atlas Full-Text Search: Fuzzy lookup across hospitals, procedures, and providers.
- TTL Index: Handles automatic 30-day session expiration.
- Change Streams: Powering live data freshness badges in the UI.
- Atlas Charts: Interactive dashboard widgets displaying live market insights.
External Integrations & Cloud Tech
- Deployed on Google Cloud Run using Hono.js.
- Frontend built on Next.js 14 App Router with Tailwind CSS.
- Cloud services managed via Terraform, Cloud Run, Artifact Registry, and Secret Manager.
## Challenges we ran into
CMS data is enormous and inconsistent. The Medicare Inpatient CSV alone is 500MB+ with ~2M rows. We built streaming ingestion pipelines with batch upserts to parse, geocode, and load it into Atlas. Column names vary between dataset years, which we normalized during ingestion.
DRG vs APC disambiguation. "Knee replacement" is inpatient (DRG 470), while "Knee scope" is outpatient (APC). Patients don't know the difference. The Procedure Agent is designed to clarify the setting, return both DRG variants, and suggest outpatient alternatives when relevant.
TypeScript ADK SDK is newer than Python. The @google/adk TypeScript package has fewer community examples than its Python counterpart. We read the underlying SDK source code to understand advanced multi-agent and tool-filtering features.
## Accomplishments that we're proud of
- End-to-End Under 10 Seconds: Built a 5-agent multi-agent system executing parallel workstreams (Procedure + Hospital) in record time.
- Robust Real-World Data: Ingested and enriched 3,000+ hospitals with DRG + APC + quality + charity care data.
- MongoDB Atlas Deep-Integration: Every advanced Atlas feature is actively working and visible to judges in the web UI.
- Clean Interface Design: Built a professional, responsive consumer interface that turns complex healthcare datasets into digestible patient insights.
## What we learned
Medicare payment data is a surprisingly clean national benchmark. While hospitals bill wildly different amounts, what Medicare actually pays converges much more — which makes it a useful anchor for patients trying to understand if a hospital is overcharging them.
The Google ADK subAgents pattern is incredibly elegant. Parallel execution of Procedure + Hospital agents cuts overall latency in half compared to sequential agent chains.
MongoDB's $median aggregation operator (added in v7.0) is extremely powerful for on-the-fly statistics, computing national medians at query time over 260K+ price points with minimal CPU footprint.
## What's next for ClearPrice
- Commercial Payer Data: Ingesting the massive commercial payer files (1-10GB per hospital) now that our schema supports multiple payers.
- "I'm Uninsured" Mode: Re-ranking hospitals primarily by charity care ratios and sliding-scale eligibility.
- Physician-Level Comparison: Side-by-side surgeon ratings and quality scores for the same procedure at the same hospital.
- Mobile Native App: Adding camera-scanning support for insurance cards to pre-fill specific commercial-payer coverage on-the-fly map coverage networks.
Built With
- artifact-registry
- atlas-charts
- atlas-vector-search
- change-streams
- cloud-run
- gemini-2.5-pro
- google-adk
- google-maps
- hono
- mcp
- mongodb-atlas
- next.js
- node.js
- secret-manager
- tailwindcss
- terraform
- typescript
- vertex-ai
Log in or sign up for Devpost to join the conversation.