Not a tutorial. The actual production architecture behind 7 AI agents processing 37,800 products, 196 marketplace sellers, and thousands of customer interactions daily.
Every agent in the MarginOps stack was built in Claude Code. Not designed in Figma, not spec'd in Confluence, not prototyped in a Jupyter notebook. Built, tested, and deployed from the terminal.
The workflow is straightforward. I describe what the agent needs to do in natural language. Claude Code generates the implementation. I review it, test it against real data, iterate on the parts that need refinement, and deploy. The auto-accept mode is where the speed comes from — when I am in an iteration loop and the changes are incremental, I let Claude Code apply modifications directly without manual approval on each step. An agent that would have taken a team of three engineers two to three weeks to build goes from concept to production in four to five days.
I am not exaggerating that timeline. The pricing engine's 7-check monitor went from "we need real-time safety checks on the pricing recommendations" to deployed production system in four days. The customer data platform's segmentation pipeline — replacing a £40K annual vendor — was built and deployed in under a week. The database optimisation that produced a 59,000x query speedup was a single Claude Code session.
The reason this works is that Opus 4.6 does not just write code. It understands the operational context. When I say "the pricing agent needs to check for discount code conflicts before applying markdowns," it generates code that queries the promotions database, cross-references active codes, calculates the effective discount depth, and applies the margin floor constraint. It does not just write a function signature and leave the business logic to me.
Claude Code builds the agents. The Agent SDK runs them. The distinction matters. Claude Code is the development environment where I iterate rapidly. The Agent SDK is the production framework that ensures agents run reliably, handle failures gracefully, and coordinate with each other.
Each of the 7 production agents is built on the Agent SDK. The SDK provides the scaffolding that turns a Claude-powered analysis into a production system: structured input/output schemas, error handling and retry logic, logging and observability, rate limiting, and the orchestration layer that manages agent lifecycles.
The pricing agent is a good example of the architecture. It runs on a 15-minute cycle. Each cycle, it pulls the current product catalogue from Snowflake, runs the 7-check monitor against the live data, generates recommendations for any products that trigger a check, validates those recommendations against the margin floor constraints, and pushes approved changes to the pricing system. If any step fails — database timeout, API error, constraint violation — the SDK handles the failure mode. It logs the error, skips the affected products, and continues processing the rest of the catalogue. No human intervention required for routine failures.
The CX agent has a different architecture. It runs continuously, processing incoming customer support queries in real time. The SDK manages the queue, routes queries based on topic classification, maintains conversation state across multi-turn interactions, and escalates to human agents when confidence drops below the threshold. The result: CSAT from 59% to 80%, with the AI handling first-line resolution and humans handling only the complex cases.
The Model Context Protocol is the layer that connects Claude-powered agents to the actual business systems they need to operate on. Without MCP, every agent would need custom integration code for every data source. With MCP, I define a connection once and every agent can use it.
The MarginOps stack connects to: Snowflake (product data, transaction history, customer data), the client's e-commerce platform API (live pricing, inventory levels, order status), the marketplace seller portal (196 sellers, consignment stock data), the cloud infrastructure monitoring APIs (AWS CloudWatch, cost explorer), the customer support ticketing system, and the marketing automation platform.
MCP standardises these connections. The pricing agent queries Snowflake for elasticity data through the same MCP interface that the CDP agent uses to pull customer segmentation data. The DevOps agent reads infrastructure metrics through MCP the same way the analytics agent reads business KPIs. This standardisation is not just architectural cleanliness. It is operational efficiency. When I need to add a new data source — a new marketplace channel, a new vendor system — I define one MCP connection and all 7 agents can access it immediately.
The concrete impact: the marketplace agent manages 196 sellers through MCP connections to the seller portal. It monitors listing quality, pricing compliance, and sell-through rates. When it detects a seller with a wave of zero-sellers (products listed but not selling), it automatically flags the seller for review and adjusts the consignment pricing engine's parameters for that seller's catalogue. That workflow — from detection to pricing adjustment — crosses three different data systems, all connected through MCP.
Curious what your margin opportunity looks like?
Free Tool
How much margin are you leaving on the table?
Answer 6 questions. Get a personalised margin estimate in under 2 minutes.
Take the Free Margin AuditHere is what actually runs, every day, without human intervention.
The pricing agent monitors 37,800 products every 15 minutes. It runs 7 automated checks: demand shift detection, stock velocity alerts, discount code conflict detection, zero-seller wave detection, margin floor enforcement, rate-of-change limiting, and cross-category cannibalisation detection. It generated +77% revenue and +72% gross profit in the first five weeks.
The CDP agent processes the customer database nightly, running behavioural segmentation and updating customer profiles. It identifies lapsing high-value customers, predicts churn risk, and triggers personalised re-engagement campaigns through the marketing automation MCP connection.
The CX agent handles first-line customer support in real time. It resolves order status queries, processes returns, answers product questions, and escalates complex issues to human agents with full context attached. It contributed to taking CSAT from 59% to 80%.
The warehouse agent monitors fulfilment operations, optimising pick-pack-ship workflows, predicting stock-out risks, and coordinating with the pricing agent when inventory levels trigger markdown recommendations.
The marketplace agent manages 196 sellers: monitoring listing quality, enforcing pricing policies, flagging underperformers, and coordinating with the consignment pricing engine for daily price adjustments.
The DevOps agent monitors cloud infrastructure, executes routine optimisations, alerts on anomalies, and maintains the 60% cost reduction we achieved during the initial migration.
The analytics agent generates daily and weekly business reports, tracking all 119 EBITDA-tracked initiatives and flagging any that are trending off-target.
Opus 4.6's agent teams added the final piece: coordination across agents. The coordinator pattern works like this: a senior agent receives a complex, multi-department query and dispatches sub-agents to gather information from each relevant workstream. The sub-agents run in parallel, each using their MCP connections to pull data from their domain. The coordinator synthesises the results and generates a unified recommendation.
Real example from last month: the client's CEO asked "why did margin dip in week 8?" The coordinator agent dispatched sub-agents to pricing (was there a markdown issue?), CX (was there a spike in returns?), marketplace (did a seller underperform?), warehouse (was there a fulfilment cost spike?), and cloud (was there an infrastructure incident?). Within 12 minutes, the coordinator had synthesised the answer: a promotional code had been misconfigured, allowing stacking with an existing markdown on a high-volume category. The discount conflict detection had caught most instances but the code had been added to the system after the last monitor cycle. The coordinator recommended an immediate code deactivation and a schedule change to run the conflict check every 5 minutes instead of every 15.
That is the architecture. Not theoretical. Not a roadmap. Running in production, processing real data, driving real P&L outcomes across a £6.4M transformation programme. Built in Claude Code, orchestrated by the Agent SDK, connected through MCP, coordinated by Opus 4.6 agent teams.
We build and deploy agents that run autonomously on your actual business data. Measurable outcomes tracked to EBITDA. No slide decks.
We go into businesses and make them permanently more profitable. Every initiative is EBITDA-tracked.