Inspiration
Financial fraud is a growing threat that costs businesses billions annually. Traditional fraud detection systems are often reactive, slow, and unable to adapt to new attack patterns. We were inspired to create a proactive, AI-powered solution that could detect fraud in real-time while learning from new patterns. The TiDB Hackathon provided the perfect opportunity to build something revolutionary - combining TiDB's distributed SQL capabilities with cutting-edge AI to create an enterprise-grade fraud detection platform that could scale globally and adapt intelligently.
What it does
AgentLedger AI is a comprehensive fraud detection platform that: Real-time Analysis: Processes transactions instantly using TiDB Serverless for lightning-fast queries AI-Powered Detection: Leverages Google Gemini AI for intelligent pattern recognition and risk assessment Vector Search: Implements semantic similarity search to identify related fraudulent patterns Community Intelligence: Shares anonymized threat intelligence across organizations Performance Monitoring: Provides real-time insights into system performance and fraud trends Automated Alerts: Sends intelligent notifications with actionable recommendations The platform transforms raw transaction data into actionable insights, helping organizations stop fraud before it causes damage.
How we built it
Frontend Architecture Next.js 14 with App Router for modern React development Tailwind CSS with custom glassmorphism design for a professional UI Shadcn/ui components for consistent, accessible design Recharts for real-time data visualization
Backend Infrastructure TiDB Serverless as the primary database for scalable data storage Prisma ORM for type-safe database operations Next.js API Routes for serverless backend functionality NextAuth.js for secure authentication
AI & ML Integration Google Gemini AI for intelligent fraud analysis and risk assessment Vector Embeddings for semantic similarity search Custom ML Pipeline for pattern recognition and anomaly detection
Challenges we ran into
1. Database Migration Complexity Challenge: Migrating from SQLite to TiDB Serverless while maintaining data integrity Solution: Implemented gradual migration strategy with fallback mechanisms 2. AI Model Integration Challenge: Initial integration with OpenAI API had rate limiting and cost concerns Solution: Switched to Google Gemini AI for better performance and cost-effectiveness 3. Real-time Performance Challenge: Ensuring sub-second response times for fraud detection Solution: Optimized database queries and implemented efficient caching strategies 4. Vector Search Implementation Challenge: Creating meaningful embeddings for transaction similarity Solution: Developed custom prompt engineering for Gemini AI to generate semantic embeddings
Accomplishments that we're proud of
Built a complete fraud detection platform from scratch in record time Achieved real-time performance with sub-second fraud detection Integrated cutting-edge AI with Google Gemini for intelligent analysis Created a scalable architecture using TiDB Serverless Implemented advanced features like vector search and community intelligence Delivered a production-ready solution with comprehensive error handling Designed an intuitive user interface with modern glassmorphism design
What we learned
Technical Insights TiDB Serverless provides excellent scalability for real-time applications Google Gemini AI offers superior performance compared to traditional APIs Vector embeddings can significantly improve fraud detection accuracy Next.js App Router streamlines full-stack development
Business Understanding Fraud detection requires both technical excellence and business acumen Real-time processing is crucial for effective fraud prevention Community intelligence amplifies individual organization capabilities User experience matters as much as technical performance
What's next for AgentLedger AI
Short-term Goals (Next 3 months) Enhanced ML Models: Implement more sophisticated fraud detection algorithms API Expansion: Create public APIs for third-party integrations Mobile App: Develop iOS and Android applications Advanced Analytics: Add predictive analytics and trend forecasting
Medium-term Vision (6-12 months) Global Deployment: Scale to support international transactions Industry Specialization: Create specialized modules for banking, e-commerce, and fintech Compliance Features: Add GDPR, PCI-DSS, and SOX compliance tools Advanced AI: Integrate multi-modal AI for image and document fraud detection
Long-term Ambition (1-2 years) Enterprise Platform: Become the go-to fraud detection solution for Fortune 500 companies AI Research: Contribute to open-source fraud detection research Global Network: Build the world's largest fraud intelligence network Innovation Hub: Establish partnerships with leading financial institutions
AgentLedger AI represents the future of fraud detection - where cutting-edge technology meets real-world business needs to create a safer, more secure financial ecosystem. Built with ❤️ for the TiDB Hackathon
Built With
- and-more
- gemini
- gmailsmtp
- googleoauth
- lucide
- nextjs
- nodemailer
- prisma
- recharts
- sqlite
- tidb
- typescript


Log in or sign up for Devpost to join the conversation.