
End-to-end AI email agent that ingests incoming Gmail, classifies intent with an LLM, enriches threads with live customer data (Postgres/Aurora, internal HTTP APIs, Stripe, CRM), retrieves FAQ context from Qdrant (RAG with Bedrock embeddings), and uses an Email Analysis Agent on AWS Bedrock to draft replies or trigger escalation—human-in-the-loop by default (Gmail drafts, not auto-send). Orchestrated in n8n on Dockerized AWS EC2 with a modular, replaceable-node design.
What I built
Gmail trigger opens an n8n workflow on AWS (Docker on EC2, Docker Compose for services) that runs the full pipeline from classification to draft or escalation.
LLM classification splits simple vs complex paths; conditional routing sends complex cases through a data-enrichment layer instead of duplicating truth in a new database.
Enrichment pulls real-time context from Postgres/Aurora, internal and external HTTP APIs, Stripe (payments), CRM, and semantic FAQ retrieval from Qdrant.
RAG: static knowledge embedded into Qdrant; queries embedded with Bedrock; the model blends retrieved FAQs with customer-specific context for accurate, personalized wording.
Bedrock-backed Email Analysis Agent interprets the thread, merges retrieval + live data, and uses structured parsers for reliable downstream actions.
Decision layer: escalation notifies internal teams, labels mail, and emails the customer when needed; otherwise a draft is created in Gmail for human review.
Designed and shipped end-to-end across infrastructure (EC2, IAM, networking, Bedrock, Qdrant ingestion) and automation (n8n design, API wiring, validation).
Tech & stack
Screenshots
n8n workflow canvas: Gmail trigger → LLM intent classification → conditional routing → enrichment (HTTP, SQL, Stripe, vector search) → Bedrock email agent → Gmail drafts, labels, and escalation branches.
