feat(agents): add GAIA Inbox Zero Agent for LLM-powered email triage#916
feat(agents): add GAIA Inbox Zero Agent for LLM-powered email triage#916antmikinka wants to merge 4 commits intoamd:mainfrom
Conversation
Imports the complete gaia-inbox-zero-agent package including agent logic, email classifiers, data loader, result schema, CLI batch classifier, automation YAML, and full test suite for inbox zero email management. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Still must update:
|
itomek
left a comment
There was a problem hiding this comment.
Thanks for the contribution! The classification logic and test scaffolding are reasonable, but as submitted this reads more like an out-of-tree project that optionally imports GAIA than a GAIA-native agent. A few things need to change before this can land.
Critical
-
Silent
ImportErrorfallback ingaia_inbox_zero/agent/inbox_zero.py:try: from gaia.agents.base.agent import Agent from gaia.agents.base.tools import tool ... except ImportError: Agent = object tool = lambda f: f ...
This violates the "No Silent Fallbacks — Fail Loudly" rule in
CLAUDE.md. If GAIA isn't installed,InboxZeroAgentbecomes an emptyobjectsubclass and@toolis a no-op — the agent appears to construct fine but registers no tools and does nothing. Please makegaiaa hard dependency inpyproject.tomland remove the stub branch. -
Out-of-tree package structure. GAIA agents belong under
src/gaia/agents/<name>/and register throughsrc/gaia/agents/registry.py(preferably via a YAML manifest, with reusable tools opted in fromKNOWN_TOOLS). This PR adds a parallel package at the repo root with its ownpyproject.toml— it isn't discoverable by the registry, isn't invocable asgaia <subcommand>, and duplicates LLM-client wiring already present insrc/gaia/llm/. Please move the package undersrc/gaia/agents/inbox_zero/and register it.
Major
-
Hardcoded Windows user path in
gaia_inbox_zero/data/email_loader.py:r"C:\Users\antmi\Downloads\..."(also mirrored in.env.example). Not portable across machines or OSes. Default toNoneand raise an actionable error whenMBOX_PATHis unset. -
No documentation updates.
CLAUDE.md"Documentation Requirements" mandates a.mdxindocs/guides/and an entry indocs/docs.jsonfor every new feature. Neither is touched here. -
No CLI integration. Should register a
gaia inbox-zerosubcommand insrc/gaia/cli.py(or agaia-inbox-zeroconsole_script insetup.py) instead of a privatepython -m gaia_inbox_zero.cli.batch_classifierentrypoint that's invisible togaia -h. -
Reuses none of the GAIA LLM stack. The agent rolls its own provider switching for Lemonade vs. Anthropic instead of using
gaia.llm.factory/lemonade_client.py/providers/claude.py. This bypasses model selection, retries, and error-translation conventions, and means future LLM-stack improvements won't apply here.
Minor
-
ANTHROPIC_API_KEYdefaults to""inagent/config.py— produces confusing 401s deep in the request path instead of a clear "ANTHROPIC_API_KEY is not set" error at startup. Useos.environ.get("ANTHROPIC_API_KEY")and validate at agent init. -
Token counts in
BatchMetricsare estimated aslen(text) // 4. Both Anthropic and Lemonade responses expose realusage.input_tokens/usage.output_tokens— use those instead. -
Tests mock the GAIA base
Agent("requires the full GAIA package"). Once the package moves in-tree, drop the mock and exercise the real base class — otherwise the tests can't detect breakage in the integration they advertise. -
_validate_path()inemail_loader.pyresolves and existence-checks the path but doesn't constrain it to a sandbox. Either document the trust model or restrict to a configurable root.
Recommendation
Reshape into src/gaia/agents/inbox_zero/ (Python class or YAML manifest in registry.py), wire it through the existing LLM factory, add a gaia inbox-zero CLI subcommand, write a docs/guides/inbox-zero.mdx (and add it to docs/docs.json), drop the silent fallbacks, and replace the hardcoded path. Happy to re-review once those are in.
Summary
gaia-inbox-zero-agent— a production-ready email triage and inbox management agent built on the GAIAagent framework
URGENT,NEEDS_RESPONSE,FYI,PROMOTIONAL,PERSONALinbox-zero-helper.yamlClawFlow automationWhat's Included
agent/inbox_zero.pyInboxZeroAgent— GAIAAgentsubclass with email triage toolsagent/classifiers.pyagent/config.pydata/email_loader.pycli/batch_classifier.pyschema/result_schema.pyTaskResult/BatchMetricsdataclassesautomations/inbox-zero-helper.yamltests/Architecture
MBOX File → email_loader → batch_classifier → LLM API → Results JSON
↕
InboxZeroAgent (GAIA)
Tools: fetch, classify, archive, group
Test Plan
pytest tests/ -vpasses all 4 test filesANTHROPIC_API_KEYsetInboxZeroAgent.process_in_batches()aggregates metrics correctlyNotes
.env.exampleQwen3.5-35B-A3B-GGUF(AMD Ryzen AI optimized)🤖 Generated with Claude Code