Skip to content
← Back to Work

Pharma Complaint Copilot

An AI-assisted pharmaceutical complaint intake and review system that turns unstructured complaint narratives and PDFs into structured, reviewable drafts while keeping validation, corrections, risk guidance, and final record creation under human control.

LivePython · FastAPI · Pydantic · LangGraph · Groq API · PostgreSQL · SQLAlchemy · Alembic · React · TypeScript · Redux Toolkit · Zod · Vite · pytest · Vitest · Playwright · Ruff

Problem

Pharmaceutical quality complaints often arrive as unstructured narratives that must be converted into complete, consistent records before they can be reviewed or acted on. Manual intake is repetitive, while relying on an LLM alone can introduce missing, malformed, or unsupported information into a sensitive workflow.

Approach

Pharma Complaint Copilot combines LangGraph-orchestrated AI extraction with structured model outputs, deterministic completeness checks, typed API validation, and a human-in-the-loop review flow. Complaints can be submitted as text or text-based PDFs, corrected through controlled conversational patches or direct edits, persisted as review drafts, and committed to the complaint ledger only through an explicit human action.

Outcome / Learning

A live, independently developed AI Product Engineer assignment prototype demonstrating how generative AI can be combined with deterministic rules, persistent application state, and explicit human control in a sensitive business workflow. The build strengthened my work in LangGraph orchestration, structured AI outputs, backend contracts, relational persistence, safe correction flows, idempotency, and end-to-end verification. It remains a decision-support prototype rather than a validated pharmaceutical QMS or regulatory decision system.

Key Features

  • Structured complaint extraction from pasted text and text-based PDFs
  • LangGraph-orchestrated extraction, validation, risk suggestion, and summary workflow
  • Deterministic completeness checks for required complaint information
  • Human-in-the-loop review before final record creation
  • Controlled natural-language corrections with allow-listed field updates
  • Direct form editing with persisted draft state
  • AI risk guidance clearly separated from reviewer responsibility
  • PostgreSQL-backed review drafts and committed complaint records
  • Idempotent final commit to prevent duplicate records on retries
  • Structured API contracts and malformed-output rejection
  • Safe handling of missing information without fabricated fallback data
  • Responsive React and Redux review workspace
  • Backend, frontend, and end-to-end automated testing