Inspiration
Debt collection is repetitive, but each account has different history, risk, and constraints. We wanted to build an agent that can use that context, decide what action is allowed, and carry out the next step.
What it does
Shark is an autonomous collections operations agent.
It reviews an account, checks its history, decides the next action, and explains why. It can also place a real Vapi phone call to a consenting test number and negotiate within fixed limits.
How we built it
We built Shark with:
- Next.js for the web app.
- Elasticsearch for account state and interaction memory.
- Mastra for the collection workflow and decision logic.
- OpenRouter for model access.
- Vapi for outbound phone calls.
- Vercel for deployment.
The flow is:
Account data → Elasticsearch → Mastra checks rules and decides what to do → Vapi makes the call → outcome is stored for the next decision
Challenges we ran into
The main challenge was making the agent autonomous without giving it unlimited control.
We had to separate:
- what the model can decide,
- what fixed rules must control,
- what account history the agent should remember,
- and what actions must require human review.
We also had to connect account-specific data to the voice agent without hard-coding each call.
Accomplishments that we're proud of
We built a full agent workflow instead of only a chatbot.
Shark can:
- inspect an account,
- use previous account context,
- enforce collection limits,
- decide the next action,
- explain its decision,
- and place a real outbound call.
We are also proud that the agent cannot freely invent payment terms. The system gives it fixed limits for payments, installments, and discounts.
What we learned
We learned that autonomous agents need both memory and strict control.
The model should handle flexible decisions and conversation. Fixed rules should handle hard restrictions such as disputes, do-not-contact requests, and negotiation limits.
We also learned that persistent memory is important because the correct next action depends on what happened before.
What's next for Shark
Next, we want Shark to automatically process the result of each real phone call.
It should extract the outcome, save it to Elasticsearch, and use that new information when it decides the next action.
We also want to add more communication channels, better account prioritization, and human approval for sensitive cases.
Built With
- elasticsearch
- mastra
- vapi
Log in or sign up for Devpost to join the conversation.