MiddleOut Analytics - AI-Powered Ecommerce Platform

Context-aware AI analyst for ecommerce analytics

MiddleOut Analytics is a multi-workspace analytics platform for ecommerce brands. I worked as a backend developer on Piper, the AI layer: context-aware chat, OpenAI and Anthropic model orchestration, specialist monitoring agents, and the runtime that routes, budgets, and audits AI work across workspaces.

Project type

Ecommerce analytics platform - AI chat + agentic monitoring layer

Role

Backend developer - AI layer

Year

2026

Scope

Piper AI backend, context-aware chat, chat history, OpenAI and Anthropic integration, tool-calling agent loop, monitoring agents, daily per-workspace scheduling, model fallback, budget checks, audit logging, workspace isolation

Middle Out public homepage hero with sustainable growth messaging and ecommerce creative examples
Website overview dashboard with sessions, engagement, bounce rate, conversion metrics, and the Piper chat entry point
MiddleOut Analytics dashboard mockup with Piper AI chat panel, ecommerce charts, and floating website overview cards
Piper AI chat modal opened over the MiddleOut Channels dashboard with suggested ecommerce analytics questions

Summary

Built for

Ecommerce operators and marketing teams who need dashboard data explained in context, not just displayed as charts. The project was built by the Softify agency, and I was brought in as a backend developer for the AI layer.

The problem

A dashboard can show what happened, but it does not explain why it matters or what to do next. A generic chatbot does not solve that if it cannot see the selected chart, date range, workspace context, saved insights, or data freshness. Once AI runs across multiple workspaces, cost, isolation, fallback, and observability become product requirements rather than implementation details.

Approach

Piper was built as a layered AI system. The conversational layer receives structured chart and KPI context from the dashboard. Behind it, a backend orchestrator routes requests through approved tools and model providers, while scheduled monitoring agents review each workspace and write confirmed findings into an insight feed.

Showcase story

Piper turns "ask about this chart" into a real analyst workflow. A user can open the assistant from a chart or KPI card, and the backend receives the exact component context: metrics, date range, page, workspace, comparison window, and a preview of the data. Piper can then answer with the context of what the user is actually seeing, not a generic prompt floating beside the dashboard. This was an agency collaboration: Softify led the overall MiddleOut product work, and I was invited in as a backend developer focused on the AI layer.

The problem

Most AI dashboard features are a chat box with no real context. That is not enough for an ecommerce analytics product where the same question can mean different things depending on workspace, date range, attribution view, data freshness, and the chart currently on screen. Production AI also needs operational guardrails. Model calls cost money, providers can fail, stale data can create bad alerts, and multi-workspace products cannot rely on prompt instructions for tenant isolation.

What I built

  • Context-aware Piper chat backend for chart and KPI entry points
  • Persistent chat history with create, open, rename, delete, and generated titles
  • Tool-calling agent loop with workspace context supplied by the runtime, not by the model
  • Domain-specific prompt paths for business, channels, creative, website, insights, and email-style analysis
  • Streaming responses through a shared orchestrator
  • Multi-provider model client for Anthropic Claude and OpenAI behind one response shape
  • Ordered provider fallback, budget preflight, usage capture, and audit logging
  • Specialist monitoring agents for spend anomalies, pacing, revenue drivers, and Shopify-style commerce signals
  • Daily per-workspace monitoring with freshness checks, catch-up runs, and delayed retry on provider rate limits
  • Insight feed writes with severity, agent attribution, deduplication, dismissal, and "Ask Piper about this" follow-up paths
  • Workspace-level usage and cost telemetry for chat, monitoring runs, and agent runs

Design decisions

The core design decision was to keep detection deterministic and use the LLM for explanation. Monitoring agents identify signals with rule-based and statistical checks first, then the model turns confirmed findings into concise insight cards. If a provider fails, the product can fall back to rule-based wording instead of losing the alert entirely. Workspace isolation is handled by backend runtime context. The model does not choose a tenant identifier, and tools only receive the workspace passed by the orchestrator. Each agent also runs with a narrow allowlist of tools, so the model cannot wander into unrelated data access. Monitoring refuses to create findings from stale data. If an integration has not synced for the run date, the job is skipped and picked up by a later catch-up pass instead of producing misleading anomalies.

Under the hood

The app is a Next.js and TypeScript product backed by Supabase for auth, Postgres, row-level security, chat history, insights, and run telemetry. Inngest handles scheduled and fan-out work, with one durable monitoring run per workspace. Anthropic Claude and OpenAI are called through a small multi-provider client that normalizes streaming, tool use, fallback, and response parsing for the rest of the application.

Why it matters

This project signals:

  • Building an AI layer for a multi-tenant product, not a single chatbot demo
  • Connecting chart-level dashboard context to backend model orchestration
  • Treating cost, fallback, retries, auditability, and data isolation as first-class backend features
  • Designing monitoring agents where deterministic checks find the signal and the LLM explains it
  • Working as an embedded backend developer inside an agency-led client codebase

Final positioning line

The AI layer of a multi-workspace ecommerce analytics platform: context-aware Piper chat, specialist monitoring agents, and a backend orchestration runtime for OpenAI, Anthropic, tool use, budgets, and audit logs.

Under the hood

Piper combines a conversational front end with a scheduled monitoring backend, both routed through one orchestrator. Supabase stores conversations, insights, and run telemetry under row-level security; Inngest fans out durable monitoring runs per workspace; Anthropic Claude and OpenAI sit behind a shared multi-provider client with fallback, streaming, tool use, budget preflight, and audit logs.

Next.js

App Router application and API routes

TypeScript

Typed backend orchestration and model integration

Supabase

Auth, Postgres, RLS, chat history, insights, and run telemetry

Inngest

Per-workspace scheduled monitoring, retries, and catch-up runs

Anthropic Claude

Primary model path for assistant and monitoring responses

OpenAI

Fallback and alternate model provider behind the same response shape