Skip to content

yhyatt/GClaw

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GClaw — Gmail inbox intelligence

GClaw 📬

Reads, classifies, and digests your Gmail so the important stuff surfaces without the noise.

Python License: MIT OpenClaw Skill

No email client. No dashboards. No manual sorting.
Just structured email data your bots can actually use.


The problem with Gmail bots

Every Gmail bot starts the same way: call the API, get a wall of JSON, try to figure out what matters.
You end up writing the same fetch-parse-classify pipeline from scratch every time.

GClaw is that pipeline, done once, done right.


What GClaw provides

  • EmailFetcher — fetch by label, deduplicated, cached. Never processes the same email twice.
  • EmailParser — extracts sender domain, cleans quoted/forwarded content, detects reply chains.
  • EmailClassifier — 15-category heuristic classification. Zero LLM tokens.
  • EmailStore — JSONL persistence per bot. Queryable, auditable, portable.
  • BotContext — isolates each downstream bot to its own label/sender scope.

Architecture

Gmail (via gog CLI)
    └─► EmailFetcher      — fetch + deduplicate
        └─► EmailParser   — clean + structure
            └─► EmailClassifier  — 15 categories, no LLM
                └─► EmailStore  — JSONL, per bot_id

Quick Start

pip install gog  # Google OAuth CLI — see clawhub.com/skills/gog
export GCLAW_GMAIL_ACCOUNT="your@gmail.com"
export GOG_KEYRING_PASSWORD="your-keyring-password"
pip install -e .
from kaimail.bot_context import BotContext
from kaimail.fetcher import EmailFetcher
from kaimail.classifier import EmailClassifier
from kaimail.store import EmailStore

ctx = BotContext(bot_id="digest", allowed_labels=["INBOX"], max_results=50)
fetcher = EmailFetcher(context=ctx)
emails = fetcher.fetch_new()

classifier = EmailClassifier()
for email in emails:
    email.category = classifier.classify(email)
    print(f"[{email.category}] {email.subject}")

Classification Categories

Category Examples
newsletter Substack, Mailchimp, RSS-style sends
finance Invoices, bank alerts, receipts
travel Booking confirmations, flight updates
work Company domains, internal tools
action_required Urgent keywords, deadlines
social LinkedIn, Twitter, Facebook
security Password resets, 2FA, alerts
calendar Meeting invites, event reminders
shopping Order confirmations, delivery updates
personal Known contacts, direct messages
+ 5 more health · legal · ads · receipt · other

Use Cases

  • Email digest bot — surface what matters each morning
  • Travel bot — extract itineraries from booking confirmations
  • Finance tracker — parse receipts and invoices automatically
  • Action tracker — never miss an email that needs a reply

Requirements

  • Python 3.10+
  • gog skill (Google OAuth CLI)
  • Gmail account with OAuth configured

License

MIT © Yonatan Hyatt

About

🦞Gmail inbox intelligence — reads, classifies, and digests your email so the important stuff surfaces without the noise.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages