Skip to main content
Glama
Shopify AI Ops Agent

Shopify AI Ops Agent

πŸ›οΈ Shopify AI Operations Agent

Python 3.11+ FastAPI LangGraph License: MIT

A production-grade autonomous ecommerce operations agent built with LangGraph v1, Model Context Protocol (MCP 2026-07-28), FastAPI, PostgreSQL + pgvector, Redis, OpenTelemetry, and strict Human-in-the-Loop (HITL) risk governance.


πŸ“– Complete Technical Documentation

For in-depth architecture, terminologies, and Architectural Decision Records (ADRs) written in ASD-STE100 (Simplified Technical English), see: πŸ‘‰ DOCUMENTATION.md

Download the visual presentation PDF: πŸ‘‰ architecture_diagram.pdf (or at http://localhost:8000/architecture.pdf)


Related MCP server: MCP Shopify

πŸ—οΈ Core Architectural Invariants

  1. Pre-Execution Risk & Policy Gate: Destructive deletions, financial budgets, and outbound communications trigger a LangGraph interrupt (interrupt_before) requiring human approval.

  2. Decoupled MCP Tool Layer: All business capabilities are packaged as 5 stateless MCP tool servers (Shopify, Analytics, Meta Ads, Communications, Trend Intelligence).

  3. Deterministic Business Analytics: Financial metrics are computed using deterministic SQL routines, eliminating LLM arithmetic hallucinations.

  4. Anti-Early-Victory Sensors: The agent re-queries live state to mathematically verify that mutations occurred before reporting completion.

  5. Shift-Left Evals & Tracing: 28 automated pytest test suites, 17-case golden eval benchmark, and an independent Critic Agent audit (Score: 98.5/100, Grade: A+).


πŸ“ Repository Structure

shopify-ai-ops-agent/
β”œβ”€β”€ DOCUMENTATION.md           # Full technical documentation (ASD-STE100)
β”œβ”€β”€ architecture_diagram.pdf   # 2-slide landscape architecture diagram
β”œβ”€β”€ docker-compose.yml         # Postgres (pgvector) + Redis + Jaeger + API
β”œβ”€β”€ pyproject.toml             # Dependencies & packaging
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ api/                   # FastAPI routes (agent, approvals, health)
β”‚   β”œβ”€β”€ agent/                 # LangGraph state machine & specialized nodes
β”‚   β”œβ”€β”€ mcp_servers/           # 5 Stateless MCP tool servers
β”‚   β”œβ”€β”€ core/                  # Security (HMAC-SHA256), Idempotency, Database
β”‚   β”œβ”€β”€ rag/                   # Hybrid Vector + BM25 search & brand guidelines
β”‚   β”œβ”€β”€ static/                # Executive SaaS Cockpit UI & Command Palette
β”‚   └── evals/                 # Golden datasets & Critic Agent audit
└── tests/                     # 28 automated unit, safety, and integration tests

πŸš€ Quickstart & Setup

1. Local Development

# Install dependencies
pip install -r requirements.txt

# Start the application server & dashboard
python -m uvicorn app.api.main:app --reload --port 8000
  • Dashboard UI: http://localhost:8000/ (Press Ctrl + K for Command Palette)

  • Interactive API Docs: http://localhost:8000/docs

  • Architecture PDF: http://localhost:8000/architecture.pdf


πŸ§ͺ Verification & Evaluations

# Run full automated test suite (28 tests)
python -m pytest tests/ -v

# Run independent Critic Agent technical audit
python -m app.evals.judge_agent

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      Not graded
      maintenance
      A Shopify-focused MCP server that enables AI agents to manage store operations like order tracking, product discovery, and checkout link generation. It facilitates customer-facing interactions including shipping estimates and real-time inventory searches.
      -
    • A
      license
      Not graded
      quality
      C
      maintenance
      A comprehensive MCP server for Shopify Admin API integration, enabling AI assistants to manage products, orders, customers, inventory, analytics, and more through natural language.
      25 npm
      20
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Hosted MCP server connecting Shopify, Klaviyo, GA4, Meta Ads, Google Ads, Xero, Gorgias and 20+ e-commerce data sources so AI assistants can answer merchant questions that span every source at once.
      -