Chasing clients for money is the absolute worst part of freelancing and small business management. It's awkward, it consumes hours of mental energy, and quite frankly, I'd rather be coding than writing "friendly reminders" for the tenth time.
But as a self-taught dev who used to work in a warehouse, I know that if a task is repetitive and rule-based, it can be automated.
So, instead of hiring a virtual assistant, I built a team of AI agents to do the dirty work for me.
๐ ๏ธ The Problem
Before building this tool, my process was a mess. I had a spreadsheet full of invoice dates. Every Monday, I had to:
- Check who hadn't paid.
- Calculate how many days they were overdue.
- Decide the tone of the email (Friendly? Firm? Legal threat?).
- Draft the email manually to avoid sounding like a robot.
- Handle the replies ("I sent it yesterday!" or "Can I pay next week?").
It wasn't just about the time; it was the context switching. Stopping deep work to play debt collector destroys productivity.
๐ The Solution: PayMind
I built PayMind, an autonomous system where three specialized AI agents collaborate to manage the entire payment lifecycle.
I didn't just want a script that blasts generic templates. I needed intelligence. I used Next.js 16 for the dashboard, TypeScript for safety, and Claude Code to orchestrate the agents.
Crucially, I integrated OpenRouter to access 18+ models, meaning I can run the heavy lifting on free models (like Gemini 2.0 Flash) and save the premium compute (Claude Sonnet 4) for complex negotiations.
fracabu
/
Agent-PayMind
PayMind is an AI payment reminder system that autonomously analyzes invoices, generates personalized messages, and handles customer responses using Claude AI agents.
๐ฐ PayMind
AI-Powered Payment Reminder System



๐ฎ๐น Italiano
Panoramica
PayMind รจ un sistema intelligente di gestione automatica dei solleciti di pagamento basato su Agenti AI Claude Code. Utilizza tre agenti specializzati che lavorano in team per analizzare fatture, generare messaggi personalizzati e gestire le risposte dei clienti.
โจ Caratteristiche
Funzionalitร
Descrizione
๐ค 3 Agenti AI Specializzati
Team di agenti che collaborano per gestire l'intero workflow
๐ Analisi Intelligente
Identifica fatture scadute, calcola prioritร e segmenta clienti
๐ง Multi-Canale
Genera messaggi per Email, SMS e WhatsApp
๐ฌ NLP Avanzato
Analizza risposte con intent recognition e sentiment analysis
๐จ Dashboard Moderna
Interfaccia Next.js per visualizzare workflow in tempo reale
๐ Multi-Provider AI
Supporta Anthropic, OpenAI, OpenRouter e Google Gemini
๐๏ธ Database SQLite
Persistenza dati con Prisma ORM
๐ Dark/Light Mode
Toggle tra tema scuro e chiaro
๐ Bilingue
Supporto completo Italiano e Inglese
๐ค Gli Agenti
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโฆโ๏ธ How It Works
The architecture relies on agent specialization. One massive prompt never works as well as three focused ones.
1. The Payment Monitor (The Analyst)
This agent scans the CSV/Database. It identifies overdue invoices, calculates priority scores (based on amount and days overdue), and segments clients. It doesn't write emails; it just serves data.
2. The Reminder Generator (The Copywriter)
This agent takes the data and context. If the client is 3 days late, it drafts a polite nudge. If they are 60 days late, it drafts a formal notice. It adapts to the preferred channel (Email, SMS, WhatsApp).
3. The Response Handler (The Negotiator)
This is the coolest part. When a client replies, this agent analyzes the intent using NLP.
- Client says: "The bank transfer is scheduled for tomorrow."
- Agent detects intent:
PAYMENT_PROMISED - Agent action: Pauses further reminders for 48h.
All of this is visualized in a modern Next.js dashboard with a dark mode (because we're developers, obviously).
๐ My Results
Here is the breakdown of managing 50 active invoices per month manually versus using PayMind.
| Metric | Manual Approach | PayMind Automation |
|---|---|---|
| Time Spent | ~5 hours/month | ~10 minutes/month |
| Context Switching | High (Daily interruptions) | Zero (Batch processing) |
| Tone Consistency | Variable (Depends on my mood) | Perfect (Always professional) |
| Cost | My hourly rate x 5 | ~$0.10 (API Costs) or FREE |
| Stress Level | High | Non-existent |
๐ก Pro Tips
If you fork this repo to build your own agent system, keep these in mind:
Model Routing is Key: You don't need GPT-4 or Claude 3.5 Sonnet to parse a CSV date. I configured PayMind to use Gemini 2.0 Flash (Free) via OpenRouter for the analysis phase. Only use the expensive models for generating the actual human-like text. This cuts costs by 90%.
Human-in-the-Loop: Always start with a "Draft Mode." PayMind generates the emails but waits for a final approval click on the dashboard before sending. AI is great, but you don't want it hallucinating a legal threat to your best client because of a CSV typo.
Conclusion
I didn't go to a bootcamp to learn this. I used curiosity and AI assistants to build an AI assistant. It's meta, but it works.
Automating the boring stuff is the best way to free up time to learn more cool stuff. Check out the code, star the repo, and stop chasing invoices manually.
๐ค Francesco Capurso (@fracabu)
Self-taught dev | AI agents & Fastify plugins
โญ Found this useful? Star the repo!
Top comments (0)