MedNegotiator is a multi-agent framework designed to automate the negotiation of conflicting requirements in healthcare software projects. By leveraging Large Language Models (LLMs) and Game Theory (Nash Bargaining Solution), it simulates realistic interactions between clinical and technical stakeholders to reach Pareto-optimal agreements.
Note: This repository contains the reference implementation for the paper: "Automating Requirements Negotiation in Healthcare: Simulating Clinical and Technical Perspectives using Generative AI Agents".
The system operates on a three-layered architecture:
- Cognitive Layer: Agents (Clinical & Technical) powered by LLMs with injected personas (Severity Bias vs. Loss Aversion).
-
Axiological Layer: A QFD-based engine that calculates Utility Scores (
$U_{clin}$ ,$U_{tech}$ ) for every proposal. - Communication Layer: Implements an Alternating Offers Protocol with a Mediator for deadlock resolution.
Figure: The Multi-Layered Architecture of MedNegotiator. Layer 1 handles semantic reasoning via LLMs and RAG; Layer 2 quantifies values using QFD principles; Layer 3 manages the stateful negotiation protocol and mediation logic.
- Clone the repository:
git clone [https://github.com/tanhaei/MedNegotiator.git](https://github.com/tanhaei/MedNegotiator.git)
cd MedNegotiator
- Install dependencies:
pip install -r requirements.txt
- Set up your environment:
- Rename .env.example to .env
- Add your OpenAI API Key (or other LLM provider key).
To run the "WSI Storage Conflict" case study (as described in the paper):
python main.py
[Round 1] Clinical Agent (Dr. Onc): I propose storing raw WSI files for AI research...
[System] Technical Utility: 0.12 (REJECTED)
[Round 1] Technical Agent (Arch. Sys): Rejected. Cost exceeds budget by 400%...
...
[Round 3] Mediator: Detecting deadlock... Suggesting Tiered Storage Strategy.
[System] Nash Product Score: 0.63 (CONSENSUS REACHED)
- src/agents.py: Defines the ClinicalAgent and TechnicalAgent classes with specific system prompts and RAG stubs.
- src/engine.py: Implements the mathematical utility functions and Nash Product calculation.
- src/protocol.py: Manages the negotiation rounds, turn-taking, and mediation logic.
Contributions are welcome! Please read the contribution guidelines first.
This project is licensed under the MIT License.