Case Study
Shopify Chatbot
A storefront concierge that finds products and checks out orders — conversationally
Demo video
What it is
The Shopify Chatbot is a shopping assistant for Shopify stores: customers describe what they're looking for in plain language, the bot searches the catalogue, answers product questions, and can place orders through the Shopify API. Built with a Streamlit frontend over a LangGraph-orchestrated Python service.
The problem
Store search boxes are keyword matchers — they fail on "something waterproof under ₹2000 for commuting", and multi-step purchases generate support tickets. I wanted a storefront layer that behaves like a good in-store clerk: asks clarifying questions, knows the catalogue, and handles the transaction end to end.
How it works
LangGraph state machine
The conversation is modelled as a graph of states — intent detection, catalogue search, product Q&A, cart management, checkout — with LangGraph handling transitions and looping. Graph-shaped orchestration (versus a linear chain) is what makes multi-turn commerce conversations recover gracefully when users change direction mid-flow.
Shopify GraphQL integration
Product searches, variants, inventory and pricing are served through Shopify's GraphQL Admin/Storefront APIs via a FastAPI service layer. GraphQL's single-query shape keeps catalogue lookups efficient — one request assembles product, variant and price data that REST would need several calls for.
Retrieval over the catalogue
Product descriptions and attributes are embedded into Chroma DB so natural-language queries map to semantically relevant products, with OpenAI models handling the conversational layer and synthesis.
LangSmith observability
Every conversation trace is captured in LangSmith — prompt I/O, tool calls, latencies — which turned debugging commerce flows from guesswork into reading timelines.
Challenges & solutions
Commerce conversations change state mid-sentence — users pivot from browsing to checkout to a product question without warning.
LangGraph's conditional edges let each turn re-evaluate the destination state, so pivots become graph transitions rather than conversation resets.
Order placement against a live store cannot tolerate "the model thought it placed the order".
Cart and checkout operations are explicit, validated tool calls against the Shopify API with human-visible confirmation before submission — the LLM orchestrates, the API commits.
What I learned
- Graph orchestration is the right shape for transactional conversations; chains are for pipelines.
- Tracing (LangSmith) pays for itself the first week — agentic bugs are invisible without it.
- For commerce, keep the LLM out of the commit path: it should draft intent, never execute purchases.