Inbox, Meet AI: How I Built My Personal Email Agent with LangGraph

Imagine having an assistant who never sleeps, never forgets, and always keeps an open line of communication with you. No fancy apps, no constant prompting—just a simple inbox. That’s the beauty of an email-based AI agent. By giving my AI its own email address and letting it regularly check for messages, I suddenly had a flexible, asynchronous way to collaborate with it.

Whenever I need something—summarize a long document, draft a reply, add a task to my list—I don’t have to open a special dashboard or remember a new command syntax. I just send an email. Hours later, I can check back and see that my AI has picked it up, processed it, and responded in kind.

This setup makes the AI feel less like a tool I have to operate, and more like a reliable digital colleague who sits quietly in the background, ready to take action whenever I drop something into its inbox. It’s simple, natural, and surprisingly powerful.

OpenAI Agent Toolkit vs. Google Agent Toolkit vs. LangGraph

When I explored how to structure my email agent, I looked closely at the toolkits offered by the big players—OpenAI and Google—before settling on LangGraph. Each one has its own philosophy.

The OpenAI Agent Toolkit feels like a plug-and-play environment. It gives you the Assistants API, memory, and function calling almost out of the box, which means you can get an agent running quickly without worrying too much about the wiring. It’s perfect if you’re happy to live entirely inside the OpenAI ecosystem, but that convenience comes with limits: you’re tied to their models, their infrastructure, and you have less visibility into how the workflows behave under the hood.

The Google Agent Toolkit, on the other hand, leans heavily on Gemini and the wider Google suite. It’s still young, but what it does well is integration. If you’re already managing your calendar, documents, and communication through Google services, the toolkit makes it almost effortless to hook an agent into that ecosystem. The trade-off is similar to OpenAI’s approach: you get speed and tight integration, but you also inherit a certain degree of lock-in and a more constrained environment.

Then there is LangGraph, which sits at a different layer. Instead of prescribing a fixed ecosystem, it gives you a framework to design your own agent as a graph of states and decisions. That means I can route a quick classification task to Gemini Flash, a nuanced drafting job to GPT-4o, and still keep the overall workflow consistent. It’s not quite as turnkey as the vendor-native toolkits—you do have to think more about the design of your workflows—but in exchange you gain flexibility, model-agnosticism, and long-term control.

For my project, that freedom was decisive. An email agent that may one day call Google services, another day lean on OpenAI for nuanced replies, and later integrate a local model, needs an adaptable foundation. LangGraph offered exactly that.

A Flexible Brain: LangGraph + Swappable LLMs

One of the biggest strengths of my email agent is its modular brain. At the core, it runs on LangGraph, which orchestrates the flow of logic—deciding when to classify, when to summarize, when to draft a reply, and when to call external tools. But LangGraph itself doesn’t lock me into a single AI model.

Instead, I can plug in whichever LLM (Large Language Model) best suits the task at hand. Some days, I lean on Google’s Gemini Flash for lightning-fast classification and triage. Other times, I’ll use OpenAI’s GPT-4o for deeper, more nuanced summaries or drafting replies that sound convincingly like me.

The beauty is in the interchangeability:

  • I can swap out the underlying model without rewriting my entire workflow.
  • I can even route different tasks to different models—fast ones for labeling, powerful ones for generating.
  • As new models appear, I can upgrade my agent’s capabilities simply by changing the backend configuration.

This setup means my email agent isn’t tied to a single vendor or ecosystem. It’s future-proof, adaptable, and flexible—just like an AI assistant should be.

A Glimpse of Code: Building a Basic LangGraph Agent

To make all this less abstract, here’s a simplified code example of how a LangGraph agent comes together. This snippet sets up a workflow where incoming messages get classified and then either summarized or answered with a draft reply.

from langgraph.prebuilt import create_react_agent
from langchain_openai import ChatOpenAI
from langchain.tools import Tool

# Define a simple tool the agent can call
def multiply(a: int, b: int) -> int:
    """Multiply two numbers."""
    return a * b

tools = [
    Tool(
        name="multiply",
        func=lambda x: multiply(*map(int, x.split())),
        description="Multiply two integers. Input must be two numbers separated by space."
    )
]

# Initialize an LLM
llm = ChatOpenAI(model="gpt-4o-mini")

# Create the agent executor
agent_executor = create_react_agent(
    llm=llm,
    tools=tools,
    state_modifier="You are a helpful assistant that can do math using tools."
)

# Run the agent
result = agent_executor.invoke({"messages": [("user", "What is 12 times 7?")]})
print(result["messages"][-1].content)

Beyond Email: Useful Tools That Make the Agent Smarter

What really turns an email agent from a neat demo into a genuinely helpful assistant is the set of tools it can reach for. LangGraph makes it easy to wire in external functions, which means the agent doesn’t just read and draft emails—it can actually do things on my behalf.

For example, I connected a web browsing and summarization tool. When I drop a link into an email, the agent can fetch the page, strip out the noise, and send me back a concise summary. No more losing half an hour scrolling through long articles when all I really wanted was the gist.

I also added a finance-focused module. If I ask about a stock, the agent can check the latest news, highlight major movements, and even keep an eye on my watchlist in the background. What makes this especially powerful is the proactive alerts: if something important happens—say a sharp drop in a company I’m following—the agent doesn’t wait for me to ask. It sends me a quick heads-up email, so I stay informed without constantly checking markets myself.

These tools extend the agent’s role from being a passive helper to something closer to a digital concierge. It doesn’t just answer questions when I ask—it anticipates the kind of updates I’d want, surfaces them, and delivers them straight to my inbox in a format that’s quick to digest.

Teaching the Email Agent to Run Scheduled Tasks

So far, the email agent has been reactive: it waits for me to send instructions and then acts on them. That’s useful, but the real magic happens when the agent can also work proactively—checking in on things, performing regular updates, and nudging me when something important comes up. This is where scheduled tasks come into play.

Think of scheduled tasks as the AI equivalent of a morning routine. Just as a human assistant might start each day by reviewing your calendar, scanning the news, and preparing a digest, the email agent can do the same—quietly in the background, without me asking for it every time.

Why Scheduling Matters

Scheduling turns the agent from a passive inbox helper into a genuine partner. Instead of me remembering to email “Check the stock market” or “Summarize my newsletters,” the agent can perform these checks automatically. This reduces friction and increases trust: I know the information I care about will land in my inbox reliably, without me having to think about it.

In my setup, I’ve used scheduling for several key workflows:

  • Daily market summaries: At 8 AM, the agent pulls recent stock news and movements from my watchlist and sends me a brief digest.
  • Weekly newsletter review: Every Friday afternoon, it bundles the week’s newsletters into a single summary, so I don’t drown in articles I’ll never read.
  • Calendar previews: Each Sunday evening, it looks ahead at the coming week and generates a “heads-up” overview of important meetings and deadlines.

How to Implement Scheduling

At a technical level, scheduling is less about LangGraph itself and more about the infrastructure around it. LangGraph handles the logic of what to do once a task is triggered, but we need a mechanism to trigger the workflow at the right times.

For simplicity reasons I chose the schedule module to run my agent tasks, including the one to check on any incoming email requests every minute.

Of course you could alter the agent to self-define flexible tasks by using an agent scheduling tool.

import schedule

if __name__ == "__main__":
   schedule.every().friday.at("18:00").do(check_opportunities)
   schedule.every().minute.at(":00").do(check_new_emails)
   while True:
      schedule.run_pending()
      time.sleep(30)

Summary

In the end, what makes an email AI agent so powerful is its asynchronous nature. It feels less like chatting with a bot and more like delegating to a personal assistant. I don’t have to sit in a prompt window or keep a conversation open—I just write a quick email, hit send, and move on with my day. The agent picks it up, processes the request, and delivers the result back to me when it’s ready. It’s a simple “fire and forget” workflow, but the effect is profound: suddenly, I have a digital colleague quietly taking care of tasks in the background, freeing up my attention for the things that really matter.