How adhi1213/my-n8n-ai-agent works
Project type and purpose
• This is not a traditional code repo but an n8n “no-code” workflow export.
• Purpose: automatically read incoming Gmail threads, maintain conversational memory, generate AI-driven replies via Google Gemini, and post replies back to Gmail.
Main components
a. n8n Orchestration Platform
• Represents the runtime where all nodes execute.
b. Gmail Trigger Node
• Listens for new messages or replies in the user’s Gmail inbox via the Gmail API.
c. Simple Memory Node
d. Google Gemini Chat Node
• Invokes the Google Gemini Chat API, passing incoming message + memory context, and receives an AI-generated response.
e. Gmail Send Node
• Uses the Gmail API to post the generated response back into the same thread.
f. External Services
• Gmail API (with OAuth2 credentials)
• Google Gemini Chat API (with API key / OAuth credentials)
Relationships and data flows
• Trigger → Memory lookup → Chat request → Memory update → Send reply
Architectural patterns and design principles
• Event-driven workflow: Components react to incoming email events.
• Integration orchestration: n8n acts as the glue between Gmail and Gemini.
• Stateful vs stateless: Memory Node introduces minimal statefulness; other nodes remain stateless.
• No-code modularity: each piece of functionality is encapsulated in its own node.
Relevant technologies and frameworks
• n8n (workflow engine)
• Gmail API (trigger and send)
• Google Gemini Chat Model (AI service)
• Simple Memory Node (state storage)