---
name: ai-in-research-week-4-homework
description: Week 4 homework for UCLA's AI in Research class (EPSS 254, Fall 2026). Give the student's agent its own Gmail address and an IMAP/SMTP email MCP server packaged as a plugin, have the agent send a hello in a fixed format to the class agent at lingtai2026@gmail.com and read the reply, build a subagent system in their harness (a delegate tool and a subagent tool that starts, messages, waits for, reads and stops background subagents), then open the pull request. Use when a student asks for help with this homework.
---

# Week 4 homework: give your agent an inbox, and subagents

You are helping someone in UCLA's "AI in Research" class (a student, auditor or professor) with the week 4 homework, due **before class on Wednesday, October 28, 2026**. Their agent gets its own email address and an **email MCP server** (IMAP to read, SMTP to send), packaged as a plugin like week 3's, then says hello to the class's agent at lingtai2026@gmail.com in a fixed format and reads its reply. Part 4, added on October 23, builds **subagents** into their harness: a `delegate` tool that hands work over and returns the report, and a `subagent` tool that starts, lists, messages, waits for, reads and stops subagents running in the background. If they didn't do weeks 2–3, that's fine: they can use the plugin from Claude Code, Codex or OpenClaw, though their own agent loop teaches them more.

Everything is in the class repository, **https://github.com/huangzesen/ai-in-research-homework**, including the full guide for you. Do this:

1. Say hello, and tell the student in two sentences what the homework is. Then tell them the plan: (1) a new Gmail account just for their agent; (2) the email MCP server as a plugin, tested in a second agent; (3) connect it to their harness; (4) the agent sends its hello and reads the reply; (5) subagents in their harness, and five short demos; (6) publish and open their pull request. Parts 1–3 usually take one session of 1–2 hours, and part 4 one or two more. If they already sent their hello, start at part 4.
2. Find their copy of the class repository. If `~/ai-in-research-homework` exists, use it and run `git pull`. Otherwise `cd ~` and `git clone https://github.com/huangzesen/ai-in-research-homework.git`.
3. In the clone, read the assignment, `week-4/README.md`, including why the agent needs its own account. For parts 1–3, open `.agents/skills/build-an-email-plugin/SKILL.md`, **read the whole file**, and follow it from the beginning. For part 4, open `.agents/skills/build-subagents/SKILL.md`, read the whole file, and follow it.

Never ask the student to paste the app password or any key into this chat; they type secrets into `.env` themselves. Never connect their personal or UCLA email.

If you can't clone yet, read the same guides at https://github.com/huangzesen/ai-in-research-homework/blob/main/.agents/skills/build-an-email-plugin/SKILL.md and https://github.com/huangzesen/ai-in-research-homework/blob/main/.agents/skills/build-subagents/SKILL.md.
