Building Your Personal AI Assistant with n8n (Part 3)

· Manuel · 35 min read · Artificial Intelligence

We all know ChatGPT. You type, it types back. It’s a miracle of modern technology. But let’s be honest: Chatting is passive.

You ask ChatGPT to "schedule a meeting," and it says: "I can't access your calendar, but here is a template you can use." That is useful, but it isn't an Agent.

An Agent has arms and legs. An Agent doesn't just talk; it do. In Part 3 of our n8n Masterclass, we are crossing the Rubicon. We are going to take a Large Language Model (LLM) and give it the ability to control your software tools.

We are building a Personal Executive Assistant that doesn't sleep, doesn't drink your coffee, and costs $0.05 per day to run. It will live in Telegram (or Slack), understand natural language commands, and actually execute tasks in Google Calendar and Gmail.

This is the future of interface design. No more clicking buttons. Just pure intent.

Related Reading

The Theory: Tools & Reasoning

To build an Agent, you need to understand the "ReAct" (Reasoning + Acting) loop.

1. User Component: "Book a call with Sarah for next Tuesday at 2pm." 2. Reasoning Engine (LLM): The AI thinks: "I need to check the calendar first to see if 2pm is free. Then I need to create the event." 3. Tool Execution: The AI calls the `check_calendar` tool. 4. Observation: The tool returns: "Tuesday 2pm is booked." 5. Reasoning (Again): The AI thinks: "Okay, I should check 3pm." 6. Response: "2pm is taken, but 3pm is free. Shall I book that?"

In n8n, we don't need to code this loop from scratch. The AI Agent Node handles the heavy lifting. We just need to assess the Tools.

The Tech Stack

Here is what we are using today:

  • Brain: OpenAI GPT-4o (via API).
  • Interface: Telegram (Free, fast, mobile-friendly).
  • Memory: Window Buffer Memory (so it remembers context).
  • Tools: Google Calendar, Gmail, and Calculator.

Why Telegram? Because you always have your phone. Sending a voice note to your AI assistant while driving ("Hey, remind me to email John when I get home") is the ultimate productivity hack.

Step 1: The Telegram Trigger

1. Search for Telegram Trigger. 2. Talk to `@BotFather` on Telegram to create a new bot and get a Token. 3. Paste the Token into n8n credentials. 4. Listen for content: "Text" or "Voice".

Pro Tip: Secure your bot! In the trigger settings, add your specific `Chat ID` to the "Allowed Updates" filter. You don't want random people finding your bot and deleting your calendar events.

Step 2: The AI Agent Node

This is the captain of the ship. 1. Add an AI Agent node. 2. Model: Connect an "OpenAI Chat Model" node. Select `gpt-4o`. 3. Memory: Connect a "Window Buffer Memory" node. Set it to the last 10 messages. 4. System Prompt: This is crucial. > "You are a helpful Executive Assistant named Jarvis. You have access to the user's calendar and email. You should always check for conflicts before booking. Be concise."

Now, the magic part: Tools.

Step 3: Building Custom Tools

We need to teach the AI how to use Google Calendar.

Tool A: Get Calendar Events 1. Add a Google Calendar node. 2. Operation: "Get Many". 3. Connect it to the "Tools" input of the AI Agent. 4. Important: You must define the Tool Description clearly so the AI knows when to use it. - Name: `get_calendar` - Description: "Call this to check for existing events properly. Requires 'start_time' and 'end_time'."

Tool B: Create Calendar Event 1. Add another Google Calendar node. 2. Operation: "Create". 3. Name: `create_event` 4. Description: "Creates a new meeting. Requires 'summary', 'start_time', 'email_attendees'."

Tool C: The Calculator LLMs are bad at math. 1. Add a Calculator node. 2. Connect it as a tool. 3. Now if you ask "What is 5% of my last invoice?", the AI will hand off the math to the calculator tool instead of hallucinating.

Step 4: The Vector Store (RAG)

Let's level up. What if you want to ask: "How much do we charge for SEO services?" The AI doesn't know your pricing. We need RAG (Retrieval Augmented Generation).

1. Add a Vector Store Tool. 2. Upload your "Pricing_Guide.pdf" to a Pinecone or Qdrant vector database. 3. Connect this as a tool named `consult_pricing`.

Now, when you ask about pricing, the AI will: 1. Recognize it needs external info. 2. Search your PDF. 3. Retrieve the paragraph about SEO pricing. 4. Answer you accurately. This turns your AI from a generic assistant into a company expert.

Step 5: Testing the Beast

Activate the workflow. Open Telegram.

User: "Do I have any meetings today?" Jarvis (AI): (Calls `get_calendar`) "Yes, you have lunch with Client X at 12pm."

User: "Great. Schedule a follow-up with them for tomorrow at 10am." Jarvis: (Calls `create_event`) "Done. I've sent an invite to Client X for tomorrow at 10am."

User: "Also, create a draft email to them summarizing our offer." Jarvis: (Calls `gmail_draft`) "Draft created."

You have just completed massive administrative work with three text messages.

The Future of Work

This is not sci-fi. This is n8n today. By building these agents, you are effectively cloning yourself. You are removing the friction between "Thought" and "Action."

In Part 4, we are going to look at Advanced Workflows. We'll cover Sub-Workflows, Loops, and how to process thousands of records without crashing your server.

Go build your Jarvis.

Related articles