Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI × AI Negotiation

The future of SaaS renewals

A Dynamic Loyalty Engine for rational, autonomous retention

Team Theme Backend AI Service

When machines make purchasing decisions, loyalty must become measurable.


The Loyalty Paradox

In an AI-mediated market, customer-side agents continuously compare SaaS vendors and select the option with the highest measurable utility. Brand attachment and past satisfaction no longer guarantee renewal. Even a small difference in price or features can trigger a switch.

That creates a two-sided problem:

For customers For SaaS startups
Decisions may ignore the value of a proven relationship Revenue depends heavily on predictable renewals
Switching introduces migration, integration, and reliability risk Customers can switch with very little friction
A marginally cheaper offer may not be better overall Traditional loyalty programs do not influence AI agents
Constant comparison creates decision churn Churn becomes frequent and difficult to forecast

AI × AI Negotiation addresses this paradox by replacing emotional loyalty and reactive discounting with structured, real-time negotiation between autonomous agents.

The solution

The Dynamic Loyalty Engine brings two agents together at renewal:

  • Customer AI Agent evaluates every vendor using total utility—not price alone.
  • Business AI Agent detects churn risk early and prepares an optimized counter-offer.
  • Negotiation Engine exchanges structured proposals within business guardrails.
  • Loyalty Engine learns from successful renewals and strengthens rational preference over time.

The result is a renewal process that protects customer value, preserves margins, and makes recurring revenue more stable.

Loyalty is transformed from emotional attachment into a computational preference built through consistent value delivery.

How it works

flowchart LR
    A[Monitor usage and renewal timing] --> B[Predict churn risk]
    B --> C[Customer AI evaluates alternatives]
    C --> D[Business AI generates an optimized offer]
    D --> E[Customer AI recalculates total utility]
    E -->|Renew| F[Update loyalty score]
    E -->|Counter| D
    E -->|Switch| G[Record outcome and learn]
    F --> A
    G --> A
Loading
Phase What happens
1. Monitor Engagement, usage trends, contract context, and renewal timing are tracked.
2. Detect risk The Business AI estimates churn probability before the renewal date.
3. Evaluate The Customer AI ranks vendors using price, features, reliability, switching cost, and risk.
4. Negotiate The Business AI creates a value-optimized counter-offer within margin guardrails.
5. Decide The Customer AI recalculates utility and chooses to renew, counter, or switch.
6. Reinforce A successful renewal updates the loyalty score and informs the next cycle.

Prototype

The prototype demonstrates the complete AI-to-AI retention loop: renewal monitoring, churn-risk analysis, structured negotiation, decision tracking, and analytics.

AI × AI Negotiation prototype overview

AI negotiation workspace

Renewal analytics dashboard

Negotiation renewal outcome

System architecture

flowchart TB
    UI[Web Portal and Analytics Dashboard]
  API[Python FastAPI Backend]
    AI[FastAPI AI Negotiation Service]
    DB[(PostgreSQL)]

    UI -->|REST| API
    API -->|Negotiation request| AI
    AI -->|Offer and decision| API
    API --> DB
Loading

The repository is split into focused services:

ai-negotiation/
├── ai-service/          # FastAPI agents and negotiation engine
├── backend/             # Python API, persistence, and analytics
├── frontend/            # Customer portal and dashboard
├── infra/               # Docker and Kubernetes assets
├── docs/                # Architecture and protocol documentation
└── docker-compose.yml   # Local full-stack orchestration

Technology

Layer Stack
Experience HTML, CSS, JavaScript
Business API Python, FastAPI, SQLAlchemy
AI negotiation Python, FastAPI, Pydantic
Data PostgreSQL
Infrastructure Docker, Docker Compose, Kubernetes

Run locally

Prerequisites

  • Docker with Docker Compose
  • Python 3.11+
  • pip available for Python package installation
  • Ports 8080, 8000, and 5432 available

Option 1: Start the complete stack with Docker Compose

git clone https://github.com/SachinRam18/AIxAI-Negotiation-System.git
cd AIxAI-Negotiation-System
docker compose up --build

Once the services are healthy:

Service Address
Python Backend API http://localhost:8080
AI negotiation service http://localhost:8000
FastAPI health check http://localhost:8000/health
FastAPI interactive docs http://localhost:8000/docs

Option 2: Run services manually

AI service

cd ai-service
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt
uvicorn app.main:app --host 0.0.0.0 --port 8000

Backend API

Open a second terminal:

cd backend
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt
set DATABASE_URL=sqlite:///./aixai.db
set AI_SERVICE_URL=http://localhost:8000
uvicorn app.main:app --host 0.0.0.0 --port 8080

Frontend

Open frontend/index.html directly in your browser, or serve it from a lightweight static server.

Notes

  • The backend expects the AI service on http://localhost:8000 by default.
  • docker compose up --build is the fastest full-stack local setup for development.
  • For a production deployment, update the database and AI service URLs before launch.

Business impact

Outcome How the engine creates it
Revenue stability Detects churn early and negotiates before switching occurs.
Lower churn Improves total utility through targeted counter-offers.
Better acquisition ROI Extends customer lifetime after onboarding.
Margin protection Prefers features, flexibility, and risk reduction before discounts.
Faster decisions Automates the negotiation loop and removes manual back-and-forth.
Better customer experience Delivers relevant, optimized offers at the right moment.
Data-driven retention Uses behavior and renewal history instead of intuition alone.
Competitive resilience Reduces sensitivity to small competitor price changes.
Compounding loyalty Makes each successful renewal inform and strengthen the next.

Why negotiation is rational

Why would a Customer AI accept negotiation?

A Customer AI is designed to optimize value, not finalize its first comparison blindly. If a better outcome is computationally possible, evaluating a counter-offer is part of its objective. Negotiation is therefore an optimization step, not an emotional concession.

Will the Customer AI always switch for a lower price?

No. Total utility also includes switching cost, implementation effort, integration risk, reliability, service quality, and uncertainty. Once those factors are included, remaining with an improved incumbent offer can be the rational choice.

Is this just dynamic discounting?

No. Discounting can erode margins and trigger price wars. The engine prioritizes feature upgrades, contract flexibility, service improvements, and risk reduction. Price is a guarded final lever—not the entire strategy.

Target users

  • SaaS startups operating subscription-based business models
  • B2B software providers facing intense renewal competition
  • Revenue and customer-success teams seeking proactive retention
  • Organizations preparing for autonomous, agent-mediated procurement

Team

Built by Team PentOps for the Loyalty Paradox theme.

Build loyalty that machines can understand.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages