AI · Consumer SaaS · Case study
Chat Your History: An AI personal historian that turns interviews into family memoirs
AI story generation SaaS case study: chat, SMS and phone interviews turned into memoir chapters by GPT-4, with Stripe and PayPal billing on Vercel.

- Client
- Chat Your History sells the Theo platform, an AI-powered personal historian that helps families capture and preserve their stories.
- Team
- 3 full-stack engineers, 1 DevOps engineer, 1 designer
- Timeline
- 5 months from discovery to launch, then ongoing support
- Services
- Web development, AI and data, Cloud and DevOps
- 4
- Applications in one monorepo
- 3
- Interview channels: chat, SMS, phone
- 2
- Payment providers reconciled by webhook
- 11
- Third-party integrations
In short
Chat Your History needed a SaaS product that interviews people by web chat, text message or phone call and turns the answers into polished memoir chapters. We built the whole Theo platform: four applications in one monorepo, streaming GPT-4 story generation, Stripe and PayPal subscriptions with gift codes, and S3-backed media. It runs in production on Vercel serverless with a Neon PostgreSQL database.
Where they started.
- Older, less technical users had to be interviewed in whatever channel suited them: web chat, SMS or a recorded phone call, with every answer landing in one structured record
- Raw question-and-answer transcripts had to become readable narrative in a consistent voice, with the user able to choose how creative the writing should be
- Story generation takes 30 to 60 seconds, so the interface had to show progress token by token and allow cancellation without leaking server resources
- Two payment providers, gift subscriptions, free trials and per-user story credits all had to reconcile correctly from webhooks
- A second, lighter product for quick memory capture with photos and videos had to share the same domain model and pipeline
The approach.
- Designed a monorepo with four deployable applications: the Theo Legacy interview app and API, and the Theo Moments capture app and API, all sharing one Prisma data model
- Built a three-channel interview system: Botpress web chat, Twilio SMS sessions and Twilio voice calls with recordings, plus question sets imported from Google Sheets
- Implemented streaming story generation over Server-Sent Events using OpenAI GPT-4 and GPT-3.5-turbo, with database-stored prompt templates and three creativity tiers mapped to model temperatures of 0.5, 1.0 and 1.5
- Integrated Stripe and PayPal side by side, including checkout, subscriptions, add-on credit packs, gift activation codes, trials and signature-verified webhooks
- Added a chapter system with drag-and-drop ordering, a Quill rich-text editor for post-generation edits, and an S3 media library served through one-hour presigned URLs
- Enforced usage limits at the API with progressive warnings at 80 and 90 percent of a user's story allowance
What shipped.
- Two Next.js 15 / React 19 frontends and two Express and Prisma backends
- Streaming AI generation engine with regeneration, token tracking and cancellation
- Multi-channel interview system across web chat, SMS and phone
- Dual-provider billing with subscriptions, add-ons, gift codes and trials
- Chapter and memoir organisation with a rich-text editor and media library
- JWT authentication, email verification, password reset and share links
- Vercel serverless deployment with Neon PostgreSQL and AWS S3
How the engagement ran.
Context
Chat Your History sells a simple promise: talk about your life and receive a written memoir. Delivering that promise is not simple. The people being interviewed are often grandparents who would rather answer a phone call than type, the raw material is fragmented question-and-answer pairs, and the output has to read like a book chapter rather than a transcript. The client also wanted a companion product, Theo Moments, for quick memory capture with photos, videos and documents, without building a second company to run it.
We took the product from architecture through production. The result is the Theo platform: two customer-facing applications and two APIs in one monorepo, sharing a single data model for users, conversations, stories, chapters, payments and media.
What we built
- Theo Legacy: interview-based story generation with web chat, SMS and phone channels, chapter organisation and a rich-text editing experience
- Theo Moments: a streamlined capture app where a memory, its follow-up answers and attached media become an AI-written story
- A streaming generation engine on OpenAI GPT-4 and GPT-3.5-turbo with database-stored prompt templates and three creativity levels
- Interview question sets imported from Google Sheets, with dynamically generated follow-up questions for depth
- Subscriptions and add-on credits through Stripe and PayPal, plus gift and trial activation codes delivered by email
- Usage tracking that enforces story and media limits at the API and warns users in the interface at 80 and 90 percent
- Sharing controls with per-story public or private settings and social share links
Architecture and stack
| Layer | Technology | Why |
|---|---|---|
| Frontend | Next.js 15 App Router, React 19 Server Components, Tailwind CSS 4, Radix UI | Server components cut client JavaScript; Radix gives accessible dialogs, selects and tooltips without a heavy kit |
| State | Seven Zustand stores plus TanStack React Query | UI state and server state are kept apart; selector-based subscriptions avoid needless re-renders |
| API | Express with a CORS, JWT and Zod middleware pipeline; SSE endpoints | Predictable request validation and streaming responses for generation |
| Data | Prisma on Neon serverless PostgreSQL with pooling and auto-retry | Type-safe access and a schema that migrates cleanly as the product grows |
| AI | OpenAI GPT-4 and GPT-3.5-turbo, configurable per generation | The model used is recorded per story, so cost and quality can be compared |
| Payments | Stripe 18 and PayPal Server SDK with raw-body webhook verification | Two providers, one subscription and credit model |
| Media and messaging | AWS S3 presigned URLs, Twilio voice and SMS, Botpress, Resend, Mailchimp | Files bypass the API, interviews reach users where they are, email stays deliverable |
| Hosting | Vercel serverless with Git-push deployment and the Edge Network | No servers to run; every push to main ships |
How we worked
The domain model came first. Conversations, questions, follow-ups, stories and chapters were modelled with the many-to-many links the memoir format needs, so a single answer can appear in several chapters and a chapter can draw on many interviews. Prompt templates and model choices were moved into the database rather than the code, which let the client tune tone and temperature without a deployment.
Each channel was then built as an adapter onto that model: Botpress for web chat, Twilio for text sessions and recorded calls. Payments followed the same pattern, with Stripe and PayPal as interchangeable providers behind one entitlement service. Theo Moments reused the pipeline with a simpler capture model, which is why the second product shipped as a variant rather than a rewrite.
Scale and complexity
| Measure | Figure from the documentation |
|---|---|
| Deployable applications | 4 (two Next.js frontends, two Express backends) |
| Frontend state stores | 7 Zustand stores plus React Query for server state |
| Interview channels | 3: web chat, SMS, phone with recording |
| Creativity tiers | 3, mapped to temperatures 0.5, 1.0 and 1.5 |
| API endpoint groups | 10, from users and conversations to webhooks and activation codes |
| Third-party services | 11, including OpenAI, Stripe, PayPal, Twilio, Botpress, S3 and Mailchimp |
| Generation time handled by streaming | 30 to 60 seconds per story |
What this means for your project
If you are building a product where a language model does real work for paying customers, the hard parts are rarely the model call. They are streaming, cancellation, usage limits, prompt management and billing that reconciles. This platform shows all of those solved in one production system, with the decisions documented.
It also shows how a second product can share a first product's engine. Innovation Insight designs the data model and pipeline to be reused, so the next idea costs a fraction of the first.
What changed.
- Both products are live in production, deployed automatically on every push to Vercel
- Users can complete an interview in any of three channels and receive a generated story in real time
- Every generation records its token usage, which the client uses for cost monitoring and A/B testing of prompt templates and models
- Subscription, add-on and gift revenue flows are processed automatically from Stripe and PayPal webhooks
Questions about this project.
How do you build a product that generates long AI text without the user waiting on a blank screen?
We stream tokens from OpenAI to the browser over Server-Sent Events, so text appears as it is written, and we wire an AbortController through the stack so a cancelled request stops the model call and frees the server. Post-processing trims the output to complete sentences and splits it into paragraphs.
Can one platform support both Stripe and PayPal?
Yes. Each provider gets its own service and webhook controller with signature verification, and both write to the same subscription and credit tables. Gift codes and trials sit on top of that shared model, so a code redeemed by email activates the same entitlements as a card payment.
Why run the backend on serverless if generation takes up to a minute?
Vercel functions are configured with the platform's 30-second execution ceiling in mind, and the streaming design means the client receives output continuously rather than waiting for a single response. Long-running work is kept inside those limits with keep-alive settings and a retry queue for asynchronous jobs.