Sunday, 16 November 2025

How to Create An AI Agent to send Email





Step 1 Register at n8n.com

Step 2 on your Dashboard click create work flow





Step 3 Click on + Open Node Agent

select Ai AGent




Then click outside the canvas 



Then Save




1. Chat Model

A chat model is the core AI engine that generates responses during a conversation.
It’s a large language model trained on vast amounts of data so it can understand questions, follow instructions, and provide helpful, human-like answers.

Key Characteristics of a Chat Model

  • Understands natural language (text inputs)

  • Generates context-aware responses

  • Can reason, summarize, explain, and create content

  • Adapts to conversation flow

  • Does not store personal information unless explicitly allowed

What a Chat Model does

  • Responds to prompts

  • Maintains conversation context

  • Performs tasks like writing, coding, explaining, solving problems

2. Memory

Memory allows an AI system to remember important user preferences across conversations—but only when the user explicitly wants it saved.

How Memory Helps

  • Saves user preferences (tone, style, recurring details)

  • Remembers ongoing projects or long-term goals

  • Makes future responses more personalized

What Memory Does NOT Do

  • It does not store personal details without permission

  • It does not automatically remember everything

  • It does not keep sensitive information unless the user clearly requests it

Examples of Memory

  • “Remember I prefer short answers.”

  • “Remember my business name is CloudWave Tech.”

3. Tools

Tools are extensions that the chat model can call to perform specialized tasks.
They allow the model to go beyond text generation and interact with systems, APIs, or external capabilities.

Why Tools Matter

Tools expand what AI can do. They let the model:

  • Access real-time information (web search tools)

  • Generate images

  • Analyze code or run environments

  • Create documents (PDF, Word, Excel)

  • Use APIs for specific workflows

Examples of AI Tools

  • Web browsing tool: fetches up-to-date information

  • Python sandbox: executes code securely

  • Image generation tool: creates images based on prompts

  • Document generation tool: outputs PDFs, slides, spreadsheets

  • Developer tools: run code snippets, test scripts, debug

How Tools Work

The chat model detects when a tool is needed → calls the tool → receives the result → integrates it into the final answer.


In Simple Terms

ComponentPurposeAnalogy
Chat ModelBrain that thinks and respondsA smart assistant
MemorySaves preferencesA planner that remembers your style
ToolsSpecial abilitiesApps the assistant can use



Step 4 Click on chat model and select a chat model : we use openAi for this lab

N8N gives you free 100 OpenAI credits. Click Claim free credits to get it 



We will skip creating credentials for now. Click outside the canvas to go back to work flow




Next is to setup memory... click on + under memory
Select Simple Memory




You can increase the context window

A context window is the amount of text or information an AI model can “hold in mind” at one time during a conversation. It includes the user’s messages, the AI’s replies, and any additional data provided.

The larger the context window, the more the AI can remember within a single session—allowing it to follow long conversations, understand complex documents, and maintain continuity. Once the limit is exceeded, older parts of the conversation roll off and the model can no longer reference them directly.


Now this is enough to Test



Hit the Play Button, And ask the AI AGENT A Question, And it will respond

Step 5 Next Connect the Agent to a Tool...Click the + below Tool



Select Gmail...


Connect your Gmail credential select Oauth2, Sign in with Google and select your Account. Let the Agent define the To field, Subject and Message.

Go back to your Workflow, And Open chat and ask the AI to send a mail 



It works

No comments:

Post a Comment

How to Use AI Effectively: The A.I.M. Framework (Actor • Intent • Mission)

  Using AI isn’t just about typing prompts — it’s about thinking strategically so the AI can produce its best work for you. Whether you...