← AI Agents & Automation

Hermes Kwatery

An agent that finds flats for workers and does the margin maths.

Problem

The client houses temporary workers and goes through listings by hand every day. He rejected the first version with: “I use OLX myself daily, I don't need AI for that.” He was not buying a search engine. He was buying that chore out of his day.

Solution

A panel where a question in plain language and five sliders (site, headcount, rate per person, occupancy, maximum commute) produce a costed set of flats with its margin. Beside it runs a visible stream of the agent's work: which portals, how many listings, how many duplicates. The report exports with clickable links.

What it does

  • A question in plain language plus five sliders: site, headcount, rate, occupancy, commute
  • Live recalculation, no page reload
  • A visible stream of the agent's work: portals, listing counts, duplicates
  • Cross-portal deduplication and a check that each listing is still alive
  • Ranking with margin, and a report export with clickable links
  • A hard capacity rule: rooms times three, never floor area

How it's built

  • Python 3.12 on the standard library alone, no pip install
  • SQLite in WAL mode, BEGIN IMMEDIATE transactions on write
  • HTTP server and an SSE event stream in one demo_server.py
  • Five collectors: Otodom, Gratka, Morizon, Domiporta, nieruchomosci-online
  • Otodom read straight from its __NEXT_DATA__ block: no browser, no Playwright
  • Front end in plain HTML, CSS and JavaScript: no framework, no build step
  • Business rules in analytics.py, kept apart from data collection

How it looks

What it changed

  • Three hours a day of going through listings by hand became one run that takes 5 minutes
  • The client has been using it for two weeks (as of 10 August 2026)
  • Five portals in one run: 97 listings in the database, duplicates counted once rather than five times
  • 97 of 97 links alive on verification (28 July 2026). A dead listing never reaches the offer, so nobody rings a number that is already gone
  • A run on real data: 20 workers, 45 listings, a set covering 21 beds, 9,320 PLN monthly margin, worked out by the panel rather than by hand
  • 846 comparisons of the panel's maths, zero differences; 60 concurrent recalculations without error
  • Hostile tests 10 of 10, including a rejected prompt injection

Stack

  • Python 3.12
  • SQLite (WAL)
  • SSE
  • vanilla JS
  • zero third-party dependencies

Story

The whole backend runs on Python's standard library, no pip install. The decisive find came late: Otodom is a Next.js app, so a full page of data arrives as one JSON blob in the source. Thirty-seven listings from a single request, no browser. Collection dropped from minutes to seconds and the entire browser-automation layer became unnecessary.