2026-05-29 · DATA ROOM
Convertmind Ai Api
Ship Spring Boot APIs at the speed of thought
ELEVATOR PITCH
AI-powered code generation platform that transforms natural language into production-ready Spring Boot microservices in seconds.
VALUE PROPOSITION
10x faster backend development by eliminating boilerplate and automating architecture decisions.
EXPLAINER.md
ConvertMind AI — EXPLAINER
Concept
ConvertMind AI is a B2B SaaS micro-startup that autonomously optimises website conversion rates using a Multi-Armed Bandit AI engine.
Instead of slow, manual A/B tests, customers paste one <script> tag on their site. The engine continuously experiments with copy variations, learns which one converts best for each visitor segment, and injects the winner — automatically — using Thompson Sampling.
Architecture
Browser (visitor)
│ async GET /api/v1/serve/{apiKey}
▼
ServeController ← Virtual Threads (VT executor)
│ selectAndRecord() – Thompson Sampling picks the best variation
▼
VariationService ──► VariationRepository ──► H2 / PostgreSQL
│
│ fire-and-forget VT
▼
VisitorEventRepository (impression stored asynchronously)
OptimizationAgent (@Scheduled every 5 min)
│ recomputes performanceScore for all variations
│ if CR < 3% AND impressions > 50 → calls LLM
▼
LlmSuggestionService ──► LlmClient (OpenFeign → OpenAI-compatible API)
│ creates new challenger variation automatically
Layers
| Layer | Package | Description |
|---|---|---|
| REST | controller | 7 controllers — auth, websites, elements, variations, serve, analytics, snippet |
| Business | service | Customer/Website/Element/Variation services + OptimizationAgent + AnalyticsService |
| Data | repository | 5 JPA repositories with atomic JPQL update queries |
| Domain | model | 5 JPA entities — Customer, Website, DynamicElement, Variation, VisitorEvent |
| DTOs | dto | Immutable Java Records for all request/response payloads |
| Security | security | JWT filter + UserDetailsService |
| Config | config | SecurityConfig, AppConfig (Feign + Scheduling + VT executor) |
| Client | client | OpenFeign LLM client (OpenAI-compatible) |
Endpoints
Auth (public)
POST /api/v1/auth/register
Body: { "email": "cto@mystore.com", "password": "secret123" }
→ 201 { "token": "eyJ...", "apiKey": "cm_abc123..." }
POST /api/v1/auth/login
Body: { "email": "cto@mystore.com", "password": "secret123" }
→ 200 { "token": "eyJ...", "apiKey": "cm_abc123..." }
Dashboard (JWT Bearer required)
POST /api/v1/websites
Body: { "name": "My Store", "url": "https://mystore.com" }
→ 201 { "id": "...", "snippetHtml": "<script async src=\".../snippet/cm_...\"></script>", ... }
GET /api/v1/websites
→ 200 [ { website list } ]
POST /api/v1/websites/{websiteId}/elements
Body: { "cssSelector": ".hero h1", "description": "Hero headline" }
→ 201 { element details }
GET /api/v1/websites/{websiteId}/elements
→ 200 [ { element list } ]
POST /api/v1/elements/{elementId}/variations
Body: { "content": "Summer Sale — 50% Off Everything" }
→ 201 { variation with counters }
GET /api/v1/elements/{elementId}/variations
→ 200 [ { variations with live impressions/conversions/score } ]
POST /api/v1/elements/{elementId}/variations/generate
(no body — triggers LLM to write a challenger variant)
→ 201 { AI-generated variation }
GET /api/v1/analytics/websites/{websiteId}
→ 200 { totalImpressions, totalConversions, upliftPercentage, elementStats: [...] }
Snippet Endpoints (public — called by JS)
GET /api/v1/snippet/{apiKey}
→ 200 application/javascript (the async snippet — paste in <head>)
GET /api/v1/serve/{apiKey}?sessionId=&pageUrl=&referrer=
→ 200 { "variations": [ { "elementId","variationId","selector","content" } ] }
POST /api/v1/events/{apiKey}?type=conversion&variationId=&elementId=&sessionId=
→ 204 No Content (conversion pixel)
Multi-Armed Bandit — Thompson Sampling
Each variation is an arm with a Beta(α, β) posterior:
- α = conversions + 1
- β = (impressions − conversions) + 1
VariationService). The arm with the highest sample is served and its impression counter is atomically incremented via a JPQL UPDATE query.
Every 5 minutes the %%INLINE11%% refreshes %%INLINE12%% as the posterior mean α/(α+β) and, for elements stuck below 3% CR, calls the LLM to synthesise a new challenger variation.
Business Analysis
| Metric | Target |
|---|---|
| Addressable market | Any website with >10k MUV — 1M+ businesses |
| Monetisation | Tiered SaaS: Free (50k MUV) → Starter ($49) → Growth ($199) → Scale (custom) |
| Key differentiator | Autonomous optimisation — no A/B test hypotheses required |
| CAC target | < $200 via PLG (snippet install → conversion → upgrade) |
| ROI proof-point | Typical e-commerce CR improvement 0.5–2 pp → $10k+ monthly revenue uplift |
How to Run
Development (H2 in-memory, auto-DDL)
cd solutions/2026-05-29-convertmind-ai-api
mvn spring-boot:run -Dspring-boot.run.profiles=dev
The app starts on http://localhost:8080 with H2 console at /h2-console.
Quick smoke test
# 1. Register
curl -s -X POST http://localhost:8080/api/v1/auth/register \
-H "Content-Type: application/json" \
-d '{"email":"demo@test.com","password":"pass1234"}' | jq .
# 2. Copy the token from step 1
TOKEN="eyJ..."
# 3. Create website
curl -s -X POST http://localhost:8080/api/v1/websites \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"Demo Store","url":"https://demo.com"}' | jq .
# 4. Add element (copy websiteId from step 3)
curl -s -X POST http://localhost:8080/api/v1/websites/{websiteId}/elements \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"cssSelector":".hero h1","description":"Hero headline"}' | jq .
# 5. Add two variations (copy elementId from step 4)
curl -s -X POST http://localhost:8080/api/v1/elements/{elementId}/variations \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"content":"Free Shipping on All Orders"}' | jq .
curl -s -X POST http://localhost:8080/api/v1/elements/{elementId}/variations \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"content":"Summer Sale — 50% Off Today Only"}' | jq .
# 6. Copy the snippet tag from step 3 and paste into any HTML page.
# Or simulate a serve call directly:
curl -s "http://localhost:8080/api/v1/serve/{apiKey}?sessionId=test1&pageUrl=https://demo.com" | jq .
# 7. View analytics
curl -s http://localhost:8080/api/v1/analytics/websites/{websiteId} \
-H "Authorization: Bearer $TOKEN" | jq .
Enable AI variation generation
Set %%INLINE14%% in %%INLINE15%% (or via env var LLM_API_KEY):
llm:
api:
key: sk-...
model: gpt-4o-mini
Then call POST /api/v1/elements/{elementId}/variations/generate.
Production (PostgreSQL)
# application-prod.yml
spring:
datasource:
url: jdbc:postgresql://localhost:5432/convertmind
username: ${DB_USER}
password: ${DB_PASS}
jpa:
hibernate:
ddl-auto: validate # use Flyway/Liquibase for migrations
app:
base-url: https://api.convertmind.ai
jwt:
secret: ${JWT_SECRET} # 256-bit base64 key
mvn spring-boot:run -Dspring-boot.run.profiles=prod
References
- Why AI-personalisation beats A/B testing (Reddit /r/SaaS)
- Thompson Sampling — Russo et al. 2018 Tutorial
- Marsaglia-Tsang fast Gamma sampling
- Spring Boot 4.0.4 Reference
- Spring Security 7 — JWT patterns
FinOps Analysis para ConvertMind AI
Estimación de Costos Operativos
La micro-startup ConvertMind AI presenta un modelo de negocio con un potencial de margen de beneficio muy saludable en su fase de MVP, gracias a un uso estratégico de la IA que limita los costos variables. La estimación se basa en un escenario inicial de 20 clientes activos.
1. Estimación de Tokens LLM Mensuales
El motor de IA autónomo (%%INLINE18%%) es el principal consumidor de tokens LLM, utilizado para 'generar sugerencias de texto creativas para las variaciones' y potencialmente para análisis de rendimiento. Asumiendo que se utiliza un modelo de alta calidad como %%INLINE19%% para asegurar la creatividad y relevancia de las sugerencias, y que cada cliente tiene un promedio de 5-10 elementos dinámicos que se optimizan o refrescan con nuevas variaciones 2-4 veces al mes, estimamos un consumo de ~1,000,000 tokens/mes.
2. Desglose de Costos Mensuales
- LLM (OpenAI gpt-4-turbo): $25
- Cloud Hosting (Servidor de Aplicaciones): $25
- Base de Datos (PostgreSQL): $15
- CDN / Varios: $5
Costo Total Mensual Estimado: ~$70
3. Costos de Infraestructura Cloud
Los costos de infraestructura principales se dividen en:
- Servidor de Aplicaciones: $25/mes (AWS EC2 t3.small)
- Base de Datos: $15/mes (AWS RDS db.t3.micro)
4. Costos de APIs Externas
El único servicio de API externa significativo identificado es el de OpenAI para el LLM, con un costo estimado de $25/mes.
Estimación de Ingresos Mensuales y Margen de Beneficio
5. Ingreso Mensual Estimado
Basado en un modelo de monetización B2B SaaS por niveles, un precio promedio de $50/cliente/mes es razonable para una herramienta que promete optimización de conversión. Para un objetivo inicial de 20 clientes:
Ingreso Mensual Estimado: 20 clientes * $50/cliente = $1,000/mes.
6. Margen de Beneficio
- Ingresos: $1,000/mes
- Costos: $70/mes
- Beneficio: $1,000 - $70 = $930/mes
Este margen de beneficio excepcionalmente alto subraya que el valor principal de ConvertMind AI reside en su lógica de optimización y el impacto en el ROI del cliente, más que en el costo directo por llamada al LLM. La IA se utiliza de manera eficiente para la generación de contenido y análisis periódico, no para decisiones en tiempo real por cada visitante, lo que mantiene los costos de tokens bajos.
7. Optimizaciones Concretas para Reducir Costos
- Caching de LLM: Implementar una capa de caché para las respuestas del LLM. Si se solicita una variación para un tipo de elemento o contexto similar, se puede servir desde la caché en lugar de realizar una nueva llamada al LLM, reduciendo drásticamente el uso de tokens y la latencia.
- Optimización de Prompts: Refinar continuamente los prompts para el LLM para obtener resultados de alta calidad con el menor número de tokens posible (tanto de entrada como de salida).
- Modelos LLM Más Económicos: Aunque %%INLINE20%% se ha estimado por su calidad, monitorear si modelos más económicos como %%INLINE21%%,
Claude 3 Haikuo incluso modelos open-source auto-hospedados (si la complejidad y el costo de infraestructura lo justifican a escala) pueden ofrecer una calidad aceptable para las 'sugerencias creativas'. - Serverless para el Agente de Optimización: Migrar el
OptimizationAgent(la tarea programada que genera variaciones y analiza rendimiento) a una arquitectura serverless (ej. AWS Lambda). Esto permite pagar solo por el tiempo de computación real durante las ejecuciones programadas, eliminando el costo fijo de una instancia EC2 24/7 para esta función intermitente. - Derecho de Dimensionamiento (Right-sizing): Monitorear de cerca el uso de CPU, RAM y E/S de la base de datos. Si la t3.small o db.t3.micro están infrautilizadas, considerar reducir a t3.nano/micro o db.t3.nano/micro respectivamente, para ahorrar costos. Escalar solo cuando el tráfico y la demanda lo justifiquen.
- Batching de Llamadas LLM: Cuando sea posible, agrupar múltiples solicitudes de generación de variaciones o análisis en una sola llamada al LLM para aprovechar las eficiencias de las ventanas de contexto y reducir el número de invocaciones.
Conclusión
ConvertMind AI demuestra un modelo FinOps muy prometedor para una startup de IA, con bajos costos operativos iniciales y un alto potencial de margen. La clave será mantener la eficiencia en el uso de los LLM y la infraestructura a medida que el servicio escale, aplicando las optimizaciones mencionadas.
MVP FEATURES
- 01Natural language to REST endpoint generator
- 02JPA entity scaffolding
- 03OpenAPI spec auto-generation
- 04Docker Compose export
“The AI that speaks fluent Java”
Start Building Free
Flowforge Ai
82AI-powered code generation platform that transforms natural language into production-ready Spring Boot microservices in seconds.
Insight Pilot Api
82AI-powered code generation platform that transforms natural language into production-ready Spring Boot microservices in seconds.
Finshield Ai Api
82AI-powered code generation platform that transforms natural language into production-ready Spring Boot microservices in seconds.