Skip to content

Triqai case study

AI-powered transaction enrichment API that dissects raw banking strings into confidence-scored merchant, location, and intermediary data. Built solo from weekend MVP to production SaaS on Cloudflare Workers.

Solo founder & engineer — Personal. Stack: Cloudflare Workers, Hono, Neon Postgres, Drizzle ORM, Next.js, React, Tailwind CSS, Stripe. Tasks: Architecture, Backend development, Frontend development, Infrastructure, DevOps. ## Origin Triqai started as a feature inside [Rediant](/works/rediant). I needed structured, categorized data extracted from raw banking transaction strings: the cryptic text your bank shows you, like `PP*DOORDASH*Convivo #1422 Santa Barbara, CA` or `AMZN Mktp US*RT4KZ0FP3`. These strings are packed with useful information but no bank cleanly parses all of it. After a weekend building an MVP with a different approach to the problem, the results surprised me. The architecture worked well enough to justify turning it into a standalone product, so I built Triqai into a full SaaS. ## What It Does Triqai is a transaction enrichment API. Send it a raw banking string, and it returns structured data: the merchant with verified business details, the physical location with coordinates, any intermediaries (payment processors, delivery platforms), and a category. Each with a confidence score indicating reliability. Unlike services that rely on static lookup databases, Triqai verifies entities against live web data. A new restaurant that opened last week has no entry in any static database, but it has a website and a Google Maps listing. Triqai finds and cross-references these sources, producing verified data for merchants that lookup-table approaches would miss. Confidence scoring is a core differentiator: rather than returning a single "best guess" without context, every entity carries a calibrated score so consumers can set their own acceptance thresholds, accept everything above 70 for a dashboard, but require 90+ before auto-categorizing a transaction in a financial product. ## Infrastructure The backend runs on **Cloudflare Workers** with no traditional servers. The architecture uses Workers for the core API and supporting services, **Durable Objects** for distributed coordination and billing atomicity, and **KV** for multi-layer edge caching. The system caches aggressively to minimize redundant expensive operations, with a distributed singleflight mechanism preventing duplicate work across concurrent requests. ## Performance All numbers measured against the live production API. The full pipeline runs genuine verification (AI inference, web searches, and cross-referencing) rather than quick database lookups. A multi-tier cache architecture turns the full pipeline into a fast cached read with a 96% latency reduction. Duplicate concurrent requests are coalesced so only one runs the full pipeline while others wait and read from cache. ## Credits & Billing Each organization gets its own billing instance acting as a single-writer credit gate with atomic checks and rate limiting. Usage counters batch in memory and flush periodically, eliminating per-request database writes on the hot path. ## Database **Neon Postgres** (serverless) with **Drizzle ORM** for type-safe schema and migrations. Multi-tenant with organization-scoped isolation. Enriched entities are shared globally (one Netflix entity benefits all users) with application-layer access control. GDPR-compliant retention with automatic data expiration and audit trails. ## Frontend & Dashboard The **Next.js** and **React** frontend includes an interactive playground to try the API before signing up, a dashboard with API key management, usage analytics, activity logs, and team management, Stripe-powered billing with plan management, and authentication with email verification, password reset, and organization invites. ## API Design The RESTful API is built with **Hono** and features a layered middleware stack handling connection management, security headers, rate limiting, API key authentication, and analytics. All running at the edge. ## Key Decisions - **Confidence scoring on every entity.** Rather than returning binary results, every entity carries a calibrated confidence score so consumers can set their own acceptance thresholds. - **Web-first verification over static databases.** Using live web data instead of a proprietary lookup database means new and small merchants are enrichable from day one. - **Distributed coordination for billing.** Using Durable Objects as single-writer credit gates eliminated race conditions in billing. ## Challenges - Designing a credit system that correctly handles deduction, overage billing, period resets, and plan changes. - Building cancellation propagation across deeply nested async operations. - Managing serverless database connection pressure at scale. - Handling the long tail of international transaction formats. - Calibrating confidence scores across different enricher types with different signal qualities.
Works

Works

Explore selected projects with timelines, stack choices, and delivery outcomes. This view includes company and freelance examples in a horizontal timeline display.

Project List

Timeline (From 2024)

Projects
202420252026
  1. Triqai

    Today
  2. Rediant

  3. Through the Frames

  4. Hytura

  5. Knitted

  6. Bysidde

Loading workspace

Taxi the dog desktop wallpaper icon