Back to Portfolio
ai-engineering production

AI Cloud Agent System

Three autonomous email agents handling interview coordination, reader engagement, and calendar scheduling — built and deployed in a single session

2,030
Lines of code
7
Technologies

Tech Stack

Node.jsClaude APIUpstash RedisCloudflare WorkersVercel ServerlessResendGoogle Calendar API

The Problem

Job searching means dozens of conversations happening at once — recruiters, hiring managers, scheduling coordinators. Every email needs a thoughtful, timely response. But I was also building, writing, and running operations full-time.

I needed a system that could represent me accurately when I wasn’t available — not a chatbot, but an agent that actually knew my work and could hold a real conversation.

The Solution

Three specialized email agents, each handling a different domain:

  1. Interview Agent (interview@withjhinna.com) — Answers questions about my experience, technical skills, and approach to operations. Maintains a comprehensive knowledge base of my professional history and can discuss specific projects in detail.

  2. Substack Agent (hello@withjhinna.com) — Engages with readers of my writing. Understands the voice and themes of published posts and can have genuine conversations about the ideas.

  3. Calendar Agent (schedule@withjhinna.com) — Coordinates meeting scheduling with live Google Calendar integration. Checks real-time availability and proposes specific times.

How It Works

Inbound Email → Cloudflare Email Routing → Worker
  → Vercel Serverless Function → Claude API → Resend → Reply

Conversation Memory: Each sender gets a persistent conversation thread stored in Redis — up to 20 message pairs with a 7-day window. The agent remembers what you’ve discussed and builds on it.

Smart Escalation: The system monitors conversations for signals that need human attention — job offers, salary discussions, complex scheduling, or sensitive topics. When detected, it sends priority notifications with full conversation context so I can step in seamlessly.

Calendar Integration: The scheduling agent fetches live free/busy data from Google Calendar via OAuth2, injecting real availability into each response. Token refresh is automatic with a 5-minute cache buffer.

Guardrails: Rate limiting (50 messages/day per sender), message validation, empty reply detection, and quoted-text stripping to keep conversations clean.

The Architecture

  • Cloudflare Workers — Email routing layer. Parses inbound emails by address and forwards to the correct Vercel endpoint. Copies everything to a monitoring inbox.
  • Vercel Serverless Functions — 11 endpoints handling the three agents plus health checks, escalation management, and a SAVANT Lite integration.
  • Upstash Redis — Conversation state, rate limiting, and escalation tracking. All with TTLs so nothing accumulates indefinitely.
  • Claude API — Each agent has its own system prompt with domain-specific knowledge, voice, and boundaries.
  • Resend — Outbound email delivery through the @withjhinna.com domain.

What This Demonstrates

This isn’t a wrapper around an API. It’s a production system that handles real conversations with real people — recruiters, readers, collaborators. The architecture decisions matter: conversation persistence so context isn’t lost, escalation detection so nothing important slips through, rate limiting so the system stays stable.

Built in a single focused session using Claude Code as a development partner. Scoped the problem, designed the architecture, shipped to production. That’s the workflow: identify what needs to exist, build it, deploy it.

Need something similar for your team?

Let's Talk