[{"data":1,"prerenderedAt":255},["ShallowReactive",2],{"blog-article-/blog/i-built-my-own-ai-agent-and-you-can-too":3,"blog-surround-/blog/i-built-my-own-ai-agent-and-you-can-too":246},{"id":4,"title":5,"body":6,"canonical":233,"date":234,"description":12,"extension":235,"featured":236,"image":237,"meta":238,"navigation":239,"ogImage":237,"path":240,"provider":237,"published":239,"seo":241,"stem":242,"tags":243,"url":237,"__hash__":245},"blog/blog/i-built-my-own-ai-agent-and-you-can-too.md","I Built My Own AI Agent using n8n — And You Can Too",{"type":7,"value":8,"toc":216},"minimark",[9,13,16,21,24,40,43,47,50,53,64,67,71,74,79,90,94,101,105,108,112,115,123,126,137,141,144,148,151,157,161,164,167,170,176,179,183,186,200,203,207,210,213],[10,11,12],"p",{},"I recently built my own AI agent. Not because I needed one, but because I wanted to see how far I could take the current tools available. It turned out to be surprisingly straightforward, extremely flexible, and genuinely useful.",[10,14,15],{},"This post will show you what the agent can do and how you can build your own using n8n, without needing to write much code.",[17,18,20],"h2",{"id":19},"what-my-agent-can-do","What My Agent Can Do",[10,22,23],{},"The agent runs as a simple chat interface where I can ask it different questions and request actions. For example:",[25,26,27,31,34,37],"ol",{},[28,29,30],"li",{},"Ask for the weather in a city.",[28,32,33],{},"Get my current YouTube subscriber count.",[28,35,36],{},"Check my recent running stats from Strava.",[28,38,39],{},"Have it send me an email containing a summary of the full conversation.",[10,41,42],{},"This is not necessarily something you must have, but it is a great demonstration of what is possible when you combine multiple data sources and let an AI model reason across them.",[17,44,46],{"id":45},"the-tool-i-used-n8n","The Tool I Used: n8n",[10,48,49],{},"I built everything using n8n, a visual workflow automation tool. It allows you to drag and drop nodes to create automation steps, including AI reasoning steps.",[10,51,52],{},"One workflow contains:",[25,54,55,58,61],{},[28,56,57],{},"A chat trigger",[28,59,60],{},"A large language model (Gemini in my case, but OpenAI also works)",[28,62,63],{},"Tools such as:\n• YouTube API statistics\n• Strava activity data\n• Weather API queries\n• GitHub issues\n• Gmail actions (send summaries, notifications, etc)",[10,65,66],{},"One important component is conversation memory, which allows the agent to recall previous messages in the chat.",[17,68,70],{"id":69},"step-by-step-quick-start-guide","Step-by-Step Quick Start Guide",[10,72,73],{},"Follow these steps to create your first simple agent.",[75,76,78],"h3",{"id":77},"step-1-create-an-n8n-account","Step 1: Create an n8n Account",[10,80,81,82,89],{},"Go to ",[83,84,88],"a",{"href":85,"rel":86},"https://n8n.io/",[87],"nofollow","https://n8n.io"," and create a free account. You do not need to enter payment details to start.",[75,91,93],{"id":92},"step-2-create-a-new-workflow","Step 2: Create a New Workflow",[10,95,96,97],{},"Inside n8n, click Workflows and choose New Workflow or use a template for free like the one I used: ",[83,98,99],{"href":99,"rel":100},"https://n8n.io/workflows/6270-build-your-first-ai-agent/",[87],[75,102,104],{"id":103},"step-3-add-a-chat-trigger","Step 3: Add a Chat Trigger",[10,106,107],{},"Search for AI Chat Trigger and add it to your workflow. This will provide the public chat interface URL.",[75,109,111],{"id":110},"step-4-add-an-ai-model-node","Step 4: Add an AI Model Node",[10,113,114],{},"Search for Google Gemini or OpenAI Chat Model.",[10,116,117,118,122],{},"You will need:\n• A Google Cloud key (if using Gemini) ",[83,119,120],{"href":120,"rel":121},"https://console.cloud.google.com/",[87],"\n• Or an OpenAI key (if using GPT models)",[10,124,125],{},"Set a system prompt, such as:",[127,128,133],"pre",{"className":129,"code":131,"language":132},[130],"language-text","You are a personal assistant that can answer questions and use tools when needed.\n","text",[134,135,131],"code",{"__ignoreMap":136},"",[75,138,140],{"id":139},"step-5-add-conversation-memory","Step 5: Add Conversation Memory",[10,142,143],{},"Search for Memory and connect it to your agent. This allows your agent to remember context across multiple messages.",[75,145,147],{"id":146},"step-6-add-your-first-tool-example-weather-api","Step 6: Add Your First Tool (Example: Weather API)",[10,149,150],{},"Search for HTTP Request. Set a request such as:",[127,152,155],{"className":153,"code":154,"language":132},[130],"GET https://api.open-meteo.com/v1/forecast\n",[134,156,154],{"__ignoreMap":136},[75,158,160],{"id":159},"step-7-save-and-activate-the-workflow","Step 7: Save and Activate the Workflow",[10,162,163],{},"Click Save and then toggle the workflow to Active.",[10,165,166],{},"Copy the chat URL and open it in your browser.",[10,168,169],{},"Ask your agent something like:",[127,171,174],{"className":172,"code":173,"language":132},[130],"What is the weather right now in Palma?\n",[134,175,173],{"__ignoreMap":136},[10,177,178],{},"You just built your first agent.",[17,180,182],{"id":181},"expanding-with-more-tools","Expanding with More Tools",[10,184,185],{},"Once the foundation is set, add tools one at a time. Examples from my workflow:",[25,187,188,191,194,197],{},[28,189,190],{},"YouTube Data API to fetch subscriber counts",[28,192,193],{},"Strava API to retrieve recent runs",[28,195,196],{},"GitHub API to check open issues",[28,198,199],{},"Gmail node to send email summaries",[10,201,202],{},"Each tool is added as a separate node. Connect it as a tool to the AI model. Test each step individually before chaining them.",[17,204,206],{"id":205},"final-thoughts","Final Thoughts",[10,208,209],{},"Building an AI agent today does not require advanced development skills. The hardest part is usually obtaining and configuring API credentials. Once those are set, everything becomes easier.",[10,211,212],{},"Experiment, try small ideas, and let your agent grow naturally as new needs appear.",[10,214,215],{},"If you build one, I would be interested in hearing how it went and what use cases you explored.",{"title":136,"searchDepth":217,"depth":217,"links":218},2,[219,220,221,231,232],{"id":19,"depth":217,"text":20},{"id":45,"depth":217,"text":46},{"id":69,"depth":217,"text":70,"children":222},[223,225,226,227,228,229,230],{"id":77,"depth":224,"text":78},3,{"id":92,"depth":224,"text":93},{"id":103,"depth":224,"text":104},{"id":110,"depth":224,"text":111},{"id":139,"depth":224,"text":140},{"id":146,"depth":224,"text":147},{"id":159,"depth":224,"text":160},{"id":181,"depth":217,"text":182},{"id":205,"depth":217,"text":206},"https://dev.to/debs_obrien/i-built-my-own-ai-agent-and-you-can-too-56l1","2024-11-06","md",false,null,{},true,"/blog/i-built-my-own-ai-agent-and-you-can-too",{"title":5,"description":12},"blog/i-built-my-own-ai-agent-and-you-can-too",[244],"ai","eu7Zrv7twv5-wRMteZQDd3Hcbi5W1aHt9wUeEJe_CaA",[247,251],{"title":248,"path":249,"stem":250,"children":-1},"Fixing Failing Tests Automatically with Playwright's New Healer Agent","/blog/fixing-failing-tests-automatically-with-playwrights-new-healer-agent","blog/fixing-failing-tests-automatically-with-playwrights-new-healer-agent",{"title":252,"path":253,"stem":254,"children":-1},"Playwright Agents Planner, Generator, and Healer in Action","/blog/playwright-agents-planner-generator-and-healer-in-action","blog/playwright-agents-planner-generator-and-healer-in-action",1790839746452]