Inspiration

Every day, consumers lose money to undelivered packages, surprise charges, cancelled flights, and refunds they never received. I personally experienced this — an Amazon order marked as delivered that never arrived. I knew I had rights, but writing a formal dispute letter, finding the right support email, and citing the correct law felt overwhelming. Most people just give up. I built Receipts to change that.

What it does

Receipts is an autonomous AI agent that fights consumer disputes on your behalf:

  1. Paste any receipt — order confirmation, invoice, or forwarded email
  2. AI extracts the details — merchant name, support email, amount, and issue type are detected automatically using Gemini 2.5 Pro
  3. Agent drafts the dispute — the Gemini agent queries a MongoDB Atlas knowledge base of 38 merchant policies and consumer regulations (FTC, EU EC 261/2004, DoT, Safaricom M-PESA terms, Kenya Airways rights, and more), then writes a professional dispute letter citing the exact applicable law
  4. Human approval — you review and approve the draft before anything is sent
  5. Automatic dispatch — the approved email is sent to the merchant via Gmail API

We specifically cover East African merchants and regulations — Kenya Airways, Ethiopian Airlines, Safaricom M-PESA, Jumia, Bolt — making this relevant to markets that most consumer tools ignore.

How we built it

The system is a TypeScript monorepo with five deployed services:

  • MongoDB MCP Server (Cloud Run) — custom MCP-compliant server exposing a search_knowledge tool over SSE transport, backed by MongoDB Atlas with 38 policy and regulation documents
  • Vertex AI Agent Engine — ADK-based Gemini 2.5 Pro agent that calls the MongoDB MCP server before drafting every dispute email
  • Vertex AI Agent Builder — visual agent flow for orchestration and grounding
  • Ingester (Cloud Run) — polls Gmail every 30 seconds for receipt emails, creates dispute records in MongoDB Atlas
  • Dispatcher (Cloud Run) — polls for approved disputes and sends emails via Gmail API
  • Next.js Dashboard (Vercel) — landing page + dispute management UI with approve/reject workflow

Challenges we ran into

Vertex AI Agent Builder MCP limitation — The Agent Builder UI shows an MCP Server option, but it has a known platform bug where SSE connections always return InternalError. We built a fully spec-compliant MCP server but had to access it via the OpenAPI REST fallback. We documented this clearly and the agent functionality is identical.

ADK Agent Engine deploymentgoogle-adk 2.x has a pydantic validation bug where it uses the numeric Reasoning Engine ID as the app name (which fails validation). We downgraded to google-adk 1.4.2 and wrapped the agent in a custom class implementing the stream_query interface.

Async event loop — Agent Engine runs in an async FastAPI host, so standard asyncio.run() calls fail with "event loop already running". Fixed with nest_asyncio.

Accomplishments we're proud of

  • Full end-to-end pipeline running on Google Cloud — from Gmail ingestion to MongoDB to Gemini to email dispatch
  • 38 knowledge documents covering merchants across US, EU, and East Africa
  • Auto-extraction of merchant details from raw receipt text using Gemini
  • Human-in-the-loop approval before any email is sent
  • Landing page that explains the product clearly to new users

What we learned

  • Vertex AI Agent Engine requires careful async handling — the hosted FastAPI environment has constraints that local development doesn't reveal
  • MongoDB Atlas text search is extremely fast for policy retrieval at this scale
  • The MCP specification is solid but platform support is still maturing — building a compliant server is straightforward; getting hosted platforms to connect via SSE is the hard part

What's next

  • Google Sign-In so each user sees only their own disputes
  • Expand the knowledge base to 100+ merchants and regulations
  • Support for multiple email providers beyond Gmail
  • Chargeback automation as an escalation path ## Inspiration

Every day people lose money to undelivered packages, overcharges, cancelled flights, and refunds they never received. Most people don't dispute these charges because they don't know their legal rights or how to write a formal dispute letter. I built Receipts to make that automatic.

What it does

Receipts is an autonomous AI agent that fights consumer disputes on your behalf:

  1. Paste any receipt or order email
  2. Gemini AI extracts the merchant, amount, and issue type automatically
  3. The agent queries a MongoDB Atlas knowledge base of 38 merchant policies and consumer regulations
  4. A professional dispute email is drafted citing the exact applicable law
  5. You review and approve — then it sends automatically via Gmail

Covers Kenya Airways, Safaricom M-PESA, Jumia, Uber, Amazon, Netflix, Udemy, Ethiopian Airlines, and 20+ more merchants.

How we built it

  • Vertex AI Agent Engine — ADK-based Gemini 2.5 Pro agent deployed as a Reasoning Engine
  • Google Cloud Agent Builder — visual agent flow for orchestration
  • MongoDB MCP Server — custom MCP-compliant server on Cloud Run with 38 policies and regulations
  • Cloud Run — three services: ingester (polls Gmail), dispatcher (sends emails), mongodb-mcp-proxy (MCP server)
  • Next.js 14 dashboard — deployed on Vercel with approve/reject workflow

Challenges we ran into

Vertex AI Agent Builder's MCP SSE client has a known platform bug returning InternalError on connections. We built a fully spec-compliant MCP server but accessed it via OpenAPI REST fallback — identical functionality. Also, google-adk 2.x has a pydantic validation bug with numeric app names — solved by downgrading to 1.4.2 and wrapping the agent in a custom class.

Accomplishments that we're proud of

Full end-to-end pipeline on Google Cloud — Gmail ingestion to MongoDB to Gemini to email dispatch. 38 knowledge documents covering US, EU, and East African merchants and regulations. First consumer dispute tool covering Safaricom M-PESA and Kenya Airways.

What we learned

Vertex AI Agent Engine requires careful async handling. MongoDB Atlas text search is extremely fast for policy retrieval. MCP specification is solid but platform SSE support is still maturing.

What's next for Receipts

  • Google Sign-In so each user sees only their own disputes
  • Expand knowledge base to 100+ merchants and regulations
  • Support multiple email providers beyond Gmail
  • Chargeback automation as escalation path

Built With

  • cloud-run
  • gemini-2.5-pro
  • gmail-api
  • google-adk
  • google-cloud-agent-builder
  • mongodb-atlas
  • mongodb-mcp-server
  • next.js-14
  • shadcn/ui
  • tailwind-css
  • typescript
  • vercel
  • vertex-ai-agent-engine
  • zod
Share this project:

Updates