惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Jina AI
Jina AI
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
B
Blog
T
The Blog of Author Tim Ferriss
量子位
Microsoft Azure Blog
Microsoft Azure Blog
博客园 - Franky
小众软件
小众软件
Recent Announcements
Recent Announcements
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
I
InfoQ
美团技术团队
G
Google Developers Blog
Engineering at Meta
Engineering at Meta
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
V
Visual Studio Blog
云风的 BLOG
云风的 BLOG
博客园 - 【当耐特】
IT之家
IT之家
Microsoft Security Blog
Microsoft Security Blog
博客园 - 聂微东
Last Week in AI
Last Week in AI
H
Hackread – Cybersecurity News, Data Breaches, AI and More
H
Help Net Security

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
I built an AI agent that turns Gmail receipts into a spre...
John Dreic · 2026-05-09 · via DEV Community

Are you sitting on a stack of receipts you've been meaning to deal with? I was too. Here's how I fixed it once and for all.

I had an inbox full of them. Subscriptions, hotels, that one cab in Lisbon — all the SaaS I forgot I subscribed to. My accountant wanted them in a spreadsheet. My bookkeeping app wanted the PDFs. I didn't want to deal with any of it.

Now when a receipt lands in my Gmail, an AI agent spots it, looks at the PDF, pulls out the vendor, date, amount, and category, and writes a row to a Google Sheet. The original PDF gets filed away in a Drive folder. I never have to think about it again.

The receipts test

I gave it a five-page PDF with four real receipts and one deliberately scrappy one — a half-faded "Joe's Cafe £8.50" with no clear date.

Four went straight to a "Ready to post" tab — Office World, Figma, Bianca Bistro, Paddington Hotel — vendor, date, amount, all clean. The Joe's Cafe one landed in a "Needs review" tab with a note saying the date was unclear. That's the bit I care about: when the agent isn't sure, it doesn't make something up. It flags it.

Total time per receipt: somewhere between 15 and 30 seconds, mostly waiting for the model to think. Cost: a fraction of a cent.

How it actually works

Three pieces:

  1. A Gmail label. I made a label called Paper Trail/Inbox and a one-line filter that catches receipts from my usual senders. Anything in that label is fair game for the agent.
  2. A "gate" before the agent. Before the agent runs, a tiny check confirms the email actually has the right label. If not, nothing happens — no model call, no token spend. The check lives outside the agent itself — so you can change the rule without changing how the agent works.
  3. The agent itself. Once it's allowed in, the agent does the actual work: pull the PDF, look through the receipts, extract the fields, decide if it's confident enough to file directly or if it needs a human eye, write the row, archive the PDF.

The whole thing has access to exactly the eight Gmail/Drive/Sheets actions it needs to do its job — not the 200 you'd get by default. Less to confuse the model, less that can go wrong, easier to audit.

What I like about this setup

The agent's prompt only handles the fuzzy parts: looking at receipts, recognising vendors, judging whether something is worth flagging. The rest — does this email even belong here, what counts as a complete response — sits in policies you can read, switch off, or change without touching the agent.

Try it

The whole thing took less time to build than my last quarterly receipt-filing session. That's the actual story.

Here's the exact prompt I gave to the Workspace Assistant in ContextGate (that little robot icon on the bottom right) to build the whole agent for me. All I had to do was click approve to connect my Gmail, Drive, and Sheets.

Build a receipts-to-ledger agent. Trigger: Gmail watch on label Paper Trail/InboxAgent: reads each PDF attachment, looks at PDF receipts, extracts vendor / date (YYYY-MM-DD) / amount / currency / category (Office, Software, Travel, Meals, Other) / VAT / confidence (0–1). Output: if confidence ≥ 0.85, append to Sheet tab "Ready to post"; else append to "Needs review" with a notes column. Archive every PDF to Drive folder Paper Trail/Originals/<YYYY-MM>/. Update Gmail labels: remove inbox, add Processed (or Review). Policy: add a Gmail Label Gate that blocks runs where labelIds doesn't include Paper Trail/Inbox. Use claude-sonnet-4-6. Keep the toolbox to only the 8 tools needed.