惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

月光博客
月光博客
V
Visual Studio Blog
C
Check Point Blog
Google DeepMind News
Google DeepMind News
S
SegmentFault 最新的问题
博客园 - 聂微东
量子位
T
Tailwind CSS Blog
罗磊的独立博客
I
InfoQ
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Y
Y Combinator Blog
L
LangChain Blog
小众软件
小众软件
Engineering at Meta
Engineering at Meta
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Security Latest
Security Latest
M
MIT News - Artificial intelligence
Know Your Adversary
Know Your Adversary
MongoDB | Blog
MongoDB | Blog
Google DeepMind News
Google DeepMind News
大猫的无限游戏
大猫的无限游戏
H
Help Net Security
爱范儿
爱范儿
T
The Exploit Database - CXSecurity.com
有赞技术团队
有赞技术团队
V
Vulnerabilities – Threatpost
Martin Fowler
Martin Fowler
A
Arctic Wolf
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 司徒正美
Cyberwarzone
Cyberwarzone
阮一峰的网络日志
阮一峰的网络日志
The Hacker News
The Hacker News
Apple Machine Learning Research
Apple Machine Learning Research
宝玉的分享
宝玉的分享
GbyAI
GbyAI
Latest news
Latest news
云风的 BLOG
云风的 BLOG
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
腾讯CDC
AWS News Blog
AWS News Blog
aimingoo的专栏
aimingoo的专栏
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
L
Lohrmann on Cybersecurity
博客园 - Franky
S
Securelist
D
Darknet – Hacking Tools, Hacker News & Cyber Security
T
Threatpost
美团技术团队

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
I Built a 25-Agent Polish Parliament That Drafts Bills With Real Legal Citations
Monika Sadlok · 2026-05-31 · via DEV Community

This is a submission for the Hermes Agent Challenge

TL;DR — Type a one-line bill topic. Twenty-five Hermes agents (1 Speaker, 19 ministries, 5 parties) run a full Polish legislative session in 2 minutes. Vote tally, social impact, party tweets — and a side-by-side "current law vs proposed amendment" with every clause cited to a real statute. Built on delegate_task for parallel ministry consultation.

Virtual Parliament — live chamber view with the four-day work week bill passing 248:212, AI thought process panel, vote tally and ministry analyses

🌐 Live: https://web-production-53027.up.railway.app/
🎥 Walkthrough: https://www.loom.com/share/b0201270f67745baaa2945c931058b8c
📦 Repo: https://github.com/monsad/ai-politics (MIT)


What I Built

Watch a politician debate a new tax law on TV. They argue whether it's fair, whether it'll work, whether the other side is lying. Nobody ever shows you the diffwhich paragraph of which statute actually changes, and from what to what. The conversation is theatre on top of an invisible legal document.

So I built the theatre AND the legal document.

Virtual Parliament is a multi-agent simulation of the Polish Sejm. You type something like "four-day work week" or "flat income tax", and 25 Hermes agents run a full legislative session:

  1. 🎯 Marszałek (Speaker) — the orchestrator. Classifies the topic. Picks 2–3 ministries via delegate_task in parallel. Reads their findings. Routes the bill to a party debate.
  2. 🏛️ 19 ministry experts — Finance, Climate, Labour & Social Policy, Justice, … Each returns a structured analysis: legal finding · budget impact · top 3 risks · recommendation. Every claim cites a real statute via PageIndex RAG.
  3. 🗳️ 5 party agents — CR, NC, AC, Liberty Front, SD. Each one carries the real party's seat count (157, 194, 65, 18, 26 — totalling 460), policy positions and rhetorical style. First reading. Second reading with rebuttals.
  4. 📊 Vote — weighted by seats. >230 passes.
  5. 📜 Draft bill — produced with explicit "Article 129 §1 of the Labour Code **is amended to read…" diffs against current law.

The frontend surfaces the diff as a Current law vs proposed change panel. Left column: what's in force today, quoted from the statute. Right column: what the AI just proposed. A non-lawyer can finally see the actual edit.

This is the part of legislation that's normally invisible. The whole point is to make it visible.


Demo

🎥 Video walkthrough (~2 min): https://www.loom.com/share/b0201270f67745baaa2945c931058b8c

🌐 Live URL: https://web-production-53027.up.railway.app/

Two buttons:

  • ▶ Open session — fresh AI-generated debate, ~2–3 minutes. Costs ~$0.04 in google/gemini-3.1-flash-lite calls.
  • ⚡ Demo — instant replay of a cached transcript, ~25 s. Useful when you just want to see the UI without burning credits.

Try "four-day work week" (Demo) — it's the demo fixture I ship in the Docker image. SD and Liberty Front vote on opposite sides (pro-labour vs free-market), which is the political-coherence check I built into the acceptance tests.

Local one-command run:

git clone https://github.com/monsad/ai-politics && cd ai-politics && make setup && parliament "four-day work week"


Code

📦 Repo: https://github.com/monsad/ai-politics (MIT)

skills/                         # 25 Hermes Agent skills, validated by skills-ref
  marszalek-sejmu/              # the orchestrator — owns the bill-drafting template
  ministry-finansow/            # 19 ministry experts (Finance, Health, Climate, ...)
  ...
  party-cr/                     # 5 party agents (CR, NC, AC, Liberty Front, SD)
parliament/
  session.py                    # subprocess launcher around `hermes chat -s <skill>`
  transcript_parser.py          # splits orchestrator stdout into per-speaker utterances
  citation_validator.py         # every [node:...] must resolve back to a real statute
  api.py                        # FastAPI: POST /sessions, polling SSE /stream/{id}
  cli.py                        # `parliament "<topic>"` (typer)
web/                            # Next.js 16 static export, served by FastAPI
deploy/                         # Dockerfile entrypoint + Hermes config + demo fixture

My Tech Stack

Layer Tech Notes
Agent framework hermes-agent 0.14.0 the load-bearing piece — pip install hermes-agent==0.14.0
Skills spec Anthropic Agent Skills + skills-ref@0.1.5 25 skills, lowercase-hyphen, validated in CI
RAG PageIndex Cloud via MCP vectorless retrieval over Polish Constitution + ~50 statutes; every citation traces to a real document
Models google/gemini-3.1-flash-lite via OpenRouter ~$0.04 per full session, fast enough for live demo
Orchestrator Python 3.11 + FastAPI + uvicorn subprocess launcher around hermes chat
Stream sse-starlette + polling SQLite per-speaker utterances pushed as event: utterance
Frontend Next.js 16 (App Router, static export) + Tailwind served from /app/* by the same FastAPI
Deploy Railway (single Docker container) public HTTPS, ~$5/month

How I Used Hermes Agent

There's one Hermes property the whole project is built on:

delegate_task lets a parent skill fan out to N child skills in parallel as a single tool call.

Without that, this project isn't tractable. With it, the entire 25-agent pipeline is 24 LLM calls in a tight DAG, runs in 2 minutes, and the orchestrator never has to manage thread pools or async gathers itself.

Here's the shape:

                  ┌─────────────────────────────┐
                  │  marszalek-sejmu (skill)    │
                  │  Topic → ministry selection │
                  └──────────────┬──────────────┘
                                 │ delegate_task(tasks=[...])  ← Hermes batch mode
                ┌────────────────┼────────────────┐
                ▼                ▼                ▼
       ┌────────────────┐ ┌────────────────┐ ┌────────────────┐
       │ ministry-      │ │ ministry-      │ │ ministry-      │
       │ finansow       │ │ klimatu        │ │ rodziny-pracy  │
       └────────┬───────┘ └────────┬───────┘ └────────┬───────┘
                │  PageIndex RAG   │   (cite real statutes)
                └────────┬─────────┴─────────┬───────┘
                         ▼                   ▼
                  Synthesized findings → Marszałek
                         │
                         ▼   5 × party debate, ×2 readings
                  ┌──────────────┐
                  │ CR  NC  AC  │
                  │ LF  SD       │
                  └──────┬───────┘
                         ▼
                  Seat-weighted vote → Draft bill

Why delegate_task was the right primitive

  • Ministries are independent. Finance doesn't need to know what Climate said before doing its own analysis. They both run on the same input bill topic, return findings, get merged by the orchestrator. Classic embarrassingly parallel.
  • Hermes already handles the thread pool. Batch mode uses ThreadPoolExecutor to spawn AIAgent children. I don't have to mix asyncio with hermes-agent's threaded subagents — a known foot-gun if you roll your own.
  • Context isolation is free. Each ministry gets its own skill prompt with its own toolsets (pageindex-rag). The Marszałek doesn't pollute their context.
  • Approval and audit are centralized. When PageIndex is called from a ministry, it goes through Hermes' tool registry. I get the audit trail for free.

The other Hermes pieces that mattered

  1. Skills as the unit of expertise. Every agent is one SKILL.md. The Marszałek has the bill-drafting template (assets/bill-draft-template.md). The parties have their actual policy positions. None of this fits in one big system prompt — but as 25 separate skills, it's maintainable. I can rewrite SD's economic stance without touching Liberty Front.

  2. MCP toolsets for retrieval. Every skill that cites Polish law declares toolsets: ["pageindex-rag"] and gets retrieval for free. Zero Python integration code. The PageIndex MCP server is one config-yaml entry.

  3. Subprocess as the integration surface. Hermes is a CLI first. The cleanest way to embed it in FastAPI is subprocess.Popen(["hermes", "chat", "-s", skill, "-q", topic, "-Q", "--accept-hooks", "--yolo"]). My session.py is essentially that subprocess launcher plus a stdout parser that splits the result into per-speaker utterances for SSE streaming.

  4. Bake-time config for the container. For Railway, the Dockerfile copies hermes-config.yaml to /root/.hermes/config.yaml and skills/* to /root/.hermes/skills/. An entrypoint script materializes OPENROUTER_API_KEY into ~/.hermes/.env at boot. Crucially: disabled_toolsets: [browser, computer-use, voice, terminal-modal] — otherwise Hermes hangs at startup looking for a Chromium binary that isn't in python:3.11-slim. I only found that via a /diag endpoint I added to introspect the running container.

What this combination unlocks

If I had to write the parallel fan-out + tool registry + skill loader by hand, I'd still be debugging deadlocks instead of arguing with my own bill drafts.

Hermes let me spend my time on the simulation design (how does a Marszałek pick ministries? what does each party's house style sound like? how do you parse "Article 129 §1 is amended to read…" out of free-form markdown?) and the legal-diff UX (the Current law vs proposed change panel) — not on the orchestration framework.

That's the right division of labour for a 5-day contest project, and frankly for most agent projects.


What surprised me

  • Hermes models matter less than you'd think. Most of the quality comes from the skill prompts. Swapping gemini-flash-litellama-3.3-70b changes vocabulary, barely changes the structure of the debate.
  • The frontend is where civic value lives. The pipeline produces a 40 KB markdown blob. Useless to a non-lawyer. The UI panel showing "Czas pracy nie może przekraczać 8 godzin na dobę i przeciętnie 40 godzin…" on the left and the proposed "…32 godzin w przeciętnie czterodniowym…" on the right is what makes this a tool instead of a transcript.
  • Free OpenRouter tiers are rate-limited into uselessness during contest week. Plan for $5 of paid model credit, or bake a demo fixture into the image. I shipped both.

🇵🇱 Built in Warsaw. MIT-licensed. Educational simulation only — no real Members of Parliament are represented, no hate speech is produced, and a disclaimer is emitted at the top and bottom of every session.