Inspiration

Credit card fraud is a growing problem, and many fraud detection systems rely on static alerts that users might miss. We wanted to build an AI-powered system that not only detects suspicious transactions in real time but also actively engages users through an AI voice agent to take immediate action. What it does

COFA (CUNY One Fraud Agent) monitors credit card transactions using a machine learning model in FastAPI to detect fraudulent activity.

If a transaction is legitimate, it is added to the Supabase database, updating the frontend in real time. If a transaction is flagged as suspicious, it is added with a flag and triggers a Retell AI voice agent to call the user. The agent informs the user about suspicious transactions, retrieves details from the database upon request, and allows the user to:

  • Confirm transactions as legitimate (removing the flag).
  • Report fraud and freeze the card (updating the frontend in real time).
  • Request to speak with a live representative, triggering a call to our team.

How we built it

  • Backend: FastAPI handles transactions and fraud detection using an XGBoost-based machine learning model built entirely from scratch with our own synthetic data, inspired by the C1 dataset and hosted on Render
  • Database: Supabase for real-time data storage and updates.
  • Frontend: Built with Next.js/React.js to display transactions and fraud status dynamically.
  • AI Voice Agent: Retell AI for handling user calls, retrieving transaction data, and processing user responses.
  • Real-time updates: Integrated WebSockets for instant status updates on the frontend.

Challenges we ran into

  • Fine-tuning the fraud detection model to balance accuracy and false positives.
  • Integrating Retell AI with dynamic Supabase queries for real-time conversation updates.
  • Ensuring smooth WebSocket communication between the backend and frontend.
  • Handling edge cases where users request live representatives.

Accomplishments that we're proud of

  • Successfully built an end-to-end fraud detection and response system.
  • Implemented a seamless AI voice interaction that feels natural and responsive.
  • Achieved real-time updates across the entire stack for a smooth user experience.
  • Built a scalable and extensible system that could be expanded for real-world use.

What we learned

  • How to integrate AI voice agents into real-time applications.
  • Optimizing machine learning models for financial fraud detection.
  • Enhancing backend/frontend synchronization with WebSockets and Supabase.
  • Handling user interactions efficiently through AI-driven calls.

What's next for CUNY One Fraud Agent (COFA)

  • Improving the fraud detection model with more advanced anomaly detection techniques.
  • Adding multi-language support for the AI agent.
  • Expanding the AI’s conversational capabilities to handle more complex user queries.
  • Partnering with financial institutions to test COFA in real-world scenarios.

Built With

  • fastapi
  • next
  • react
  • retell
  • supabase
+ 1 more
Share this project:

Updates