-
-
Audit Dashboard
-
Executive Approval Queue
-
Audit Initiating page
-
Guide
-
Pharmaceutical Vendor Directory & 360° Intelligence
-
Regulatory Alerts & Telemetry Center
-
Cockpit for ROI Details
-
Contract Intelligence & Redline Negotiation Pack
-
Forensic Governance & Audit Logs
-
Instant DPCO Price Ceiling Checker
-
Bulk Procurement & RFP Line-Item Auditor
-
Multi-Vendor RFP Comparison & Radar Matrix
AutonoSource: PharmProcure AI
Autonomous Multi-Agent Intelligence for Resilient Pharmaceutical Sourcing, Regulatory Price Ceiling Compliance, and Forensic Supplier Risk Auditing.
Inspiration
Pharmaceutical procurement is not ordinary commercial purchasing—it is a mission-critical operation where supply failures, counterfeit active ingredients, or contractual oversights directly impact human lives. Every year, healthcare networks, hospital groups, and pharmaceutical distributors suffer millions in statutory fines and devastating stockouts due to:
- Predatory & Non-Compliant Drug Pricing: Suppliers quoting above statutory government price ceilings (such as national essential medicine price caps or drug price control orders).
- Unseen Contractual Loopholes: Subtly mismatched cold-chain transit tolerances (e.g., vendor contracts specifying ambient $15^\circ\text{C} - 25^\circ\text{C}$ transit for biological vaccines that legally mandate strict $2^\circ\text{C} - 8^\circ\text{C}$ cold chains).
- Fragmented Due Diligence: Procurement officers having to manually cross-reference audited balance sheets, regulatory blacklists, active import/export licenses, and court filings across disparate databases.
Traditional single-prompt LLMs fail spectacularly here: they hallucinate, cannot execute deterministic price calculations, and lack adversarial self-critique. We set out to build AutonoSource: PharmProcure AI — an autonomous multi-agent platform that treats pharmaceutical procurement not as a simple search problem, but as an adversarial forensic investigation.
What it does
AutonoSource: PharmProcure AI automates the entire pharmaceutical tender and vendor evaluation lifecycle through a coordinated team of autonomous AI agents and deterministic mathematical engines:
- Instant Statutory Price Checker (
/price-check): Instantly validates active pharmaceutical ingredients (APIs) and branded formulations against legal drug price control ceilings, computing exact violation deltas and overcharge penalties. - Bulk RFP Line-Item Auditor (
/batch-audit): Ingests hundreds of line-item procurement schedules, identifies over-ceiling bids, flags unverified manufacturers, and generates clean institutional re-bidding packs. - Contract Clause & Redline Analyzer (
/contract-analyzer): Parses legal agreements for risky indemnification, liability caps, delivery delay penalties, and cold-chain compliance, auto-generating redlined counter-proposals. - 5-Pillar Multi-Vendor Radar Matrix (
/compare): Dynamically benchmarks competing suppliers across Financial, Compliance, Contractual, Pricing, and Operational risk dimensions with real-time weight adjustments. - Verified Vendor 360 & Supply Chain Graph (
/vendors): Uncovers tier-2 supplier dependencies, regulatory citation histories, and credit ratings across a 5,757-node graph. - What-If Deal Term Simulator (
/review/:id): Simulates in real-time how renegotiating warranty terms, payment credit days, or liability caps transforms vendor risk scores. - Regulatory Alerts & Event Simulator (
/alerts): Actively monitors regulatory notices, batch recalls, and geopolitical import bans. - Forensic PDF Audit Dossier (
/procurement/{id}/dossier.pdf): Generates verifiable, board-ready audit reports with cryptographic evidentiary trails for human approval.
How we built it
AutonoSource is built on a high-concurrency, multi-tier architecture combining autonomous agents, vector search, graph theory, and deterministic analytics:
1. Multi-Agent Orchestration (LangGraph StateGraph)
Rather than a sequential chain, we engineered a cyclic state graph coordinating six specialized agent nodes:
- Planner Agent: Analyzes RFP scope and budget to route execution between a streamlined evaluation or a deep multi-source investigation.
- RAG Agent: Queries dense vector embeddings and property graphs simultaneously.
- Scraper & Market Intelligence Agent: Verifies legal entity data, crawls regulatory alert feeds, and pulls audited financial disclosures.
- Risk Scorer Agent: Synthesizes forensic findings across five standardized risk pillars.
- Critic Agent: Performs adversarial self-reflection. If confidence is below threshold, it commands targeted investigative loops back to the RAG and Scraper nodes.
- Report Writer Agent: Generates executive negotiation packs, risk breakdown summaries, and formal approval dossiers.
2. Dual Hybrid Retrieval & The 4-Step Fusion Algorithm
To eliminate hallucinations, the RAG agent retrieves knowledge simultaneously from:
- Qdrant Vector DB: 768-dimensional dense embeddings indexing pharmaceutical statutes, contracts, and regulatory filings.
- NetworkX Property Graph: A 5,757-node graph mapping vendor corporate parents, GMP licenses, manufacturing sites, and legal dependencies.
3. Frontend & User Experience
Built with React 18, TypeScript, Vite, Tailwind CSS, and Framer Motion, featuring full-width responsive grids, role-switcher personas (Procurement Lead, Compliance Auditor, Risk Officer, CFO), interactive radar charts, and real-time parameter sliders.
Mathematical Formulations (LaTeX)
1. The 4-Step Hybrid Fusion & Contradiction Resolution
Let $S_{\text{vector}}(d)$ and $S_{\text{graph}}(d)$ be the normalized similarity scores from the vector store and property graph respectively. The weighted evidence score $S_{\text{weighted}}(d)$ for each candidate fact is computed as:
$$S_{\text{weighted}}(d) = w_{\text{source}} \cdot S_{\text{norm}}(d)$$
Where $w_{\text{source}} \in {w_{\text{statutory}}, w_{\text{contract}}, w_{\text{filing}}}$ denotes the evidentiary priority. If two facts $c_i$ and $c_j$ within the same query slot present conflicting values (e.g., conflicting temperature bounds $T_{\text{contract}} \neq T_{\text{statute}}$), a contradiction indicator $\delta(c_i, c_j) = 1$ is assigned, penalizing overall confidence:
$$C_{\text{final}} = C_{\text{base}} \times \left(1 - \lambda \sum_{k=1}^{M} \delta(c_k)\right)$$
where $\lambda \in (0, 1)$ is the strict contradiction penalty factor.
2. Composite 5-Pillar Vendor Risk Scoring Model
Every vendor proposal is quantitatively scored along five orthogonal dimensions: Financial ($R_{\text{fin}}$), Compliance ($R_{\text{comp}}$), Contractual ($R_{\text{cont}}$), Pricing ($R_{\text{price}}$), and Operational ($R_{\text{ops}}$):
$$R_{\text{composite}} = \sum_{p \in \mathcal{P}} \omega_p \cdot R_p \quad \text{subject to} \quad \sum_{p \in \mathcal{P}} \omega_p = 1, \quad R_p \in [0, 100]$$
$$\mathcal{P} = {\text{fin}, \text{comp}, \text{cont}, \text{price}, \text{ops}}$$
The Risk Tier $\mathcal{T}$ is assigned based on calibrated thresholds: $$\mathcal{T}(R_{\text{composite}}) = \begin{cases} \text{LOW}, & \text{if } R_{\text{composite}} < 30 \ \text{MEDIUM}, & \text{if } 30 \le R_{\text{composite}} < 65 \ \text{HIGH}, & \text{if } R_{\text{composite}} \ge 65 \end{cases}$$
3. Statutory Drug Price Ceiling Violation & Loss Exposure
For any pharmaceutical formulation $i$ quoted with unit price $P_{\text{quoted}, i}$ against the statutory government ceiling $P_{\text{ceiling}, i}$ with tender quantity $Q_i$:
$$\Delta_{\text{violation}, i} = \max\left(0, P_{\text{quoted}, i} - P_{\text{ceiling}, i}\right) \times Q_i$$
The institution's total avoidable financial risk exposure across an entire batch RFP schedule $\mathcal{B}$ is:
$$\text{Total Avoidable Overcharge} = \sum_{i \in \mathcal{B}} \Delta_{\text{violation}, i}$$
$$\text{Projected Total ROI Savings} = \sum_{i \in \mathcal{B}} \left( \Delta_{\text{violation}, i} + \alpha_{\text{negotiated}} \cdot P_{\text{quoted}, i} \cdot Q_i \right) + \mathbb{E}[\text{Penalty}_{\text{avoided}}]$$
where $\alpha_{\text{negotiated}}$ is the simulated deal-term discount and $\mathbb{E}[\text{Penalty}_{\text{avoided}}]$ is the expected statutory penalty for non-compliant procurement.
4. Critic Agent Convergence & Loop Termination
The LangGraph evaluation loop iterates until the state satisfies the termination criterion:
$$\text{Next State} = \begin{cases} \text{Writer Node}, & \text{if } C_{\text{final}} \ge \tau \ (0.80) \ \lor \ N_{\text{revisions}} \ge N_{\max} \ (3) \ \text{Revise}(\text{RAG}, \text{Scraper}), & \text{if } C_{\text{final}} < \tau \ \land \ N_{\text{revisions}} < N_{\max} \end{cases}$$
This guarantees mathematical convergence and bounds latency while preventing infinite reflection loops.
Challenges we ran into
- Subtle Contractual Contradictions: Legal language often obscures critical conflicts—such as burying an exemption to cold-chain liabilities in an annexure while asserting compliance in the main agreement. Solving this required engineering custom semantic slot-clustering in the RAG agent to align terms across clauses before calculating confidence penalties.
- Deterministic Ceiling Price Matching: Pharmaceutical drugs use varying salt formulations, dosage strengths (e.g., 500mg vs 250mg), and packaging units (blister packs vs hospital bulk bottles). Generic regex or LLM lookups led to miscalculations. We resolved this by building a dedicated, deterministic matching algorithm that normalizes dosage units and pack sizes against statutory schedules.
- Preventing Multi-Agent Cyclic Deadlocks: When the Critic agent demands additional data, poorly constrained loops can oscillate indefinitely. We introduced strict state tracking with bounded iteration thresholds and decaying revision tolerance.
- Generating Pixel-Perfect Audit Dossiers in Headless Environments: Generating verifiable PDF reports containing vector charts, tables, and signature blocks without heavy browser rendering dependencies was accomplished using a pure-Python
ReportLabengine with structured layout canvases.
Accomplishments that we're proud of
- 100% Grounded, Zero-Hallucination Architecture: Every risk score, clause critique, and pricing verdict includes direct citations with document IDs, clause numbers, and statutory paragraph references.
- Enterprise Test Coverage: Built and passed 62 Vitest unit and integration tests covering the entire frontend interface and 21 Pytest test suites verifying agent flows, price ceiling calculations, and PDF generation.
- Sub-Second DPCO & Bulk Tender Processing: The batch auditor parses hundreds of procurement line items, cross-checks ceilings, and flags violations in under a second.
- Real-Time What-If Negotiation Simulation: Interactive deal-term recalculation lets procurement officers dynamically model trade-offs during live negotiations.
What we learned
- Multi-Agent Systems Beat Monolithic Prompts: Splitting procurement into adversarial roles (Planner $\rightarrow$ Scorer $\rightarrow$ Critic $\rightarrow$ Writer) surfaces edge-case contradictions that a single prompt invariably overlooks.
- Hybrid RAG is Essential for Enterprise Knowledge: Dense vector embeddings alone miss explicit statutory relationships. Combining Qdrant with a NetworkX property graph gave our agents both semantic search and structural reasoning.
- Deterministic Guardrails Protect GenAI: LLMs are superb at summarizing and negotiating, but should never perform mathematical pricing calculations. Coupling generative LLMs with deterministic pricing rules produced an audit-proof system.
What's next for AutonoSource: PharmProcure AI
- Global Regulatory Expansion: Expanding beyond current national price orders to ingest FDA, EMA (European Medicines Agency), and WHO essential medicine pricing schedules.
- Direct ERP & E-Procurement Connectors: Native bi-directional integrations for SAP Ariba, Oracle SCM, and Coupa to automatically intercept purchase orders before sign-off.
- On-Chain Cryptographic Audit Hashes: Anchoring final dossier approval signatures to an enterprise blockchain for immutable evidentiary trails during government audits.
- Predictive Shortage Forecasting: Integrating real-time port logistics and Active Pharmaceutical Ingredient (API) customs data to predict supply shocks 90 days in advance.
Log in or sign up for Devpost to join the conversation.