We built a system that connects a company's live analytics warehouse directly to a Slack bot — so anyone on the team can ask a plain-English question and get a formatted, source-checked answer back in seconds, on a schedule or on demand.
The bot isn't just forwarding a prompt to an LLM. Each question is routed to the right warehouse, the raw data is aggregated in code before any model ever sees it, and the response is checked against source-of-truth numbers before it reaches Slack.
A team member asks a question in plain English, in-channel or by mention. No query syntax, no dashboard login.
The request is matched to the correct report — Sales, Marketing, Retail, Product, or PO — and the correct backing warehouse.
Raw multi-row report data is summarized in code first — never handed to the model unaggregated — cutting token volume roughly 95% and removing floating-point drift.
Claude interprets the pre-aggregated summary against the actual question, flags anomalies, and drafts the response.
A clean, formatted answer posts to the channel — on request, or on a standing daily/weekly/monthly/quarterly schedule.
Nothing exotic — a small set of well-understood tools, wired together with a routing and aggregation layer that does the actual heavy lifting.
Redshift and PostgreSQL reports as the single source of query logic.
The bot lives where the team already works — no new tool to adopt.
Interprets pre-aggregated data and drafts the natural-language response.
Runs the bot, scheduler, and a native Postgres store for scraped data.
Read-only retail replica treated as ground truth for store-level revenue.
Scrapes third-party marketplace listings into a structured Postgres table.
Tiered digest cadence — daily, weekly, monthly, quarterly — offset by domain.
Version-controlled, reviewed changes before anything reaches production.
Letting an LLM sum raw multi-row rows produces silent floating-point drift at scale. Every report pre-aggregates in JavaScript first — the model only ever reasons over verified totals.
Each new report is validated tab-by-tab against the underlying POS export before it's trusted at scale — canonical field definitions are locked before rollout, not after.
Sequential processing, staged delays, and exponential backoff mean the system degrades gracefully under load instead of failing silently.
The same replica-database pattern that powers today's retail footprint is the pattern for the next one — no rearchitecture required to add a market.