©Code byMilanParmar

Rescuing an AI-generated demo: The Chat Company, launched in 9 weeks for 30+ businesses

The Chat Company came to me as a buggy demo that the founder and another developer had generated with AI tools. It showed the idea, but it couldn't serve real businesses. I reviewed all of it, kept about 20% (the general backend code that worked), rewrote the other 80%, and launched the full product in nine weeks. It went on to serve 30+ businesses.

Category
AI
Industry
AI / SaaS
Type
AI chatbot SaaS
Year
2026

At a glance

Client
The Chat Company, an AI chatbot SaaS
The problem
A buggy, unfinished AI-generated demo that showed the idea but couldn't serve real businesses or scale.
What I built
Kept about 20% of the demo and rewrote the rest: a multi-tenant SaaS with a website crawler, a RAG answer engine on OpenAI, a one-script widget, a live visual customizer, conversation analytics, and a support desk.
The result
Launched in 9 weeks and used by 30+ businesses. Replies are about 3x faster than typical chatbot platforms.
Timeline
9 weeks
Budget
$20,000

What was wrong with the AI-generated demo

The first version was generated with AI tools by the founder and another developer. It was good enough to pitch the idea, but it was buggy, unfinished, and couldn't scale to serve real businesses: a chatbot that answers from each customer's own website, matches their brand, and installs anywhere.

The problem: AI chatbots that don't know your business

A generic AI chatbot answers from what it learned on the internet, not from your pricing, your services, or your policies. Building one that answers from your own content usually means hiring AI engineers and running servers, which small and mid-sized businesses won't do.

The Chat Company needed to make that a quick self-serve setup: point it at a website, and get a chatbot that knows the business, looks like the brand, and installs anywhere.

Fix or rebuild? Keeping 20% and rewriting 80%

I reviewed all of the code before changing anything. About 20% was general backend code that worked, so I kept it. The other 80% I rewrote, then built the rest of the product on that foundation.

Making customer data safe in a multi-tenant AI app

The production rule that matters most in a SaaS like this is that one customer's data never reaches another customer. Every search is filtered by business, so one customer's website content can never show up in another customer's chatbot.

Each page is split into chunks of about 500 characters that overlap slightly, and for every question the five most relevant chunks are given to the model as context. If the lookup is slow or fails, the chat still answers instead of breaking.

  1. 01

    A visitor asks a question

  2. 02

    The five most relevant chunks of that business's content are found

  3. 03

    They're added to the prompt as context

  4. 04

    The model streams an answer grounded in the website

Onboarding that survives slow crawls and closed tabs

Onboarding runs as a step-by-step flow that remembers where each business left off. Crawling and indexing take time and can fail, so a slow crawl or a closed tab never means starting again.

  1. 01

    Enter the website URL

    The crawler maps every page on the domain.

  2. 02

    Pick the pages

    The business chooses what the bot should learn.

  3. 03

    The bot learns them

    Pages are scraped, split into chunks, and indexed for search.

  4. 04

    Style the chat window

    Pick one of 56 templates and adjust it live.

  5. 05

    Paste one script tag

    Works on WordPress, Shopify, or plain HTML.

One script tag that works on any website

The chat widget is a single JavaScript file with its styles built in. It loads the business's settings, streams answers, and tracks sessions, without touching the rest of the site. That's why it installs the same way on WordPress, Shopify, or a hand-coded HTML page.

Businesses style it in a live customizer: 56 templates, plus controls for colours, fonts, message bubbles, the launcher button, position, and pop-up behaviour. Every change shows instantly in a preview next to the controls.

Chatbot analytics: seeing what visitors actually ask

The dashboard shows sessions, messages, unique users, token usage, and a replay of every conversation. For a business, that's a list of the questions its website doesn't answer well. For the product, token tracking and capped conversation length keep AI costs predictable.

The knowledge base view shows exactly which pages and chunks the bot has learned. The screenshot below is from Authentic Urban, the D2C store I also built.

Keeping AI costs predictable in production

Long conversations send more text to the model on every turn. I capped conversation history and answer length, and the dashboard tracks tokens per business, so each customer's AI bill stays predictable.

Inside The Chat Company

  • Homepage

    The marketing site sells the chatbot as a pipeline tool, then drops into pricing, FAQ, and the live widget.

  • Dashboard

    The dashboard tracks messages, tokens, users, and individual chat sessions from one place.

  • Knowledge Base

    Scraped pages, company knowledge, and indexed chunks sit together so you can see what the chatbot actually knows.

1 / 3

Results

  • 30+

    businesses using it

  • 9 weeks

    from buggy demo to launch

  • ~3x

    faster replies than typical chatbot platforms

  • 9 weeks

    from start to launch

Key decisions

  1. 01

    Keep the 20% that worked, rewrite the rest

    The general backend code from the demo worked, so rewriting it would have cost time for nothing. Everything else was rewritten so the product could serve real customers.

  2. 02

    Filter every search by customer

    One business's content must never appear in another's chatbot. Filtering at the search layer makes that a hard guarantee, not a hope.

    Trade-off: Every lookup has to carry the customer's identity.

  3. 03

    Cap conversation history and answer length

    Long conversations send more text to the model every turn. Capping them keeps each customer's AI bill predictable.

    Trade-off: Very old messages in a long chat are forgotten.

  4. 04

    Onboarding as a resumable step-by-step flow

    Crawling and indexing take time and can fail. Saving each step means a business always picks up where it left off.

FAQs

Can you fix an app that was built with AI tools?

Yes. AI tools are good at getting a demo working quickly, but the code usually isn't ready for real users. I review what's there, keep what works, and rewrite the rest. On The Chat Company that meant keeping about 20% and rewriting 80%, then building the full product on top.

Should I fix my vibe-coded app or rebuild it?

Decide after a code review, not before. Keep the parts that work and are safe, and rewrite the parts that can't be trusted with real users or real data. Here, the review showed that about 20% could stay.

How do you keep each customer's data separate in an AI SaaS?

Tag every stored record with the customer it belongs to, and filter every search by that tag. Do the same for sessions, messages, and settings, and check ownership on every protected operation. Isolation has to live in the data layer, not just the interface.

How long does it take to rescue an AI-generated app?

This one took nine weeks from takeover to launch, including building the rest of the product on what was kept.