Audience: Prosumers, freelancers, e-commerce sellers, personal finance trackers
The problem
Checking prices on a schedule sounds simple until you try to maintain it: cron jobs fail silently, LLM-based "check this URL" agents burn tokens on every run, and nothing persists the history you need for trend analysis.
AINL price monitor
The examples/scraper/basic_scraper.ainl and examples/price_monitor.ainl patterns combine to give you:
# Hourly product price scraper + DB persistence
S core cron "0 * * * *"
Sc products "https://example.com/products" title=.product-title price=.product-price
L_scrape:
R http.GET "https://example.com/products" ->resp
R postgres.query "INSERT INTO prices (title, price, ts) VALUES (%s, %s, NOW())" [resp.title, resp.price] ->_
J "stored"
For financial symbols with parallel fan-out and bounded retries, price_monitor.ainl shows the full pattern using ptc_parallel.ainl and recovery_loop.ainl — compile once, emit Prisma schema for the DB layer:
ainl-validate examples/price_monitor.ainl --strict --emit prisma > schema.prisma
What you get
- Zero orchestration tokens — the decision to check prices is compiled into the graph, not re-reasoned by an LLM
- Automatic DB persistence via the Postgres adapter
- Retry logic via the
recovery_loopmodule — no custom exception handling - JSONL trace for every run — know exactly what was checked and when
- Alerting — add
R queue Put "notify" alert_msgto any branch and route to Telegram/email via your queue adapter
Try it
pip install ainativelang
git clone https://github.com/sbhooley/ainativelang.git
ainl check examples/scraper/basic_scraper.ainl --strict
ainl run examples/scraper/basic_scraper.ainl
See also: Building Full-Stack Apps with AINL for emitting Prisma + FastAPI from the same graph.
