← All projects

Case study / 2026

Commerce Competitive Intelligence

A reproducible portfolio system combining Python data contracts, retailer parsing, deterministic business rules, evidence-linked LLM recommendations, and manually triggered n8n delivery to optional Google Sheets and Gmail adapters.

View source on GitHub ↗

The story

Suppose I run an online store.

I would want to know how much competitors charge for the same products, whether they suddenly changed prices or ran out of stock, and what customers have been saying lately.

01Open competitor sites

Visit one retailer after another to find the same products.

02Check what changed

Compare prices, stock availability, and recent customer reviews.

03Figure out what matters

Organize the findings, spot unusual changes, and decide what deserves attention.

The information is found. But tomorrow, I have to do it all again.

So I asked a different question.

What if the system could do the searching, comparing, and checking for me?

01CollectPages · Reviews
→
02UnderstandParse · Normalize
→
03DetectRules · Events
→
04ExplainEvidence · AI
→
05DeliverActionable alert

The result

I no longer have to search everywhere to find out what happened. The things worth noticing come to me.

See the actual notification email →

System architecture

Rules first. AI within a controlled boundary.

The quick view makes the core path immediately readable; the full diagrams remain visible for deeper inspection.

SOURCEFixturesPages · Reviews
→
PIPELINESTG · ODS · TGTParse · Normalize
→
INTELLIGENCERules + AIEvents · Suggestions
→
DELIVERYValidated bundleSheets · Email
DEFAULT MODEFixture replay · Mock LLM · Dry run · Zero credentials
Detailed architecture

Full system architecture

View full size ↗
Detailed system architecture for Commerce Competitive Intelligence
n8n workflow

Manual orchestration and guarded delivery

View full size ↗
n8n workflow for Commerce Competitive Intelligence

The parent workflow validates every bundle before optional delivery. Dry-run and duplicate-SEQN guards prevent accidental writes.

Overview

A portfolio demo built like an auditable system.

A reproducible portfolio system combining Python data contracts, retailer parsing, deterministic business rules, evidence-linked LLM recommendations, and manually triggered n8n delivery to optional Google Sheets and Gmail adapters.

Problem

Problem

Commerce teams often compare prices across retailers, check stock, read reviews, and assemble recommendations by hand. The work is repetitive, difficult to audit, and easy to disconnect from its evidence.

Goals

Goals

Build a reproducible intelligence pipeline that turns product pages and reviews into validated datasets, deterministic business events, evidence-linked AI recommendations, and optional delivery through Google Sheets and Gmail.

Key Engineering Decisions

Key Engineering Decisions

Business rules establish price and stock facts before the LLM writes recommendations. Fetchers, parsers, LLM providers, Sheets, and Email are replaceable adapters. The default demo remains offline, credential-free, deterministic, and safe to rerun.

Automation Workflow

Automation Workflow

A manual n8n parent workflow selects demo options, runs and validates the Python pipeline, then applies dry-run and credential gates before optional Sheets or Gmail delivery. Processing and Sheets delivery are isolated as focused sub-workflows.

Data Contracts

Data Contracts

Every run produces six schema-checked datasets: STG, ODS, TGT, Comment, Overall Trend, and Recent Suggestion. A shared SEQN links the outputs while rejected-row and evidence artifacts keep transformations traceable.

Quality & Security

Quality & Security

CI verifies formatting, types, tests, coverage, dependency audit, secret scanning, and the offline end-to-end demo. Credentials, cookies, live captures, and local output are excluded from the repository.

Demo Scope

Demo Scope

This reproducible offline demo presents the complete data-processing and automation workflow with sanitized fixtures, a mock LLM, and dry-run defaults. Google Sheets and Gmail are optional integrations that can be enabled with the required credentials.