All projects

Production

AI Brand and Email Generation

Claude generates and refines a business's brand voice and email templates through multi-turn conversation

Java 21Spring Boot 3.5Spring AI 1.1Claude SonnetAngularTypeScript
AI Brand and Email Generation - abstract illustration

What it does

Part of a larger email marketing platform. Two AI-powered services handle generation work. The brand generation service runs a multi-turn conversation with Claude to produce a brand guide for a business - covering writing style, tone, topic focus, and legal/compliance constraints. The template generation service takes the brand output and generates ready-to-send email templates in a requested format (newsletter, promotional, announcement). Both services are called from the Angular admin console.

The brand generation conversation

Brand generation is iterative. The service doesn't produce a brand guide in one shot. It asks the user targeted questions about their business, audience, and communication goals, incorporates the answers into successive turns, and produces a structured brand guide when it has enough signal. The user can review, edit, and regenerate any section. The final output is stored as a structured document that drives all subsequent template generation.

Structured output without fragile regex

Getting reliable structured output from a language model is a known problem. I use marker-delimited output contracts: the prompt defines exact start and end markers for each section of the output (for example, BRAND_VOICE_START and BRAND_VOICE_END). The parsing layer splits on those markers. This approach is more reliable than JSON mode for complex, multi-section documents, and it degrades gracefully when the model produces extra text around the markers.

Why this matters

Most small businesses have no brand guide and no email templates. They write every email from scratch. The brand guide step forces them to articulate their audience and voice, which improves every piece of communication they produce - not just the AI-generated ones. The template generation step gives them a starting point that's already consistent with that guide.

Stack

Java 21Spring Boot 3.5Spring AI 1.1Claude SonnetAngularTypeScript

Want something like this built?

This is the kind of system I build for clients. Tell me what you're trying to do, and I'll give you a straight answer on whether AI is the right tool.

Book a 30-minute call