All articles
Февраль 26, 2026 · 3 min read

How I Built an AI Chatbot That Handles 70% of Customer Support for a Barcelona E-commerce

Case study: AI chatbot built with Django and OpenAI that automated 70% of customer support and increased e-commerce conversion by 35%. Architecture, stack, and results.

AI chatbote-commerceOpenAIDjangocase studyBarcelonacustomer support automation
By Kirill Strelnikov — Freelance Python/Django Developer, Barcelona

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

Results After 3 Months

The numbers speak for themselves:

What Made It Work

Three decisions that made the difference:

  1. 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.
  2. Session memory. Remembering context within a conversation makes the interaction feel natural, not transactional.
  3. 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:

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.

Need help building something similar? I am a freelance Python/Django developer based in Barcelona specializing in AI integrations, SaaS platforms, and business automation. Free initial consultation.

Get in touch

Telegram: @KirBcn · Email: [email protected]