AI Email Responder Architecture
← Back to Preview ToolOverview
The AI Email Responder is designed to automatically respond to Zillow rental inquiries in real-time. This page outlines the production architecture and how different components interact to create a seamless automated response system.
Architecture Diagram
The diagram below illustrates how these components interact in the production environment. The flow starts when a new Zillow inquiry arrives in Gmail and ends with the AI agent potentially sending an automated response.
flowchart TD
subgraph Gmail[Gmail Inbox]
email[Zillow Inquiry Email]
end
subgraph GCP[Google Cloud Platform]
topic[PubSub Topic]
sub[PubSub Subscription]
end
subgraph Backend[Backend Services]
api[FastAPI Endpoint]
prompt[Construct Prompt]
ai[OpenAI GPT-4]
doc[System Instructions<br/>Google Doc]
end
email --> topic
topic --> sub
sub --> api
api --> |Email Content| prompt
api --> doc
doc --> |Instructions| prompt
prompt --> ai
ai --> |Send Response| email
classDef primary fill:#4f46e5,stroke:#4f46e5,color:#fff
classDef secondary fill:#f3f4f6,stroke:#e5e7eb
classDef highlight fill:#3b82f6,stroke:#3b82f6,color:#fff
class email,topic,sub secondary
class api,prompt,ai primary
class doc highlight
System Components
1. Gmail Integration
- Gmail inbox monitors for new Zillow rental inquiry emails
- When a new email arrives, Gmail triggers a notification to Google PubSub
2. Google Cloud Platform
- A PubSub Topic receives Gmail notifications
- A PubSub Subscription processes these notifications and triggers our FastAPI endpoint
- System Instructions are stored in a Google Doc for easy editing by non-technical users
3. Backend Services
- FastAPI endpoint receives PubSub notifications
- Retrieves email content using Gmail API
- Fetches current System Instructions from Google Doc
- Constructs final prompt and calls OpenAI API
4. AI Agent
- GPT-4 model processes the email with provided instructions
- Has access to a "Send Email" tool function
- Can decide whether to send an automated response
- If appropriate, generates and sends response in real-time
Customization
The System Instructions stored in Google Docs can be updated at any time. Changes take effect immediately for all new incoming emails. This allows for quick adjustments to the AI's response style without requiring any code changes or deployments.
This documentation and architecture diagram were created with Cursor AI (Claude 3.5 Sonnet Model)