Skip to content
Merged
Changes from 4 commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
38ead62
docs: add AI-Powered Gemini Semantic Classifier feature proposal
don-petry Jul 28, 2026
06794e1
docs: update proposal with 7-Domain Standard Taxonomy Matrix & MECE V…
don-petry Jul 28, 2026
fa96d54
docs: add Inbox Preservation rule (processing to Drive does NOT remov…
don-petry Jul 28, 2026
2496323
docs: resolve merge conflict and add Inbox Preservation rule
don-petry Jul 28, 2026
19ae580
docs: use Single Global Processed Label marker to eliminate sidebar l…
don-petry Jul 28, 2026
b78ac1d
docs: detail Idempotency & Single-Click Reprocessing workflows
don-petry Jul 28, 2026
8021d5a
feat: add native Gemini AI classifier and auto-filter engine module
don-petry Jul 28, 2026
cd7e914
chore: dev-lead update (review-changes) [skip ci-relay]
donpetry-bot Jul 28, 2026
034b23c
chore: dev-lead update (review-changes) [skip ci-relay]
donpetry-bot Jul 28, 2026
f1a8dc9
chore: dev-lead update (review-changes) [skip ci-relay]
donpetry-bot Jul 28, 2026
15ee6da
fix(ci): auto-fix for SonarCloud Code Analysis [skip ci-relay]
donpetry-bot Jul 28, 2026
d8154d3
fix(ci): auto-fix for SonarCloud Code Analysis [skip ci-relay]
donpetry-bot Jul 28, 2026
6ffb452
fix(ci): auto-fix for SonarCloud Code Analysis [skip ci-relay]
donpetry-bot Jul 28, 2026
4996a6e
chore: dev-lead update (review-changes) [skip ci-relay]
donpetry-bot Jul 28, 2026
bae0762
fix(ci): auto-fix for SonarCloud Code Analysis [skip ci-relay]
donpetry-bot Jul 28, 2026
f1ae720
fix(reviews): address review comments [skip ci-relay]
donpetry-bot Jul 28, 2026
3e934e5
fix(ci): auto-fix for SonarCloud Code Analysis [skip ci-relay]
donpetry-bot Jul 28, 2026
05db839
fix(ci): auto-fix for SonarCloud Code Analysis [skip ci-relay]
donpetry-bot Jul 28, 2026
ccf9ad5
fix(ci): auto-fix for SonarCloud Code Analysis [skip ci-relay]
donpetry-bot Jul 28, 2026
257460e
fix(ci): auto-fix for SonarCloud Code Analysis [skip ci-relay]
donpetry-bot Jul 28, 2026
995b18a
docs: detail Unclassified & Edge-Case email handling safety nets
don-petry Jul 28, 2026
3fcd9cc
feat: add native Google Apps Script GitHub Sync module (UrlFetchApp -…
don-petry Jul 28, 2026
1d65a71
chore(ci): apply prettier/eslint auto-fixes
github-actions[bot] Jul 28, 2026
c1ab1ba
fix(bot): address bot feedback [skip ci-relay]
donpetry-bot Jul 28, 2026
899ad30
fix(bot): address bot feedback [skip ci-relay]
donpetry-bot Jul 28, 2026
d5f21ee
test: add performance and scalability benchmark test suite for long d…
don-petry Jul 28, 2026
ee1ae05
feat: enhance gitHubSync with targeted insertion and 409 SHA collisio…
don-petry Jul 28, 2026
f06010c
chore: dev-lead update (review-changes) [skip ci-relay]
donpetry-bot Jul 28, 2026
64b46ec
feat: add Option A multi-account user email resolution and deployment…
don-petry Jul 29, 2026
b41cdd1
chore(ci): apply prettier/eslint auto-fixes
github-actions[bot] Jul 29, 2026
48c8a3e
feat: add modelEndpoint to classifier config
donpetry-bot Jul 29, 2026
f1f8aa1
feat: add appsscript.json manifest for clasp deployment
don-petry Jul 29, 2026
581cc10
chore: add .claspignore to exclude Node.js Jest test files from Apps …
don-petry Jul 29, 2026
6f6185d
fix: export getAiClassifierConfig and standalone GAS logic
don-petry Jul 29, 2026
bcdde8f
fix: safe Gemini API HTTP status checking and response guards
don-petry Jul 29, 2026
ea2bf36
fix: update Gemini API endpoint to gemini-2.0-flash with automatic fa…
don-petry Jul 29, 2026
db9dad7
feat: add listAvailableGeminiModels helper and expanded model endpoints
don-petry Jul 29, 2026
3c76f60
feat: set gemini-3.1-flash-lite as 2nd fallback endpoint
don-petry Jul 29, 2026
ea307b3
feat: add 404 auto-create note functionality with Progressive Disclos…
don-petry Jul 29, 2026
e75dc95
feat: reorder endpoints to highest-level model first and add HTTP 429…
don-petry Jul 29, 2026
0cb6756
feat: set Gemini 3.5 Flash Lite as primary endpoint #1
don-petry Jul 29, 2026
184fb59
feat: set Gemini 3.5 Flash Lite as #1 and Gemini 3.1 Flash Lite as #2
don-petry Jul 29, 2026
8ecfaab
chore: remove deprecated 1.x and 2.x Gemini models, use 3.x models only
don-petry Jul 29, 2026
466fad3
chore: dev-lead update (review-changes) [skip ci-relay]
donpetry-bot Jul 29, 2026
683d5a9
feat: add Family/DJ-Rachel sub-label and strict prompt classification…
don-petry Jul 29, 2026
dff51b9
feat: exclude health newsletters and news bulletins from 04_Family_He…
don-petry Jul 29, 2026
b566b95
feat: add setupFiveMinuteTrigger and stopAllTriggers for automated ba…
don-petry Jul 29, 2026
1656f46
feat: map student college/career planning meetings to Family/School
don-petry Jul 29, 2026
d813331
feat: map MyBroodMinder alerts to 07_Community_NonProfit with sub-lab…
don-petry Jul 29, 2026
7037ee1
feat: map ParentSquare and MCAA school emails to Family/School-Toby
don-petry Jul 29, 2026
4befa97
fix: add 2-second rate limit backoff delay on HTTP 429 and stabilize …
don-petry Jul 30, 2026
c0408e0
feat: parse and honor Retry-After header and retryDelay on HTTP 429
don-petry Jul 30, 2026
ba84dfb
chore: strictly enforce Gemini 3.x models ONLY
don-petry Jul 30, 2026
28404ed
feat: add Gemma 4 31B (gemma-4-31b-it) as primary endpoint #1
don-petry Jul 30, 2026
57590f5
fix: add extractJsonSubstring helper to parse Gemma 4 31B markdown fo…
don-petry Jul 30, 2026
a763bd6
feat: exclude tech webinars and commercial store marketing from core …
don-petry Jul 30, 2026
1ab8558
feat: add automated action execution (trash, archive, mark_read) and …
don-petry Jul 30, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions docs/proposals/proposal-001-ai-gemini-semantic-classifier.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Feature Proposal 001: Native Gemini AI Semantic Email Classifier & 7-Domain Taxonomy Engine

## Executive Summary
This proposal introduces a native **Gemini AI Semantic Email Classifier & Standard Taxonomy Engine** into the `google-app-scripts` suite.

By calling the Gemini REST API (`gemini-1.5-flash` / `gemini-2.0-flash`) natively via Google Apps Script's `UrlFetchApp.fetch()`, incoming unclassified emails are semantically categorized into **7 Standard Canonical Domains**, and high-confidence classifications automatically generate permanent Gmail filter rules via the Advanced Gmail Service.

---

## Critical Label Semantics & Inbox Preservation Rule

- **Drive Ingestion Designator**: The label suffix `-Processed` (or `-Archived`) indicates **ingestion status into Google Drive**, NOT removal from the user's Inbox.
- **Inbox Preservation**: Processing an email into Google Drive **MUST NOT remove the message from the user's INBOX**. The email thread remains visible in the Inbox for human review and reading until explicitly archived or deleted by the user.

---

## Standard 7-Domain Taxonomy Matrix (PARA / ISO 15489 / MECE Aligned)

The classifier operates against a standardized, mutually exclusive, collectively exhaustive (MECE) 7-domain taxonomy:

| 7 Canonical Domains | Standard PARA Area | Scope & Contents |
| :--- | :--- | :--- |
| **`01_Household`** | Real Estate & Living Space | Primary residence (2809 Five Oaks), shop build, rental (3535 Broken Bow), 18 Running Deer archive |
| **`02_Finance_Legal`** | Financial & Legal Protections | Taxes, banking (Schwab/BoA), insurance policies, court records, custody, estate planning |
| **`03_Vehicles`** | Transportation & Assets | Vehicle searches (2026 car hunt), vehicle titles, Mercedes logs, auto maintenance |
| **`04_Family_Health`** | Family Welfare & Health | Children (Toby, Tide), school IEPs, speech/audiology reports, medical history, AYOP camps |
| **`05_Tech_Infrastructure`**| IT & Home Automation | Home Assistant, NAS backups, Tasker scripts, network gear, software licenses |
| **`06_Work_Career`** | Professional Life & Income | EY architecture, resumes, job interview decks, expense reports, admin notes |
| **`07_Community_NonProfit`**| Civic Duty & Service | HelpingOneGuy 501(c)(3) charity, JeffCo Bees BOD, faith outreach |
Comment thread
don-petry marked this conversation as resolved.
Resolved

---

## Key Capabilities

1. **Zero-Configuration Semantic Classification**:
- Classifies incoming emails from unknown senders based on semantic intent, sender, subject, and body snippet into target canonical labels (`Family/School`, `Finance/Taxes`, `Household/Rentals`, etc.).
2. **Self-Learning Gmail Filter Generation**:
- When Gemini classifies a new sender with high confidence ($\ge 95\%$), the script automatically calls `Gmail.Users.Settings.Filters.create` to create a permanent static Gmail filter rule. Future emails from that sender are processed instantly by Gmail's fast native filter engine at $0$ cost.
Comment thread
don-petry marked this conversation as resolved.
Resolved
3. **Inbox Preservation**:
- Classifying and storing an email attachment in Google Drive updates the thread label to `[Label]-Processed` while preserving the thread in the user's INBOX.
4. **100% Cloud-Native & Serverless**:
- Executes natively inside Google Apps Script via `UrlFetchApp.fetch()`. Requires zero external servers, Docker containers, or Python infrastructure.

---

## Code Module Design

Target file structure in `google-app-scripts`:

```
src/gmail-ai-classifier/
├── README.md
├── code.gs
├── config.gs
└── tests/
├── code.test.js
└── integration.test.js
Comment thread
don-petry marked this conversation as resolved.
Resolved
```

---

## Discussion & Tracking
- Issue Tracked: [#491](https://github.com/petry-projects/google-app-scripts/issues/491)
- Pull Request Tracked: [#492](https://github.com/petry-projects/google-app-scripts/pull/492)
- Repository: `petry-projects/google-app-scripts`
Loading