A conversational AI agent built around Magento
EnviroPack
A production-grade assistant and hybrid RAG platform for product discovery, order support and personalized commerce — designed to sit alongside an existing Magento storefront rather than replace it.
< 200 KB gzip
A storefront that can understand the product behind the query.
The visuals below are an illustrative catalog treatment for the case-study page.
From a natural-language request to relevant products.
The system is designed for queries where intent, product attributes and exclusions all matter — including searches that do not resemble literal catalog terminology.
Embeddable AI chat widget
React + Vite widget, connected over WebSockets for real-time token streaming and product discovery.
Enterprise control center
Next.js portal for conversation oversight, ingestion controls, transcript governance and sync operations.
- Deployment
- FastAPI microservice
- Catalog sync
- Magento 2 REST APIs
- Retrieval model
- Hybrid dense + sparse
- Widget protocol
- Realtime WebSockets
The challenge was not just search.
Customers often describe what they want in terms of use, attributes or exclusions instead of exact product names. At the same time, the assistant needed to understand account context, order status and B2B pricing while remaining grounded in Magento data.
Intent ambiguity
Natural-language requests can describe meaning rather than catalog keywords.
Category boundaries
Accessories and neighboring products must be demoted when the shopper asks for something else.
Catalog sync lag
Re-indexing must not expose partial datasets or zero-point search windows.
Conversation continuity
Follow-up turns should inherit state instead of behaving like unrelated searches.
Architecture
The architecture prioritizes modularity: a low-latency edge chat client, stateful LangGraph orchestration, dual vector retrieval, and resilient multi-provider LLM transport.
Decision 01
Search needed both meaning and precision.
Normalize the query, combine dense and sparse retrieval in Qdrant, rerank candidates with a cross-encoder, then pass the strongest product context to the LLM.
Architecture Narrative
User query flows into query expansion, then into dense and sparse retrieval, then reranking, then final product context.
Architecture Narrative
Magento catalog flows into an ingestion worker, then a staging collection, validation, and finally an atomic live alias switch.
Decision 02
The live index should never become half-built.
Build the new catalog in a date-stamped staging collection, validate it, then update the live collection alias atomically.
Decision 03
Conversation state had to survive the request.
Architecture Narrative
Customer message enters WebSocket and FastAPI, flows through LangGraph, uses persisted PostgreSQL state and retrieval context, then returns a streamed response.
LangGraph orchestrates the stateful execution flow while PostgreSQL stores checkpoints for durable conversation continuity.
Decision 04
An AI provider failure should not become a commerce failure.
Route normal requests through a primary provider and fail over on transient network or service errors.
Architecture Narrative
Agent request goes to a fallback provider abstraction, then to OpenAI as primary. A transient failure sends the request to OpenRouter.
One AI system, two focused experiences.
The customer-facing widget stays small and real-time. The admin experience exposes the controls that operations teams need to keep the system healthy and governed.
Embeddable chat widget
React + Vite, compiled as a standalone widget and connected to the backend over WebSockets.
- Discoversemantic product search
- Trackorders + account history
- PersonalizeB2B tier pricing context
- Streamtoken-by-token responses
Enterprise control center
Next.js 15 portal for transcript review, ingestion jobs, synchronization and governance.
- Reviewconversation oversight
- Syncstock + pricing controls
- Governraw transcript export rules
- ProtectTOTP 2FA
What the architecture makes possible.
Conversation context persists
PostgreSQL-backed checkpoints let the agent retain context across turns.
Search combines semantics + precision
Dense and sparse retrieval are paired with reranking for stronger catalog matching.
AI provider failover is built in
Transient provider failures can move to a secondary model path.
Catalog updates can be staged
New indexes are validated before the live alias is switched.
Responses stream over WebSockets
The widget receives token-by-token response updates without waiting for a full batch.
Widget gzip target
The source specifies a sub-200 KB gzip engineering target; it is not presented here as a measured business result.
Complex where it matters. Familiar everywhere else.
The AI layer carries the sophistication. Supporting services use mainstream infrastructure that can be monitored, maintained and extended.
AI & Retrieval
Agent orchestration, hybrid search and candidate reranking.
Backend
Async APIs, state persistence and commerce integration.
Experience
Low-weight embedded customer UI plus enterprise admin tooling.
Commerce
Existing storefront commerce remains the system of record.
Client testimonial
The team treated our operational constraints as design inputs. The agent shipped into a live support workflow without disrupting it.
