<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Chandan Pattanayak</title>
    <description>The latest articles on DEV Community by Chandan Pattanayak (@chandan_pattanayak_87fa6c).</description>
    <link>https://dev.to/chandan_pattanayak_87fa6c</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3938035%2F1c91334b-5e49-427d-9fda-561b45a79fd3.png</url>
      <title>DEV Community: Chandan Pattanayak</title>
      <link>https://dev.to/chandan_pattanayak_87fa6c</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/chandan_pattanayak_87fa6c"/>
    <language>en</language>
    <item>
      <title>Building an AI-Powered Shopify Assistant Using LangGraph, Flask, and Mistral AI</title>
      <dc:creator>Chandan Pattanayak</dc:creator>
      <pubDate>Thu, 28 May 2026 02:46:04 +0000</pubDate>
      <link>https://dev.to/chandan_pattanayak_87fa6c/building-an-ai-powered-shopify-assistant-using-langgraph-flask-and-mistral-ai-59ab</link>
      <guid>https://dev.to/chandan_pattanayak_87fa6c/building-an-ai-powered-shopify-assistant-using-langgraph-flask-and-mistral-ai-59ab</guid>
      <description>&lt;p&gt;As AI agents become more practical for real-world systems, I wanted to experiment with building a conversational Shopify assistant capable of:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Fetching Shopify orders&lt;/li&gt;
&lt;li&gt;Fetching products/items&lt;/li&gt;
&lt;li&gt;Fetching store details&lt;/li&gt;
&lt;li&gt;Generating human-readable insights using AI&lt;/li&gt;
&lt;li&gt;Running through a LangGraph workflow&lt;/li&gt;
&lt;li&gt;Exposing a Flask chatbot API&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In this article, I’ll walk through how I built a Shopify AI Assistant using:&lt;/p&gt;


&lt;div class="crayons-card c-embed"&gt;

  

&lt;h3&gt;
  
  
  🛠 Tech Stack
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Workflow Engine:&lt;/strong&gt; LangGraph&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;LLM Framework:&lt;/strong&gt; LangChain&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AI Model:&lt;/strong&gt; Mistral AI&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;API Layer:&lt;/strong&gt; Flask&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Commerce Backend:&lt;/strong&gt; Shopify Admin API

&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;

Traditional chatbots usually become difficult to scale once:


&lt;ol&gt;
&lt;li&gt;multiple tools are involved&lt;/li&gt;
&lt;li&gt;workflows become dynamic&lt;/li&gt;
&lt;li&gt;human interactions are needed&lt;/li&gt;
&lt;li&gt;state management becomes complex&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;LangGraph solves this elegantly by allowing us to create:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Stateful AI workflows&lt;/li&gt;
&lt;li&gt;Conditional routing&lt;/li&gt;
&lt;li&gt;Tool execution graphs&lt;/li&gt;
&lt;li&gt;Human-in-the-loop systems&lt;/li&gt;
&lt;li&gt;Multi-step agent pipelines&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This makes it perfect for AI commerce assistants.&lt;br&gt;
Architecture&lt;/p&gt;

&lt;p&gt;The workflow looks like this:&lt;br&gt;
&lt;/p&gt;
&lt;div class="crayons-card c-embed"&gt;

  &lt;br&gt;
User Request&lt;br&gt;
     ↓&lt;br&gt;
LangGraph Analyzer Node&lt;br&gt;
     ↓&lt;br&gt;
Conditional Router&lt;br&gt;
     ├── Orders Tool&lt;br&gt;
     ├── Products Tool&lt;br&gt;
     ├── Shop Tool&lt;br&gt;
     ↓&lt;br&gt;
Mistral AI Formatter&lt;br&gt;
     ↓&lt;br&gt;
Human Readable Response&lt;br&gt;
     ↓&lt;br&gt;
Flask API Response&lt;br&gt;

&lt;/div&gt;
&lt;br&gt;
Tech Stack&lt;br&gt;
Component   Technology&lt;br&gt;
Workflow Engine LangGraph&lt;br&gt;
LLM Framework   LangChain&lt;br&gt;
AI Model    Mistral AI&lt;br&gt;
API Layer   Flask&lt;br&gt;
Commerce Backend    Shopify Admin API&lt;br&gt;
Language    Python 3.11&lt;br&gt;
Shopify API Client

&lt;p&gt;First, I created a lightweight Shopify Admin API client.&lt;br&gt;
&lt;/p&gt;
  Click to see the Shopify API Client implementation
  

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
python
import os
import requests

SHOP_DOMAIN = os.getenv("SHOP_DOMAIN")
ADMIN_TOKEN = os.getenv("SHOPIFY_ADMIN_TOKEN")

def _fetch(path):

    url = f"https://{SHOP_DOMAIN}{path}"

    response = requests.get(
        url,
        headers={
            "X-Shopify-Access-Token": ADMIN_TOKEN,
            "Content-Type": "application/json"
        }
    )

    response.raise_for_status()

    return response.json()


def get_orders(limit=5):
    return _fetch(
        f"/admin/api/2026-04/orders.json?limit={limit}"
    )


def get_products(limit=5):
    return _fetch(
        f"/admin/api/2026-04/products.json?limit={limit}"
    )


def get_shop():
    return _fetch(
        "/admin/api/2026-04/shop.json"
    )

Creating LangGraph State

LangGraph workflows operate on a shared state object.

from typing_extensions import TypedDict

class GraphState(TypedDict):

    user_input: str
    intent: str
    tool_result: str
    final_response: str

This state flows across all nodes in the graph.

Creating Tool Nodes

I used LangChain tools for Shopify operations.

from langchain_core.tools import tool

@tool
def orders_tool():

    orders = get_orders(limit=5)

    return str(orders)

Similarly:

products_tool()
shop_tool()
Intent Analyzer Node

The analyzer determines which tool to call.

def analyze_input_node(state):

    user_input = state["user_input"].lower()

    if "order" in user_input:
        intent = "order"

    elif "product" in user_input:
        intent = "item"

    elif "shop" in user_input:
        intent = "shop"

    else:
        intent = "unknown"

    return {
        "intent": intent
    }
Conditional Routing

LangGraph supports conditional edges beautifully.

workflow.add_conditional_edges(
    "analyze_node",
    router
)

The router dynamically decides which node executes next.

Using Mistral AI for Human Readable Output

Raw JSON from Shopify isn’t user friendly.

So I added Mistral AI to transform the response into:

summaries
bullet points
recommendations
business insights
from langchain_mistralai import ChatMistralAI

llm = ChatMistralAI(
    model="mistral-large-latest",
    temperature=0.3
)

Prompt:

prompt = """
Convert Shopify data into:
- human readable format
- professional summary
- business insights
"""

This dramatically improved the user experience.

Flask Chat API

Finally, I exposed the workflow using Flask.

@app.route("/chat", methods=["POST"])
def chat():

    data = request.get_json()

    result = graph.invoke(
        {
            "user_input": data["message"],
            "intent": "",
            "tool_result": "",
            "final_response": ""
        }
    )

    return jsonify({
        "response": result["final_response"]
    })
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Example Request&lt;br&gt;
{&lt;br&gt;
  "message": "show recent orders"&lt;br&gt;
}&lt;br&gt;
Example AI Response&lt;br&gt;
Here are your latest Shopify orders:&lt;/p&gt;

&lt;p&gt;• Order #1001&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Customer: John Doe&lt;/li&gt;
&lt;li&gt;Total: $120&lt;/li&gt;
&lt;li&gt;Status: Paid&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;• Order #1002&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Customer: Alice Smith&lt;/li&gt;
&lt;li&gt;Total: $340&lt;/li&gt;
&lt;li&gt;Status: Pending&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Business Insight:&lt;br&gt;
Most recent orders are successfully paid, indicating healthy transaction flow.&lt;br&gt;
Challenges I Faced&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Python Compatibility&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Some AI libraries were not stable on Python 3.14.&lt;/p&gt;

&lt;p&gt;I eventually standardized on:&lt;/p&gt;

&lt;p&gt;Python 3.11&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;LangGraph State Errors&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I encountered:&lt;/p&gt;

&lt;p&gt;InvalidUpdateError&lt;/p&gt;

&lt;p&gt;This happened because every LangGraph node must update at least one state field.&lt;/p&gt;

&lt;p&gt;Once I ensured every node returned a valid state update, the workflow stabilized.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Human Readable AI Formatting&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Initially the responses were raw JSON.&lt;/p&gt;

&lt;p&gt;Adding Mistral AI transformed the chatbot into something actually useful for business users.&lt;/p&gt;

&lt;p&gt;Why This Architecture Is Powerful&lt;/p&gt;

&lt;p&gt;This setup enables:&lt;/p&gt;

&lt;p&gt;AI agents&lt;br&gt;
tool orchestration&lt;br&gt;
conversational commerce&lt;br&gt;
workflow automation&lt;br&gt;
scalable multi-agent systems&lt;/p&gt;

&lt;p&gt;The same architecture can later support:&lt;/p&gt;

&lt;p&gt;WhatsApp bots&lt;br&gt;
Slack bots&lt;br&gt;
React chat UIs&lt;br&gt;
Inventory forecasting&lt;br&gt;
AI recommendations&lt;br&gt;
customer support automation&lt;br&gt;
Final Thoughts&lt;/p&gt;

&lt;p&gt;LangGraph + LangChain + Mistral AI creates an incredibly powerful combination for building production-grade AI systems.&lt;/p&gt;

&lt;p&gt;Combining it with Shopify opens interesting possibilities for:&lt;/p&gt;

&lt;p&gt;commerce copilots&lt;br&gt;
operational assistants&lt;br&gt;
analytics bots&lt;br&gt;
AI support systems&lt;/p&gt;

&lt;p&gt;This project started as an experiment but quickly evolved into a scalable AI workflow architecture.&lt;/p&gt;



</description>
      <category>agents</category>
      <category>ai</category>
      <category>python</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Building a No-Code AI Agent for WooCommerce Order Analytics with Flowise &amp; HPOS</title>
      <dc:creator>Chandan Pattanayak</dc:creator>
      <pubDate>Thu, 21 May 2026 16:09:06 +0000</pubDate>
      <link>https://dev.to/chandan_pattanayak_87fa6c/building-a-no-code-ai-agent-for-woocommerce-order-analytics-with-flowise-hpos-3g81</link>
      <guid>https://dev.to/chandan_pattanayak_87fa6c/building-a-no-code-ai-agent-for-woocommerce-order-analytics-with-flowise-hpos-3g81</guid>
      <description>&lt;p&gt;tags: woocommerce, ai, lowcode, wordpress&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Imagine managing your WooCommerce store by simply asking:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;"Show me all orders placed by &lt;a href="mailto:customer@email.com"&gt;customer@email.com&lt;/a&gt;"&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;"Products stock level"&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;"What were today's sales?"&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;No SQL queries. No complex dashboards. Just plain English.&lt;/p&gt;

&lt;p&gt;That's what I built: a &lt;strong&gt;no-code AI agent&lt;/strong&gt; that connects directly to WooCommerce's database and answers questions about your store in real-time. In this article, I'll show you how it works, the challenges with WooCommerce's new HPOS (High-Performance Order Storage) system, and how to deploy it yourself.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem: WooCommerce Data is Buried
&lt;/h2&gt;

&lt;p&gt;WooCommerce stores order data across multiple MySQL tables with complex relationships. Extracting insights usually requires deep knowledge of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Orders:&lt;/strong&gt; &lt;code&gt;wp_wc_orders&lt;/code&gt; (HPOS) or &lt;code&gt;wp_posts&lt;/code&gt; (legacy)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Customer Info:&lt;/strong&gt; &lt;code&gt;wp_wc_order_addresses&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Order Items:&lt;/strong&gt; &lt;code&gt;wp_woocommerce_order_items&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Product Metadata:&lt;/strong&gt; &lt;code&gt;wp_postmeta&lt;/code&gt; (using key-value pairs)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stock Levels:&lt;/strong&gt; &lt;code&gt;wp_postmeta&lt;/code&gt; (meta_key = '_stock')&lt;/li&gt;
&lt;/ul&gt;


&lt;div class="crayons-card c-embed"&gt;

  &lt;br&gt;
&lt;strong&gt;The Technical Gap:&lt;/strong&gt; Most store owners aren't SQL experts. They struggle with JOINs, handling HPOS vs legacy storage differences, and WordPress's unique meta_key pattern.&lt;br&gt;

&lt;/div&gt;


&lt;h2&gt;
  
  
  The Solution: Natural Language + AI + Direct Database Access
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Architecture Overview
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjrgbj8soklyr4botcops.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjrgbj8soklyr4botcops.png" alt="Flowchart showing the connection between WooCommerce, Flowise AI, and the Mistral LLM" width="800" height="587"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Discussion &amp;amp; Feedback
&lt;/h2&gt;

&lt;p&gt;I'm curious to hear from the community:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Are you currently using HPOS in your WooCommerce builds, or sticking to legacy storage?&lt;/li&gt;
&lt;li&gt;What other "No-Code" AI integrations would be useful for e-commerce?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Let me know in the comments!&lt;br&gt;
&lt;a href="https://github.com/CPattanayak/woocommerce" class="crayons-btn crayons-btn--primary" rel="noopener noreferrer"&gt;Explore the Source Code on GitHub&lt;/a&gt;
&lt;br&gt;
  &lt;iframe src="https://www.youtube.com/embed/U_qRQLjyI-E"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;
Watch the AI MySQL Expert handle complex WooCommerce queries in real-time.



</description>
      <category>ai</category>
      <category>analytics</category>
      <category>nocode</category>
      <category>wordpress</category>
    </item>
  </channel>
</rss>
