Inspiration

Startups rarely lose customers without warning. The signals already exist across usage, billing, support, onboarding, and outcome data, but customer-success teams often discover them too late. ChurnControl turns those fragmented signals into coordinated, timely retention work.

What it does

ChurnControl continuously evaluates customer accounts through specialized agents for usage, attainment, cause classification, prevention, retention, win-back, learning, and orchestration. The command center displays calibrated churn risk, forecast uncertainty, economic priority, alerts, diagnosis evidence, agent status, and intervention history.

The Predictability component converts 17 behavioral signals into calibrated churn probabilities, an eight-week forecast with a 95% confidence interval, and a value-prioritized intervention queue. It combines risk with MRR and expected retention impact so teams know which account to investigate next—not only who is risky.

When the Prevention agent runs, it uses OpenAI to produce a structured diagnosis, evidence, confidence score, recommended action, and customer message. Consequential actions are never executed blindly: the recommendation is persisted in InsForge and a human must approve or reject it.

How we built it

The frontend uses SvelteKit 2, Svelte 5, TypeScript, and is deployed on Vercel. InsForge provides authentication, PostgreSQL, row-level security, multi-tenant workspaces, alerts, agent runs, diagnoses, and interventions. OpenAI's Responses API with Structured Outputs produces predictable recommendations.

The Predictability integration uses a SvelteKit server adapter and a FastAPI churn decision engine built with LightGBM, isotonic probability calibration, behavioral feature engineering, SHAP explanations, and economic prioritization. The UI consumes one typed PortfolioSummary contract and has a calibrated embedded fallback for resilient demonstrations.

Every verified user receives an isolated eight-account sample workspace. ChurnControl records each agent run, calls OpenAI, validates the schema-constrained response, saves the diagnosis and proposed intervention, and presents approval controls.

How Codex and GPT-5.6 were used

ChurnControl was designed and implemented with Codex using GPT-5.6. Codex accelerated the complete workflow: translating functional notes and a visual handoff into Svelte components, designing the multi-tenant PostgreSQL schema, reviewing RLS and identity-column safety, integrating InsForge, implementing the OpenAI agent endpoint, integrating the churn decision engine, and validating the product through browser automation.

Key decisions made during the Codex session included separating diagnosis from execution, requiring human approval, storing evidence and confidence as auditable records, using Structured Outputs for predictable persistence, and maintaining one typed prediction contract across the live engine and demo fallback.

Challenges

The hardest part was balancing useful agent autonomy with operational safety. ChurnControl separates diagnosis from execution and stores interventions as proposals requiring explicit approval. Multi-tenant RLS ensures authenticated users only access their own workspace.

Accomplishments

  • Built a working agentic retention workflow instead of a static dashboard.
  • Integrated calibrated churn prediction and value-based prioritization.
  • Implemented tenant isolation with PostgreSQL RLS.
  • Used Structured Outputs for persistable AI recommendations.
  • Added human approval and rejection for consequential actions.
  • Created an idempotent demo-workspace bootstrap.
  • Verified the app with type checking, linting, production builds, browser automation, and backend diagnostics.

What we learned

Agentic systems become more trustworthy when their reasoning artifacts are visible. Showing probability calibration, forecast uncertainty, evidence, confidence, proposed action, and approval state makes an AI recommendation easier to evaluate than an opaque churn score.

What's next

Connect product analytics, CRM, billing, and support sources; track intervention outcomes; calibrate treatment-versus-control models; and expand channel-specific execution.

Built With

  • codex
  • fastapi
  • gpt-5.6
  • insforge
  • lightgbm
  • openai-responses-api
  • postgresql
  • svelte-5
  • sveltekit-2
  • typescript
  • vercel
Share this project:

Updates

Submission history