Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
194 changes: 194 additions & 0 deletions LOOP_SPEC.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
# Shoploop — LOOP_SPEC v2

_Last updated: 2026-07-24 · Status: drafted, not scheduled_

## The Product = The Reverse-Feedback Content Loop

```
Customer connects (Nango) → PostHog reads impact → Creative Mutation generates variants
→ 3D Render Batch produces MP4/PNG/USDZ → Ads Auto-Publish (Postiz) & Website Update PR
→ PostHog reads impact → posterior compounds nightly
```

Product is the loop. Reference sites (shoploop.studio, ashwagandha.shoploop.studio, studio.shoploop.studio) are customer #0-3.

## The 10 Loops

Each loop is defined against the 9-primitive framework: Target · Fitness · Search Space · Stopping · Mutation · Memory · Ground Truth · Boundary · Decay.

---

### Loop 1 — Connector Ingest
- **Runs:** every 15 min
- **Job:** Nango pulls fresh data from customer's Google Ads + Shopify + PostHog + Meta + Klaviyo + GitHub into their own Postgres partition
- **Target:** 100% connector uptime, <5min data freshness lag by 2026-09-30
- **Fitness:** rows-synced-per-15min / expected-rows; alert if <95%
- **Search Space:** connectors enabled at customer onboarding
- **Stopping:** none (continuous)
- **Mutation:** on API error, backoff + retry per Nango retry policy
- **Memory:** last-cursor per connector in Postgres
- **Ground Truth:** connector's own API response
- **Boundary:** OAuth expiration triggers customer email, does not auto-refresh
- **Decay:** cursor state resets on connector reconnect

### Loop 2 — PostHog Reverse-Feedback Analyst
- **Runs:** every 4 h
- **Job:** join ad clicks × sessions × ATC × checkout × PDP dwell. Surface top 3 opportunities: low-CVR-high-CTR, high-search-no-match, high-ATC-abandoned-checkout
- **Target:** 1 actionable opportunity per cycle for every customer
- **Fitness:** opportunities-acted-on / opportunities-surfaced ≥ 40% (measured weekly)
- **Search Space:** last 7 days of PostHog + ad platform data
- **Stopping:** none
- **Mutation:** SQL query templates iterate based on which surfaced opportunities converted to Loop 3 wins
- **Memory:** rolling 30-day opportunity log per customer
- **Ground Truth:** PostHog events + ad platform CVR
- **Boundary:** opportunities require Loop 3 to accept; not auto-executed
- **Decay:** opportunities expire in 72h if not picked up

### Loop 3 — Creative Mutation Kernel (Thompson Sampling)
- **Runs:** every 6 h
- **Job:** pick 6 candidate variants per active opportunity across (3D angle × molecule × material × copy × language). Thompson Sampling on Beta posterior over CVR
- **Target:** variance in top-5 candidates < 0.05 for 3 consecutive cycles = converged
- **Fitness:** posterior mean CVR uplift vs baseline; weighted by trilingual coverage
- **Search Space:** all molecules in customer's PIM × all Studio templates × hi/en/mr
- **Stopping:** convergence (3 cycles < 0.05 variance) OR 30 iterations
- **Mutation:** top 20% arms survive, bottom 80% replaced with mutations along dimensions correlated with win in surviving arms
- **Memory:** Beta(α, β) per arm in Postgres, versioned in git
- **Ground Truth:** Loop 2 measured CVR after publish
- **Boundary:** candidates must pass Language QA (Loop 7) before Loop 4 renders
- **Decay:** posteriors halved every 30 days (freshness bias)

### Loop 4 — 3D Render Batch
- **Runs:** every 6 h (after Loop 3 releases winning candidates)
- **Job:** Blender + MolecularNodes + NVIDIA Omniverse + usd-content-agents produces MP4/PNG/USDZ per candidate. Validation Agent quality-gates
- **Target:** ≥95% render success, ≤$0.02/frame, PBR fidelity score ≥0.85
- **Fitness:** (success_rate × 0.4) + (1/cost_per_frame × 0.3) + (pbr_score × 0.3)
- **Search Space:** Blender cycles + Omniverse Kit + USD asset library
- **Stopping:** batch complete OR AWS spot pool preempted
- **Mutation:** on Validation Agent rejection, retry with adjusted material/lighting
- **Memory:** render cache keyed on (asset_hash + material_hash + camera_hash)
- **Ground Truth:** Validation Agent + spot-check by human weekly
- **Boundary:** cost cap $50/day per customer; hard-stop
- **Decay:** cached renders expire in 90 days

### Loop 5 — Ads Auto-Publish (Postiz)
- **Runs:** every 6 h (after Loop 4)
- **Job:** winning ad variants push to Meta + Google Ads + YouTube Shorts via Postiz + Nango
- **Target:** zero manual ad uploads for enrolled customers by 2026-08-31
- **Fitness:** ads-published / ads-approved-by-Loop-3 = 100%
- **Search Space:** customer's active ad accounts via Nango
- **Stopping:** weekly $ cap set by customer reached
- **Mutation:** budget allocation shifts toward highest-CVR variants (Loop 3 posterior)
- **Memory:** publish log per customer per platform
- **Ground Truth:** platform confirmations (Ads API responses)
- **Boundary:** hard $ cap per week per customer; customer sets in onboarding
- **Decay:** paused ads deleted after 30 days idle

### Loop 6 — Website Update PR / API Push
- **Runs:** daily 3am PT
- **Job:** for website changes (new hero, updated PDP 3D asset, copy tweaks, molecule swaps), open PR against customer's GitHub repo OR push to Shopify admin API. Adapter chosen at onboarding
- **Target:** website changes go live within 24h of Loop 3 approval
- **Fitness:** median-time-from-approval-to-live < 24h
- **Search Space:** all pages tagged for auto-update in customer config
- **Stopping:** customer approval required on GitHub PR path; auto on Shopify API path with rollback watch
- **Mutation:** on PR rejection, learn from customer's commit diff (feed back to Loop 3)
- **Memory:** PR history + Shopify version log per customer
- **Ground Truth:** post-deploy PostHog session recording sample
- **Boundary:** irreversible destructive changes (delete page, remove SKU) always require PR + human approve, never auto-API
- **Decay:** PR auto-closes after 7 days no activity, re-opens with fresh context

### Loop 7 — Language QA (hi/en/mr)
- **Runs:** daily 9am PT
- **Job:** VLM samples all new hi/en/mr copy across all customer sites + ad creative. Not just translation accuracy — cultural correctness (Ayurvedic terminology, dosha references, respectful register)
- **Target:** zero cultural mistranslations by 2026-08-31
- **Fitness:** flagged-strings / total-strings-sampled ≤ 1%
- **Search Space:** all copy shipped in last 24h across Studio + Postiz + Website + Ads
- **Stopping:** batch complete
- **Mutation:** on flag, propose alternative + surface in Loop 10 digest
- **Memory:** flag log per customer, feeds Loop 3 with rejected copy patterns
- **Ground Truth:** monthly native-speaker review (Mumbai + Pune Marathi + Delhi Hindi)
- **Boundary:** blocking gate before Loop 5 + Loop 6 publish
- **Decay:** approved strings re-validated every 90 days

### Loop 8 — Platform Health (Nango + Embed + Renders)
- **Runs:** hourly
- **Job:** pings every customer's Nango OAuth + embed instance + render pipeline. Alerts on breakage. Weekly regression tests against top 20 Shopify + top 10 WooCommerce themes for embed compatibility
- **Target:** 99.9% embed uptime, MTTR < 30min, zero silent connector failures
- **Fitness:** (uptime × 0.5) + (1/MTTR × 0.3) + (regression_pass_rate × 0.2)
- **Search Space:** all live customer instances + top 30 host themes
- **Stopping:** none (continuous)
- **Mutation:** on regression failure, auto-file fix PR to packages/embed
- **Memory:** incident log per customer, theme compatibility matrix
- **Ground Truth:** synthetic monitoring + customer support tickets
- **Boundary:** customer-facing status page auto-updates; no auto-disable of customer instances
- **Decay:** incident log archived after 90 days

### Loop 9 — Competitive Radar
- **Runs:** weekly Mon 8am PT
- **Job:** watches Vagon.io + Innoactive + grip.tools + Threekit + Emperia releases + LinkedIn + pricing. Also upstream: MolecularNodes + Postiz + Nango + NVIDIA usd-content-agents commits + Pimcore
- **Target:** 1 actionable insight/wk in founder digest
- **Fitness:** insights-acted-on / insights-surfaced ≥ 25%
- **Search Space:** competitor sites + GitHub RSS + LinkedIn
- **Stopping:** weekly cycle
- **Mutation:** query patterns refined based on which insights led to founder action
- **Memory:** 90-day competitive timeline
- **Ground Truth:** competitor's own announcements
- **Boundary:** insights land in digest, no auto-action
- **Decay:** insights expire from active-set after 30 days

### Loop 10 — Founder Digest
- **Runs:** daily 5pm PT
- **Job:** roll up loops 1-9 into one WhatsApp/email. <60s read. ≤3 actions requiring founder judgment
- **Target:** founder acts on ≥2 of 3 daily actions
- **Fitness:** actions-completed / actions-suggested ≥ 66%
- **Search Space:** last 24h across all loops for all customers
- **Stopping:** daily cycle
- **Mutation:** digest template iterates based on which sections founder engages with (measured via email opens + reply patterns)
- **Memory:** 30-day digest archive
- **Ground Truth:** founder reply / action taken
- **Boundary:** digest never auto-executes anything
- **Decay:** unactioned items escalate after 3 days

---

## PostHog reverse-feedback wiring

Every UTM includes `shoploop_creative_id={loop3_arm_id}` and `shoploop_lot_id={ledger_lot_id}`.
Every configurator + trace event: `posthog.capture('shoploop.engage', {creative_id, lot_id, action})`.
Loop 2 joins creative_id → engage → purchase for real CVR (not vanity CTR).
Loop 3 uses PostHog session recordings (VLM samples 5/cycle for genuine vs rage-click).

## Scheduling policy

- Loops 1, 8 always-on (platform reliability)
- Loops 2, 3, 4, 5 gated by "customer has enrolled + Nango connected"
- Loop 6 gated by "customer chose GitHub or Shopify adapter"
- Loop 7 gated by "customer has trilingual enabled" (default: yes)
- Loops 9, 10 always-on (founder-facing)

## Cost envelope

At 5 enrolled customers:
- Loops 1, 8: ~$30/mo (always-on)
- Loops 2-7 (5 customers × cycles/day × credits): ~$180/mo
- Loops 9, 10: ~$20/mo
- **Total loop credits: ~$230/mo**

At 50 customers: ~$1500/mo. Priced into $299/mo × 50 = $14,950 gross.

## Boundary conditions (human gates)

- Loop 3 candidates → Loop 4 render (auto after Loop 7 pass)
- Loop 4 renders → Loop 5 publish (auto within $ cap)
- Loop 4 renders → Loop 6 website (PR path: human approve; API path: auto within safe-change whitelist)
- Loop 9 insights → founder judgment (never auto)
- Loop 10 digest actions → founder judgment (never auto)

## Not in this spec (deferred)

- Supply-chain ledger sync (Loop-11 candidate; needs first customer with real supply data)
- ICP discovery / lead sourcing (Loop-12 candidate; not urgent pre-first-customer)
- AR/mobile capture ingestion (Loop-13 candidate; needs mobile app v1)

## Review cadence

This spec re-reviewed on the 1st of each month via git blame + Loop 10 digest tag.
110 changes: 110 additions & 0 deletions POSITIONING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
# Shoploop — Positioning

_Last updated: 2026-07-24 · Branch: jared/tabletop-pharma-pivot_

## One line

**Full-funnel positionless AI marketing for tabletop pharma products — Ayurveda-first.**

## What "tabletop pharma" means

Countertop/shelf-visible SKUs a consumer can grip, rotate, and inspect in 3D:

- **Ayurvedic supplements** — Chyawanprash, ashwagandha, brahmi, triphala, tulsi, chyawanprash-adjacent jars/tubes
- **Nutraceuticals** — vitamins, minerals, protein powders, adaptogens
- **OTC wellness** — cough syrups, digestive aids, immunity boosters, topical balms
- **Traditional systems** — Ayurveda, TCM, homeopathy, Unani
- **Not**: injectables, medical devices, prescription-only, cold-chain biologics

## What "positionless full-funnel" means

One agent, one loop, one graph — from ad impression to purchase to reorder — with no human "position" (media buyer, designer, copywriter, dev) required in the middle.

The customer connects their stack once. The agent then:

1. Reads their ad performance (Google Ads, Meta, Klaviyo)
2. Reads their site engagement (PostHog sessions, session recordings)
3. Reads their commerce (Shopify orders, ATC, checkout drop-off)
4. Mutates creatives (3D angle × molecule × material × copy × language)
5. Renders (Blender + MolecularNodes + NVIDIA Omniverse + USD)
6. Publishes ads (Postiz to Meta/Google/YouTube)
7. Updates the website (GitHub PR or Shopify admin API)
8. Measures impact
9. Compounds the posterior nightly

## Why Ayurveda first

- **Molecular-native storytelling.** Every Ayurvedic herb has characterized active compounds with published PDB structures (curcumin 3IPU, withaferin A 4EY7, piperine 1WCQ, bacoside A, gymnema...). No competitor shows the actual molecule in the ad. Shoploop does. MolecularNodes → OpenUSD → Omniverse composited onto the product bottle. Category-defining visual.
- **Trilingual native.** Indian pharma requires hi/en/mr day one. Every UI, every ad, every PDP, every trace page. Postiz LLM translation + our language-QA loop guarantees cultural correctness, not just literal translation.
- **Regulatory forcing function.** AYUSH + FSSAI + upcoming EU DPP (Digital Product Passport 2027) all require provenance, batch traceability, and disclosure. Shoploop's supply-chain layer (Merkle-anchored via OpenTimestamps) becomes the default rails.
- **Market gap.** $18B Indian Ayurveda market, growing 15% CAGR, near-zero 3D commerce adoption. Kapiva, Baidyanath, Himalaya, Dabur, Sandu — none ship 3D configurators or molecular ad creative today.
- **Grip.tools serves LVMH.** No one serves this vertical. That's the wedge.

## Positioning versus alternatives

| Alternative | What it does | Where it stops |
|---|---|---|
| **grip.tools** | 3D commerce for luxury (LVMH, L'Oréal) | $500k/yr enterprise, agency-installed, not self-serve, no pharma vertical, no molecular layer |
| **Vagon.io / Innoactive** | Remote 3D streaming | Renders on their servers, no domain expertise, no ad-ops integration |
| **Threekit / Emperia** | 3D product configurators | Configurator only, no ad-ops loop, no trilingual, no molecular |
| **Postiz (upstream)** | Social scheduler | Scheduler only, no rendering, no PostHog feedback, no rendering pipeline |
| **Uplane** | Automated ad buying | Ad-ops only, no creative rendering, no website updates |
| **Optimove** | Post-acquisition CRM | Lifecycle only, no top-of-funnel creative |
| **Shoploop** | The full loop, agent-run, AGPL-3.0, pharma-first, trilingual | — |

## Pricing

- **OSS** — $0 forever, self-host, AGPL-3.0
- **Trial** — $0 for 30 days, managed hosting, no card
- **Managed** — $299/mo, hosted embed CDN + Nango + Studio + Postiz + 10 loops running on customer data

No enterprise tier at v0. Enterprise = OSS + implementation consulting engagement.

## Languages day-one

- **Hindi** (हिन्दी) — Devanagari, Noto Serif Devanagari
- **English** — IBM Plex Serif
- **Marathi** (मराठी) — Devanagari, Noto Serif Devanagari

All UI, all copy, all embed prompts, all Studio, all Postiz.

## The moat (one sentence)

**Vagon.io + grip.tools + Postiz + PostHog + Google Ads feedback + NVIDIA Omniverse + Blender with materials — Hindi/Marathi/English support — targeting Ayurvedic tabletop category.**

The composition IS the moat. The vertical IS the wedge. No competitor sits at the intersection of even 3 of these 9 components. We compose all 9 and target ONE vertical.

## Nine components, one composition

| Component | What it contributes | Who else has it in this stack |
|---|---|---|
| **Vagon.io-class remote 3D streaming** | Browser-native, no-install 3D interaction. Runs Blender/Omniverse in the cloud, streams frames | Vagon has streaming, no pharma vertical, no ad-ops. Fillable via Vagon SDK or self-host on AWS g5.xlarge spot pool |
| **grip.tools-class 3D commerce** | Product configurator, PBR fidelity, embed-on-any-site | grip.tools closed, $500k/yr. We ship OSS embed under AGPL-3.0 |
| **Postiz** | Multi-channel scheduling (Meta/Google/YouTube/LinkedIn), 14 langs already, AGPL fork-able | Buffer/Hootsuite closed; Mixpost no Indic. We fork + add hi/mr locales |
| **PostHog** | Session recordings, funnel, feature flags, self-hostable | Google Analytics is drift-only; Mixpanel closed. PostHog is our truth layer |
| **Google Ads feedback loop** | Real CVR data closes the mutation loop | Every ad-tech tool reads it; nobody feeds it back into 3D rendering. We do |
| **NVIDIA Omniverse + Kit + usd-content-agents** | USD composition, Material/Physics/Validation Agents, Kit apps | Enterprise-only awareness. We wrap it in a $299/mo product |
| **Blender + PBR materials + MolecularNodes** | Open-source render farm, material accuracy, molecular hero renders | Standard 3D tool. Nobody in pharma uses it for ads |
| **hi/en/mr Devanagari day-one** | Regulatory + market fit for Indian pharma | International tools translate literally; none ship cultural QA. Loop 7 does |
| **Ayurvedic tabletop vertical** | Molecular storytelling + AYUSH-compatible + EU DPP-ready | No 3D commerce platform is pharma-vertical. We are |

**No competitor assembles even 3 of these 9. We assemble all 9 for one vertical.**

## Three moats (supporting the composition)

### 1. Regulatory + Molecular Provenance
Every rendered ad, configurator asset, and SKU is provenance-signed to a PDB ID, a batch ID, a farm GPS coordinate, an HPLC lab report URI, and an OpenTimestamps hash on Bitcoin. No pharma competitor ships this. When EU DPP hits 2027, we're the default rails.

### 2. Bidirectional 3D authoring
Every competitor authors on desktop and consumes on mobile. Shoploop authors on mobile and desktop, consumes on mobile and desktop. Native iOS/Android app with ARKit/ARCore + MediaPipe finger tracking captures the harvest on-site, publishes to trace page in minutes.

### 3. The Agent Layer
The 10 loops running on the customer's own data via Nango. We don't sell software. We sell a 24/7 marketing employee whose weights compound on their data. Weights live in the customer's own repo (AGPL). No closed-source competitor can match this.

## Design partner boundary

An Ayurvedic pharma operator (introduced through personal relationship, floated $10k/$20k/$100k investment) is currently evaluating Shoploop. **Their brand name never appears in code, docs, reference sites, or any customer-facing surface.** The brand-neutral Ayurveda demo (ashwagandha.shoploop.studio) is Shoploop's own reference implementation, built on generic molecules and a fictional SKU. This boundary is enforced by system prompt.

## Anti-scope-drift rule

One new stack component per session, max. If a session generates more than one new framework/service/product surface, stop, list 3 goals, converge. Offense is one thing landed, not ten things planned.
Loading
Loading