Downloads · 30 days
0
vvvinay5630/customeragent
customeragent is a machine learning model from vvvinay5630. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
An end-to-end MVP for a Pharmaceutical Manufacturing Quality Management System (QMS). This tool automates customer complaint intake by extracting 11 structured fields from unstructured complaint text or uploaded docum…
Downloads · 30 days
0
Access
Public
Updated Aug 7, 2026
Repo size
14.6 MB
Likes
0
Public
Click a slice to open those files.
.json64.1 KB · 43%
From the Hugging Face model README
An end-to-end MVP for a Pharmaceutical Manufacturing Quality Management System (QMS). This tool automates customer complaint intake by extracting 11 structured fields from unstructured complaint text or uploaded documents (PDF, DOCX, TXT, EML) using a LangGraph state graph powered by Groq API, and assigns an initial GMP risk severity & priority rating.
┌─────────────────────────────────────────┐
│ React + Redux Store │
│ (Vite + Inter Font) │
└────────────────────┬────────────────────┘
│
POST /api/extract
POST /api/parse-and-extract
│
▼
┌─────────────────────────────────────────┐
│ FastAPI Backend │
└────────────────────┬────────────────────┘
│
▼
┌─────────────────────────────────────────┐
│ LangGraph State Pipeline │
└────────────────────┬────────────────────┘
│
┌────────────────────────────────────────┼────────────────────────────────────────┐
│ │ │
▼ ▼ ▼
┌──────────────────────┐ ┌──────────────────────┐ ┌──────────────────────┐
│ 1. extract_fields │ │ 2. assess_severity │ │ 3. generate_summary │
│ ├───────────────►│ _priority ├───────────────►│ (Bonus) │
│ Model: llama-3.1-8b-instant │ │ Model: llama-3.3-70b │ │ Model: llama-3.1-8b-instant │
└──────────────────────┘ └──────────────────────┘ └──────────────────────┘
extract_fields (llama-3.1-8b-instant):
Extracts 11 key QMS metadata fields: complaint_source, customer_name, product_name, product_strength_grade, batch_lot_number, manufacturing_date, expiry_date, quantity_affected, complaint_type, complaint_date, detailed_description.assess_severity_priority (llama-3.3-70b-versatile):
Evaluates initial severity (Critical, Major, Minor) and priority (High, Medium, Low) based on GMP risk, patient health impact, and sterility/potency risks. Includes detailed technical rationale.generate_exec_summary [Bonus Node] (llama-3.1-8b-instant):
Produces a 2-3 line executive summary and immediate QA action items (e.g. batch quarantine, sample returns)..
├── backend/
│ ├── app/
│ │ ├── api/
│ │ ├── core/
│ │ │ └── config.py # Environment & Groq configuration
│ │ ├── graph/
│ │ │ ├── nodes.py # LangGraph node definitions
│ │ │ └── workflow.py # LangGraph StateGraph setup
│ │ ├── schemas/
│ │ │ └── complaint.py # Pydantic schemas
│ │ ├── services/
│ │ │ └── groq_client.py # Groq API client with JSON mode
│ │ ├── utils/
│ │ │ └── doc_parser.py # PDF/DOCX/TXT/EML parser
│ │ └── main.py # FastAPI server & routes
│ ├── tests/
│ │ └── sample_fixtures.py # 3 realistic pharma complaint fixtures
│ ├── .env.example
│ └── requirements.txt
├── frontend/
│ ├── src/
│ │ ├── components/
│ │ │ ├── Header.jsx
│ │ │ ├── LeftPanelForm.jsx # Log Customer Complaint Form
│ │ │ ├── RightPanelAssistant.jsx # AI Intake & Chat Assistant
│ │ │ └── ProgressBar.jsx # LangGraph stage indicator
│ │ ├── store/
│ │ │ ├── complaintSlice.js # Redux Toolkit state
│ │ │ └── store.js
│ │ ├── App.jsx
│ │ ├── main.jsx
│ │ └── index.css # Modern dark theme styles
│ ├── index.html
│ ├── package.json
│ └── vite.config.js
└── README.md
Open terminal and navigate to /backend:
cd backend
Create a virtual environment & activate it:
python -m venv venv
# On Windows (PowerShell):
.\venv\Scripts\Activate.ps1
# On Mac/Linux:
source venv/bin/activate
Install dependencies:
pip install -r requirements.txt
Configure your .env file:
cp .env.example .env
Open .env and set your Groq API Key:
GROQ_API_KEY=gsk_your_actual_groq_api_key_here
GROQ_MODEL_FAST=llama-3.1-8b-instant
GROQ_MODEL_REASONING=llama-3.3-70b-versatile
PORT=8000
Launch FastAPI development server:
python -m app.main
The backend runs on http://localhost:8000. You can test API endpoints interactively at http://localhost:8000/docs.
Open a second terminal window and navigate to /frontend:
cd frontend
Install dependencies:
npm install
Start Vite dev server:
npm run dev
Open http://localhost:5173 in your browser.