Split Agent: The Story Behind the Project

About the Project

Split Agent is an intelligent expense-splitting system that uses Artificial Intelligence to process natural language messages and automate group financial management. The project combines natural language processing, a multi-channel architecture, and payment-optimization algorithms to solve a very common everyday problem: splitting expenses fairly and efficiently.


Inspiration

The idea came from a frustrating personal experience. After a group trip, we spent hours trying to figure out who owed how much, who paid for what, and how to balance everything. Excel spreadsheets, messy WhatsApp messages, and the constant feeling that someone was being forgotten or overcharged.

I realized that in Brazil—where PIX has revolutionized instant payments—there still wasn’t a solution that combined:

  • Simplicity: Talking naturally, just like in a chat
  • Intelligence: Understanding context and extracting information automatically
  • Automation: Calculating balances and generating PIX payments automatically
  • Multi-channel support: Working where people already are (Telegram, WhatsApp, Email)

That’s when I decided to build an intelligent agent capable of understanding messages like “I paid 50 reais for lunch” or “I sent 30 to João” and automatically turning them into structured financial transactions.


What I Learned

1. Multi-Provider Architecture

One of the biggest learnings was designing an architecture that is message-provider agnostic. The solution was to create an adapter-based system that converts messages from different sources (Telegram, WhatsApp, Email) into a unified format (IncomingMessage), allowing all business logic to remain centralized in the MessageService.

POST /webhook/telegram  →  Telegram Adapter  →  MessageService
POST /webhook/whatsapp  →  WhatsApp Adapter  →  MessageService
POST /webhook/email     →  Email Adapter     →  MessageService

Built With

  • 4.1)
  • api
  • bot
  • css
  • grok
  • nextauth.js
  • payment
  • pix
  • postgresql)
  • radix
  • recharts
  • supabase
  • system
  • tailwind
  • telegram
  • typescript-node.js-fastify-next.js-react-langchain-openrouter-api-(claude-sonnet-4.5
  • ui
  • zod
Share this project:

Updates