An AG2-powered agent that manages your Gmail through natural language. It connects to Gmail via Arcade — a managed OAuth2 service that handles authorization for you, so there’s no token storage or manual API setup required.
Example prompts:
Show my unread emailsList emails from someone@example.comSearch for emails about the Arcade partnershipShow the full thread for this emailReply to this email: sounds good, see you thenArchive all emails from newsletter@substack.comTrash this emailSend an email to someone@example.com about scheduling a demoAssistantAgent decides which tools to call; the UserProxyAgent executes them.AssistantAgent (LLM reasoning) + UserProxyAgent (tool execution) with clean termination and a multi-turn conversation loop.| Component | Role |
|---|---|
| AG2 | Multi-agent orchestration (AssistantAgent + UserProxyAgent) |
| Arcade SDK | Managed OAuth2 + tool execution for Gmail |
| OpenAI GPT-4o | LLM backend |
| Gmail | Email management target |
Install dependencies using uv:
uv sync
Set up environment variables:
export OPENAI_API_KEY=...
export ARCADE_API_KEY=...
export ARCADE_USER_ID=your@email.com # email used to sign up at arcade.dev
| Variable | Where to get it |
|---|---|
OPENAI_API_KEY |
platform.openai.com/api-keys |
ARCADE_API_KEY |
docs.arcade.dev/home/api-keys |
ARCADE_USER_ID |
Email used to sign up at arcade.dev |
source .env && uv run python main.py
On the first run, Arcade will print an OAuth URL in the terminal — open it in your browser to authorize Gmail. Subsequent runs skip this step (token is cached by Arcade).
Type your request at the You: prompt. Type exit or quit to quit.
This project is built with AG2 (Formerly AutoGen) and utilizes the following features from the library:
Check out more projects built with AG2 at Build with AG2!
This project is licensed under the Apache License 2.0. See the LICENSE for details.