From Chat Widget to Conversation Platform: Our Technical Journey
We didn't set out to build a conversational AI platform. We started with a simple chat widget. Here's how we evolved from a weekend project to infrastructure serving 15,000 production applications.
The Beginning: A Simple Chat Widget
Early 2024 - The first version was embarrassingly simple:
javascript
// Literally the entire first version
It worked for exactly one use case: answering FAQs on our own website. But customers started asking if they could use it too.
Phase 1: Multi-Tenancy (Q1 2024)
The first real feature request: "Can I use this on my website?"
The challenge: Every customer needed:
- Their own knowledge base
- Their own branding (colors, logo, copy)
- Their own subdomain
- Isolation from other customers' data
- Added
appIdto every request - Created a configuration table in PostgreSQL
- Built a simple admin panel
- Added API keys for authentication
- Multi-tenancy is harder than it looks
- Data isolation is critical (one SQL typo could leak customer data)
- Configuration needs versioning (customers want to test changes before going live)
What we built:
What we learned:
By the end of Q1, we had 12 paying customers.
Phase 2: Customization (Q2 2024)
Customers wanted to customize everything:
"Can we change the button color?"
"Can we add our logo?"
"Can we customize the welcome message?"
"Can we position it on the left instead of right?"
The problem with our approach:
javascript
// This quickly became unmaintainable
if (appId === 'customer1') {
buttonColor = 'blue';
} else if (appId === 'customer2') {
buttonColor = 'red';
position = 'left';
} else if (appId === 'customer3') {
// ... you get the idea
}
The solution: Configuration-driven UI
json
{
"appId": "customer1",
"theme": {
"primaryColor": "#0066cc",
"position": "bottom-right",
"logo": "https://cdn.customer1.com/logo.png"
},
"behavior": {
"welcomeMessage": "Hi! How can I help?",
"placeholder": "Type your message...",
"autoOpen": false
}
}
Every visual element became configurable. Customers could customize their chat widget without us writing code.
Phase 3: Beyond Text (Mid-2024)
"Can the bot show buttons?"
"Can it display product cards?"
"Can users upload images?"
We realized conversations aren't just text. They're rich, interactive experiences.
The architecture shift:
Old approach: Strings everywhere
javascript
response = "Here are your options: A, B, or C"
New approach: Structured message format
javascript
response = {
type: 'message',
content: 'Here are your options:',
components: [
{ type: 'button', label: 'Option A', action: 'select_a' },
{ type: 'button', label: 'Option B', action: 'select_b' },
{ type: 'button', label: 'Option C', action: 'select_c' }
]
}
This opened up everything:
Phase 4: The Great Rewrite (Q2-Q3 2024)
By mid-2024, we had a problem. Our codebase was:
We were adding features faster than we could stabilize the platform. Downtime was increasing. Customer complaints were growing.
Decision: Rewrite the entire backend.
New architecture:
The migration:
1. Built new system alongside old one
2. Migrated one customer at a time
3. Ran both systems in parallel for 2 months
4. Verified data consistency
5. Shut down old system by end of Q3
The result:
Phase 5: The Platform Emerges (Q3 2024)
With stable infrastructure, we could finally think bigger than a chat widget.
Customers were asking:
We realized: we're not building a chat widget. We're building a conversational AI platform.
What changed:
1. Input methods beyond web chat
2. Output destinations beyond UI
3. Conversation flows
4. Developer tools
Phase 6: AI Integration (Q3 2024)
When ChatGPT launched, customers immediately asked: "Can you integrate this?"
The challenge: We had been using rule-based conversation flows. AI required a completely different approach.
Old way: Rule-based
javascript
if (message.includes('price') || message.includes('cost')) {
return "Our pricing starts at $29/month";
}
New way: LLM-powered
javascript
const context = {
knowledgeBase: loadKnowledgeBase(appId),
conversationHistory: getHistory(conversationId),
availableTools: ['check_price', 'book_demo', 'send_email']
};
const response = await openai.chat.completions.create({
model: "gpt-4",
messages: buildPrompt(message, context),
tools: context.availableTools
});
What we built:
By August 2024:
Phase 7: Scale (Recent Months)
With AI capabilities, growth exploded:
New challenges:
1. LLM Costs Were Crushing Us
Every conversation = API calls = money
Solution:
2. Latency Was Increasing
More customers = more database queries = slower responses
Solution:
3. Support Was Unsustainable
More customers = more support tickets
Solution:
4. Features Were Diverging
Enterprise customers wanted features free tier didn't need
Solution:
Today: September 2024
The platform today:
The tech stack:
The team:
Key Lessons
1. Start Simple, Then Evolve
Don't try to build the perfect architecture on day one. Build for today's needs, but design for tomorrow's changes.
2. Listen to Customers
Every major feature came from customer requests. We built what people actually needed, not what we thought was cool.
3. Architecture Matters
The rewrite in mid-2024 was painful but necessary. Bad architecture compounds over time.
4. Invest in Developer Experience
Great docs, easy onboarding, and helpful error messages turn users into advocates.
5. Scale is a Feature
Being able to handle 15,000 apps is a competitive advantage. Customers don't want to worry about scaling.
6. Dogfood Everything
We use our own platform for our support bot, sales assistant, and internal tools. This forces us to fix pain points.
What's Next
We're working on:
Want to Build With Us?
For developers:
For businesses:
---
*Questions about our technical decisions? Email us at hello@ilq.ai*
