🌐 Live Website: Try KeepAlive

Inspiration

A cancellation can mean many things. A customer might be traveling, cutting expenses, or receiving more than they need. We wanted to help subscription businesses respond to those reasons with useful options while keeping cancellation straightforward.

We also wanted to explore the next step in agentic commerce: customers sending their own AI agents to manage subscriptions. If an agent arrives asking to cancel, a merchant should be able to offer an alternative, explain its terms, and carry out the customer’s decision.

That became KeepAlive, an AI retention desk for merchants using PayPal Subscriptions.

What it does

KeepAlive starts a conversation when a subscriber asks to cancel. Claude interprets their reason and proposes a relevant alternative:

  • Pause billing when the customer needs a break.
  • Downgrade to a cheaper plan when their needs have changed.
  • Apply a temporary discount when price is the concern.

The merchant controls the limits, including discount size, offer duration, subscriber eligibility, offer count, and budget. Every AI proposal passes through deterministic checks that approve, adjust, or reject it.

Accepted offers trigger the corresponding PayPal subscription action. Plan changes that require buyer approval send the customer through PayPal’s consent flow. Customers can still choose to cancel throughout the conversation.

KeepAlive also exposes a Model Context Protocol (MCP) endpoint so a subscriber’s AI agent can use the same retention engine. Our agent demo asks the human to approve an offer before accepting it.

The merchant dashboard brings together conversations, subscription states, cancellation reasons, retention metrics, and PayPal activity.

How we built it

We built the application with Next.js, React, TypeScript, and Tailwind CSS. Claude generates structured responses containing the cancellation reason, proposed offer, and customer-facing reply. A shared session engine handles both website conversations and agent requests.

Our architecture separates three responsibilities: the AI proposes an offer, application code checks the merchant’s rules, and the executor applies accepted changes through PayPal.

The PayPal integration covers subscription creation, suspension, reactivation, plan revision, temporary price changes, cancellation, and webhook verification. After a billing action, the executor reads the subscription back from PayPal to confirm its state.

We deployed on Vercel, with private Vercel Blob storage for persistent state and a scheduled job for resuming pauses and restoring expired discounts. AG Grid Community powers the merchant’s subscriber table.

The demo uses Brewbox, a fictional coffee subscription business, and runs against the PayPal sandbox.

Challenges we ran into

Keeping AI offers within merchant limits. A conversational model can suggest something reasonable that still exceeds a merchant’s budget or policy. We built a separate policy engine so model output alone cannot authorize a billing change.

Handling consent across multiple steps. A proposed downgrade, a customer’s acceptance, and PayPal’s approval are separate events. We had to represent those states clearly and avoid reporting a plan change as complete before approval.

Confirming what PayPal actually changed. During sandbox testing, a discount appeared to be missing because the subscription response omitted plan pricing by default. Requesting fields=plan gave us the information needed to verify the change. That experience reinforced our decision to confirm actions against PayPal’s recorded state.

Following through after the conversation ends. Temporary offers create future obligations. Pauses need to end, discounts need to expire, and those actions must survive application restarts. Persistent storage and scheduled follow-up became essential parts of the implementation.

Accomplishments that we’re proud of

We brought the customer conversation, merchant controls, agent interface, and PayPal execution together in one hosted application.

We’re particularly proud that both human subscribers and AI agents use the same policy checks and execution path. The agent interface extends the product without creating a separate set of billing rules.

We also kept direct cancellation available, including for paused subscriptions.

What we learned

Building agentic commerce means connecting conversation to explicit permissions, validated actions, and observable results. A convincing response is only one part of that process.

We learned how PayPal handles subscription revisions, buyer consent, price overrides, and subscription-state confirmation. We also learned that agent-facing offers need clear, machine-readable terms and human approval checkpoints.

The project sharpened our product goal: help customers find an arrangement that fits their needs, while respecting their decision to leave.

What’s next for KeepAlive

We want to add stronger subscriber authentication for external agents, onboarding for multiple merchants, failed-payment recovery, and controlled experiments to measure which offers help customers stay.

Try KeepAlive

Built With

  • ag-grid
  • anthropic-api
  • claude
  • model-context-protocol
  • next.js
  • node.js
  • paypal-catalog-products-api
  • paypal-subscriptions-api
  • paypal-webhooks
  • react
  • tailwind-css
  • typescript
  • vercel
  • vercel-blob
  • vercel-cron
  • zod
Share this project:

Updates

Submission history