Operator demo

Mention Detection MVP

A consumer-facing AI agent can persist a MentionAlert end to end through the existing /api/mvp/emit-alert route. The backend is wired (cron writes Mention rows, sentiment scores through src/lib/mentions/sentiment.ts, the alert envelope is the contract). This page is the operator-facing surface so a reviewer can walk the wire shape without dropping into prisma studio.

Five-source crawl

What RepSentinel indexes

Every cron tick fans out across these five sources, scores sentiment through src/lib/mentions/sentiment.ts, and writes a per-row Mention.

twitter
Social
X recent-search over each brand keyword via the Twitter search API. Tweet ids dedupe via the source-scoped externalId.
https://api.twitter.com/2/tweets/search/recent?query=<keyword>

Requires TWITTER_BEARER_TOKEN

reddit
Discussions
Reddit public search.json across keyword matches. Cross-subreddit, scored by upvotes − downvotes at ingest time.
https://www.reddit.com/search.json?q=<keyword>&sort=new
news
News wire
NewsAPI everything-search per brand keyword. Requires NEWS_API_KEY; missing keys fail soft and stamp `errored=1` on IngestRun.
https://newsapi.org/v2/everything?q=<keyword>

Requires NEWS_API_KEY

blog
RSS / blogs
Aggregator RSS reader over BLOG_RSS_FEEDS. Iterates every feed and ingests any post whose body or title matches a brand keyword.
rss://<feed-host>/<feed-slug>.xml

Requires BLOG_RSS_FEEDS (comma-separated feed URLs)

google_news
News wire
Google News RSS — surfaces search-aggregator snippets exactly as the MVP brief terms them. Same RSS transport as the blog index.
https://news.google.com/rss/search?q=<keyword>

Operator tip: POST /api/cron/seed-mentions stamps synthetic rows tagged mvp-emit so you can walk this page end to end without waiting on a cron tick.

Cron activity

Recent ingest ticks

Negative / neutral feed

Recent flaggable mentions

Try the wire shape

Emit a test alert

This POSTs to /api/mvp/emit-alert and echoes the envelope downstream AI agents receive. The MVP emit path bypasses plan quota and creates no AI draft — the consumer-facing /api/mentions POST still enforces the free=0/solo=100/brand=2000 caps.

Payload
Edit any field and submit. Validation flows back inline, then the JSON envelope appears on the right.
Downstream envelope
This is the JSON shape the next pipeline stage consumes. Successful emits appear below; idle state is empty.

Submit the form to see the JSON envelope echoed here.

If you’re not signed in, the call returns 401 — close that first.

Live emit envelope

Recent MVP alerts

The 25 freshest MentionAlert rows stamped under the mvp-emit tag. Same data the downstream AI drafting stage can consume next. MVP persists these alerts as ready for downstream drafting; it does not create a draft row or invoke AI during ingestion.