Overview
Five Gemini agents chained in a state machine. Hunts the web, performs scored SWOT, compiles a C-level strategic brief in under a minute.
Project Metrics
- Agents in the chain: 5 + Chat
- Scored dimensions: 5
- Runtime per analysis: ~45s
System Architecture & Implementation
Overview
Sentinel is an autonomous competitive intelligence platform that replaces hours of manual research with a single URL. Type a competitor's name. Walk away. Come back to a scored SWOT, a radar-chart fingerprint, and an executive markdown report.
The unfair advantage is that every subjective strategic dimension becomes a number. Instead of "their pricing is strong," you get pricing_power: 78.
The pain it targets
- Senior analysts losing 20 hours a week to competitive research
- Pricing intel that is always 2 weeks stale
- SWOT decks nobody opens
- Research cycles measured in business days
- Scaling to 10+ rivals without proportional headcount
The 5-agent chain
Each agent is a Vercel Node function. The chain is explicit state-machine code in the client, so a user can watch each step light up in real time.
- Router (Flash). Classifies intent, extracts the target company, drafts three high-signal search queries.
- Hunter (Flash with Google Search grounding). Pulls authoritative sources in real time - official pricing pages, changelogs, press releases. Returns structured
{url, title, snippet} rows.
- Scraper (Flash). Consolidates noise into a dense fact sheet under 4k tokens. Strips marketing fluff, preserves facts, numbers, dates.
- Analyst (Pro). Runs a 360 SWOT. Crucially, it scores five strategic dimensions on a 0 to 100 integer scale:
- Innovation (how cutting edge is their tech)
- Market Share (relative strength or dominance)
- Pricing Power (do they command a premium)
- Brand Reputation (public sentiment)
- Velocity (speed of shipping)
- Reporter (Flash). Compiles a C-level markdown brief with Executive Summary, Market Updates table, and a single bold Strategic Recommendation.
An optional Social agent drafts a viral LinkedIn post from the report. A Chat agent provides context-aware follow-ups with live Google Search grounding on every turn.
Battle Mode
The killer feature. Pick any two saved reports. Sentinel overlays the two radar charts, runs a direct metric-vs-metric "Tale of the Tape", and declares an advantage leader based on the data. No more subjective debates in strategy meetings.
Why the scoring matters
Most CI tools stop at a qualitative SWOT. That gives you bullet points but no way to compare companies over time. Scoring every analysis on the same five axes means:
- You can graph a competitor's trajectory across quarterly runs
- You can compare two competitors on a single axis without reading both reports
- You can alert on threshold crossings (for example, "ping me when any competitor's pricing power drops below 60")
Technical architecture
- Server-side Gemini proxy on Vercel Node Functions. The API key never ships to the browser.
- Supabase Postgres with row-level security on every table. Reports are persisted with a short share hash, so any analysis is one link away.
- Per-IP rate limiting via a Supabase RPC: 20 analyses per hour, 200 chat turns per hour, 30 per-agent per hour.
- Pricing math fixed. The original prototype divided by 1,000 for cost calculation when Gemini prices are per-million-tokens. Token costs were being under-reported by three orders of magnitude.
- Strict TypeScript, ESLint, Prettier, Vitest, and a GitHub Actions CI workflow.
Shipping notes
- Zero Gemini key leakage verified with a production bundle scan
/api/health endpoint confirms the model stack in real time
- Every report has a shareable
/?r=<hash> URL with automatic OG preview
Links