E-Commerce Support Bot
Routine support queries — handled automatically, 24/7
< 2 sec
response to any customer question
24/7
without agents or breaks
−87%
token cost via prompt caching
The problem
~80% of e-commerce support is routine: price, delivery, payment, return policy. A human agent answers the same questions dozens of times a day — during business hours only. Customers write at 11pm and wait until morning. The fix isn't more agents. It's automating what doesn't require a human — with store knowledge in the prompt, not a vector database.
How it works
Customer asks
Any question about products, delivery, payment, or policy
History loaded from Supabase
All previous turns pulled from the `cag` table and formatted into messages array
Claude reads context
System prompt (store knowledge) + history + new question passed to Claude Sonnet
Answer returned in < 2 sec
Accurate, grounded reply — only from what's in the system prompt
Exchange saved
Row written to Supabase: user message + AI response. Memory grows with each turn

The payoff
< 2 sec response time
Instant answers around the clock — no queue, no waiting, no human in the loop for routine queries.
24/7 without breaks
Works at 11pm, on weekends, on holidays. Coverage that no human team can match at this cost.
−87% token cost
System prompt cached for 1 hour via Anthropic's extended-cache-ttl beta. 87% cheaper per cached call.
No hallucinations
Claude answers only from what's in the system prompt. Wrong chunk problem doesn't exist — there are no chunks.
What's under the hood
n8n — orchestration
Single workflow: chat trigger → load system prompt → load history → format → call Claude → save response.
Supabase — memory
Table `cag` stores every exchange. All rows returned on each call — no external session management needed.
Claude Sonnet — the brain
Direct API call via HTTP Request node. Full control: model, temperature, caching headers, messages format.
Prompt caching
System prompt cached 1h, last conversation turn cached 5min. Anthropic extended-cache-ttl beta enabled.
Open source. Self-hostable.
The workflow JSON is open — import into your n8n, replace the system prompt with your store's knowledge, connect Supabase. Done.
Instant answers
Responds to questions about products, prices, delivery, payment, and warranty — without a human agent.
Conversation memory
Every exchange is saved to Supabase. The bot remembers the full context of the current session.
Prompt caching
The system prompt with store knowledge is cached for 1 hour. Subsequent calls read from cache — 87% cheaper.
Responds in the customer's language
Claude detects the language and responds accordingly — no extra configuration.