How I Built an Autonomous AI Agent That Earns USDC While I Sleep
Описание и применение
Автономный агент, который ежедневно обрабатывает новые вакансии, генерирует краткие резюме с помощью LLM и получает оплату в USDC на L2 Base, работая без вмешательства человека.
Задача
Create a minimal, self‑contained AI agent that can autonomously perform a task, receive payment in USDC on Base L2, and run unattended on a cheap VPS.
Результат
The agent successfully runs unattended on a VPS, summarizing new job postings every 5 minutes and earning approximately $0.02 USDC per summary, demonstrating a viable micro‑payment loop on Base L2.
Рабочий процесс
- Set up a scheduler (cron/APScheduler) to trigger every 5 minutes.
- Implement the agent loop following ReAct: perceive → think → act.
- Perceive: fetch new items from a public RSS feed and parse into a list of job postings.
- Think: prompt OpenAI’s gpt‑3.5‑turbo to produce a one‑sentence summary for each posting.
- Act: send the summary to an x402‑protected HTTP endpoint, attaching a payment receipt.
- Record the earned USDC in a local state store (SQLite) and optionally verify the payment via x402 client.
- Repeat the cycle until no new postings are found or a termination condition is met.
Доказательства
I wanted a minimal, self‑contained agent that could perform a useful task, receive payment in USDC on the Base L2, and run unattended on a cheap VPS.
Base offers low transaction fees (≈ $0.0001 per tx) and fast finality, making micro‑payments feasible.
- Дата записи: 2026-09-15T05:47:07.687Z