When a Barcelona-based online clothing store approached me, their support team was drowning. 50+ daily inquiries about sizing, availability, and recommendations — and a conversion rate that wasn't moving. They needed a solution that could handle volume without sacrificing the personal touch that makes e-commerce work.
The Problem: Manual Support Can't Scale
The store had three support agents answering the same questions every day. Average response time: 4-6 hours. By the time a customer got a recommendation, they'd already left the site. The cost? Around €6,000/month in support salaries, with a browse-to-purchase conversion sitting at just 2.1%.
The owner had tried a basic FAQ bot before — customers hated it. It couldn't understand context, couldn't recommend products, and felt robotic. They needed something that actually understood their catalog and could have real conversations.
The Architecture: Django + OpenAI + Product Knowledge
I built a system with three core components:
1. Product Knowledge Engine
Instead of feeding the entire catalog to GPT on every request (expensive and slow), I built a vector-based product index using PostgreSQL with pgvector. Each product's description, attributes, and categories were embedded once. When a customer asks "do you have something for a beach wedding?", the system retrieves the 10 most relevant products before generating a response.
# Simplified retrieval flow
def get_recommendations(query, catalog_embeddings):
query_embedding = openai.embeddings.create(
model="text-embedding-3-small",
input=query
)
# Cosine similarity search against product vectors
matches = catalog.similarity_search(query_embedding, top_k=10)
return matches
2. Conversation Context Manager
The chatbot remembers what you've discussed within a session. If you said "I'm looking for a red dress for a party" and then ask "do you have it in blue?", it understands you're talking about dresses, not shirts. I used Django sessions with Redis as the backend, keeping the last 10 messages as context for each conversation.
3. Intelligent Handoff
The bot knows its limits. When a customer asks about returns, shipping to a specific country, or has a complaint, it smoothly transfers to a human agent with full conversation context. No "please repeat your question" — the agent sees everything.
The Stack
- Backend: Django + Django REST Framework
- AI: OpenAI GPT-4 API with function calling
- Database: PostgreSQL with pgvector for semantic search
- Cache: Redis for session management and rate limiting
- Frontend widget: Vanilla JS, embedded via script tag
- Deployment: Docker on a VPS with Nginx reverse proxy
Results After 3 Months
The numbers speak for themselves:
- 70% of inquiries handled automatically — no human intervention needed
- 35% increase in conversion rate — from 2.1% to 2.8%. The bot's personalized recommendations directly drove more purchases
- Response time: under 3 seconds — down from 4-6 hours
- Support cost reduced by 60% — from 3 agents to 1 agent handling only complex cases
- Customer satisfaction up 28% — measured via post-chat surveys
What Made It Work
Three decisions that made the difference:
- Product-aware, not generic. The bot doesn't just chat — it knows every item in the catalog. This is the difference between a toy and a sales tool.
- Session memory. Remembering context within a conversation makes the interaction feel natural, not transactional.
- Smart handoff. Knowing when NOT to answer is as important as knowing when to answer. Customers trust a bot that admits "let me connect you with a specialist" over one that gives wrong information.
Cost Breakdown
The project cost €4,200 total (development + deployment). Monthly running costs:
- OpenAI API: ~€120/month (with caching and smart prompt design)
- VPS hosting: €15/month
- Total: ~€135/month vs. €4,000/month saved on support staff
ROI: The system paid for itself in under 6 weeks.
Want Similar Results?
If your e-commerce store is spending more on support than it should, or your conversion rate is stuck, an AI chatbot might be the highest-ROI investment you can make this quarter. Let's talk about your specific case — I offer free 30-minute strategy calls.