Inspiration

Pharmacy benefit managers and prior authorization teams spend hours every week manually cross-referencing PDF policy documents from UnitedHealthcare, Cigna, Blue Cross, and dozens of other payers just to answer a single question: "Does this plan cover this drug, and what does it take to get approved?" The information exists — it's just buried in dense, inconsistently formatted policy PDFs. We built Anton-RX to eliminate that friction.

What it does

Anton-RX is an AI-powered chat assistant that lets clinicians, pharmacists, and benefits analysts ask natural language questions about medical benefit drug policies across multiple payers — and get structured, accurate answers in seconds.

How we built it

Ingestion pipeline (Python): pdfplumber extracts raw text from payer policy PDFs. Google Gemini structured the extracted text into a normalized schema — brand name, generic name, coverage status, prior auth criteria, step therapy requirements, HCPCS codes, and more — and inserted it into a SQLite database. Chat interface (Next.js + AI SDK): Built with Next.js 16 and the Vercel AI SDK. The API route uses streamText with tool calling so the model can invoke SQL queries live during the conversation. @assistant-ui/react provides the chat UI primitives. Zustand + IndexedDB persist multiple named chat threads in the browser. Admin dashboard: A Streamlit app for uploading new PDFs, triggering the ingestion pipeline, viewing raw extracted data, and managing the database.

Challenges we ran into

PDF variability: Every payer formats their policy documents differently. Getting Gemini to reliably extract structured fields from wildly inconsistent layouts required careful prompt engineering and schema enforcement.

Accomplishments that we're proud of

End-to-end pipeline from raw PDF to queryable, AI-answerable database Live tool calling during chat — the model decides which SQL query to run based on the question, not hardcoded logic Interactive comparison table with one-click CSV export, directly addressing the analyst workflow

What we learned

Structured extraction with LLMs is powerful but requires strict output schemas and validation — the model needs explicit instructions to not hallucinate fields it couldn't find in the PDF.

Tool calling works best when the system prompt is explicit about what goes in each parameter — a single clarifying rule ("query = drug name only, never include payer name") eliminated an entire class of lookup failures.

What's next for Anton-RX AI Chat bot

Broader payer coverage: Ingest policies from 50+ payers to make the comparison tool genuinely comprehensive

Real-time policy sync: Automatically detect and re-ingest updated PDFs when payers publish new policy versions, flagging what changed

Built With

Share this project:

Updates

Submission history