DOGEPLOT
A US Congress bill tracker with an AI "Policy Lens of Truth" — ask in plain English and get an answer grounded in the real bills, every claim citing the bill it came from. 17,000+ bills, auto-synced daily.
The problem
Congressional bills are long, dense, and slow to make sense of. Keyword search misses anything phrased differently, and there's no fast way to track a bill from Introduced to Law, understand what it actually does, or find related bills by meaning — grounded in the real text rather than an AI's guess.
What I built
- Grounded RAG, not a chatbot that guesses — pgvector semantic search retrieves the most relevant bills and feeds them to an LLM that answers in plain English and cites every bill it used. The vector query stays index-friendly (ORDER BY embedding <=> q) so search stays fast as the corpus grows.
- Every one of 17,000+ bills gets its own page, SEO-rendered at the Cloudflare edge via HTMLRewriter — a per-bill title/meta, JSON-LD (schema.org Legislation) and a paginated sitemap — so a Google search for a bill lands straight on it.
- Hardened the data layer: Postgres RLS deny-by-default, closed an exec_sql arbitrary-SQL path that an anonymous key could have used to take over the database, and locked down the embeddings table.
- Built so it can't be botted into a big bill — the LLM key lives in a private edge "ask-worker" behind per-IP rate limits and a hard daily AI-spend cap, with an SSRF-hardened proxy for outbound fetches.
- Zero-server data pipeline: a GitHub Actions cron auto-syncs new bills daily (sync → extract → embed → analyze), so the corpus stays current with no box to babysit.
A look inside



The result
Live at dogeplot.com (v2.1.0) — 17,000+ US congressional bills with plain-English cited answers, per-bill SEO pages and a daily auto-sync, all on Supabase + Cloudflare Workers at the edge. A Swiss edition is planned next — the same tool for Swiss federal bills (parlament.ch + Fedlex, in DE/FR/IT/EN) — extending it into a two-country legislative-transparency mission.
Built with