how to build a killer team of AI Agents (n8n masterclass)

By David Ondrej

Share:

Key Concepts

AI Agents, NA10, Workflow Automation, YouTube Pre-production, OpenAI API, Telegram Bot, System Prompts, Tools, Web Search, Image Generation, Script Generation, Title Generation, Hostinger VPS, API Keys, Google SER API, Google Drive Integration.

1. Defining the Scope of the Project

  • The initial step in building AI agents is defining the project's scope.
  • The example project automates YouTube pre-production, broken down into four workflows:
    • Research: Gathering information about the video topic.
    • Thumbnail: Designing thumbnails using OpenAI's image generation API.
    • Titles: Generating multiple title variations.
    • Script: Creating the video script, intro, and talking points.
  • The process can be replicated for any automation task by breaking it down into 3-5 stages and creating specialized AI agents for each.

2. Building the Main AI Agent Workflow in NA10

  • Creating a New Workflow: In NA10, a new workflow is created and named (e.g., "Main AI Agent").
  • Defining the Trigger: The trigger initiates the workflow. Examples include WhatsApp, Discord, email, or Telegram. In this case, Telegram is used, specifically the "on a message" trigger.
  • Understanding the NA10 UI: The UI consists of three parts: incoming data (left), the module processing the data (middle), and the output (right).
  • Setting up the Telegram Trigger:
    • A new credential is created to connect NA10 to Telegram.
    • NA10 provides documentation for setting up each trigger.
    • For Telegram, a new bot is created using BotFather.
    • The bot is named (e.g., "YouTube Genius") and given a unique username (e.g., "YouTubeNA10GeniusBot").
    • The access token provided by Telegram is copied and pasted into NA10.
    • The connection is tested to ensure it works.
    • A chat is started with the bot to test the automation.
  • Connecting to an AI Agent:
    • An AI agent module is added to the workflow.
    • The message from Telegram is passed to the AI agent.
    • The "Define Below" option is used to customize the user message.
    • The text variable from the Telegram trigger is dragged into the prompt.
    • A system prompt is added to define the AI agent's behavior (e.g., "You are a helpful assistant that helps the user automate his YouTube pre-production process").
  • Choosing an AI Model:
    • An AI model (e.g., OpenAI) is selected to power the AI agent.
    • An OpenAI API key is connected to NA10.
    • The API key is obtained from platform.openai.com.
    • A suitable model is chosen (e.g., GPT-4-turbo).
  • Adding an Output (Telegram):
    • A Telegram "send message" module is added to send the AI agent's response back to the user.
    • The chat ID is taken from the Telegram trigger.
    • The text is set to the output of the AI agent.
  • Testing the Workflow: The workflow is tested to ensure the AI agent can receive and respond to messages.

3. Hosting NA10 Agents with Hostinger VPS

  • NA10 agents need to be hosted online to run continuously.
  • Hostinger VPS is recommended for hosting NA10 agents.
  • The KVM2 plan is sufficient for hosting hundreds of AI agents.
  • A 12-month plan offers a discount, and the code "David" provides an additional 10% off.
  • The NA10 setup involves selecting a server location, choosing the pre-built NA10 template, and setting a root password.

4. Building the Research Agent Workflow

  • A new workflow is created for the research agent.
  • The trigger is set to "when executed by another workflow."
  • A field named "search query" is added to receive the search query from the main AI agent.
  • An AI agent module is added to process the search query.
  • The OpenAI model is selected (e.g., GPT-4-turbo).
  • The search query is passed as the user message.
  • A system prompt is added to instruct the agent to perform a detailed web search and format the answer as four paragraphs.
  • A Google SER API tool is added to enable web search.
  • A SER account is created, and the API key is connected to NA10.
  • The AI agent is instructed to use the SER API tool to browse the web.
  • The workflow is tested to ensure the research agent can successfully browse the web and return information.

5. Building the Thumbnail Agent Workflow

  • A new workflow is created for the thumbnail agent.
  • The trigger is set to "when executed by another workflow."
  • A field named "idea" is added to receive the video idea from the main AI agent.
  • An AI agent module is added to write an optimized image prompt based on the video idea.
  • The OpenAI model is selected (e.g., GPT-4-turbo).
  • A system prompt is added to instruct the agent to transform the video idea into a precise image generation prompt.
  • An HTTP request module is used to call the OpenAI image generation API.
  • The method is set to POST, and the URL is set to api.openai.com/v1/images/generations.
  • Authorization headers are added with the OpenAI API key.
  • The model is set to GPT-3 image generation, and the prompt is set to the output of the AI agent.
  • The image size is set to 1536x1024.
  • A "convert to file" module is used to convert the base64 string from the API response into a file.
  • A Google Drive module is used to upload the file to a specified folder.
  • The workflow is tested to ensure the thumbnail is generated and saved to Google Drive.

6. Building the Title Agent and Script Agent Workflows

  • New workflows are created for the title agent and script agent, following a similar structure to the research agent.
  • The title agent generates 10 SEO-optimized title variations based on the video idea.
  • The script agent writes a detailed intro, outline, and talking points for the YouTube video.
  • Pre-prepared prompts and configurations are used to save time.

7. Integrating All Agents into the Main Workflow

  • The main AI agent workflow is updated to call all four agents in sequence: research, thumbnail, title, and script.
  • The system prompt is updated to reflect the new workflow.
  • The workflow is activated and tested with a new video idea.
  • The complete pre-production output, including research summary, thumbnail, titles, and script, is received in Telegram.

8. Key Arguments and Perspectives

  • Automation Saves Time: Building AI agents can save significant time on repetitive tasks, such as YouTube pre-production.
  • Specialization Improves Performance: Breaking down tasks into smaller, specialized agents improves the overall performance and focus of the main AI agent.
  • Action is Essential: It's crucial to take action and build AI agents, even simple ones, to experience the benefits of automation.
  • AI is Evolving Rapidly: The capabilities of AI, particularly in areas like image generation, are rapidly improving, making it essential to stay informed and adapt.

9. Notable Quotes

  • "Don't try to learn everything and then get started. Get started first and then learn as you're building."
  • "This is the single source of truth of how it works. Every single software has documentation that tells you exactly what to do from the developers themselves."
  • "We are living in the future guys."

10. Technical Terms and Concepts

  • AI Agent: A software program designed to perform specific tasks autonomously using artificial intelligence.
  • NA10: A platform for building and automating workflows using AI agents.
  • Workflow: A sequence of automated tasks or processes.
  • Trigger: An event that initiates a workflow.
  • System Prompt: A set of instructions that define the behavior of an AI agent.
  • LLM (Large Language Model): The brain of the AI agent, responsible for processing and generating text.
  • API (Application Programming Interface): A set of rules and specifications that allow different software systems to communicate with each other.
  • VPS (Virtual Private Server): A virtualized server that provides dedicated resources for hosting applications.
  • SER API: An API for accessing search engine results.
  • Base64: A binary-to-text encoding scheme used to represent binary data in ASCII string format.

11. Synthesis/Conclusion

The video provides a comprehensive guide to building a team of AI agents for automating YouTube pre-production using NA10. It covers defining the project scope, setting up workflows, connecting to AI models and APIs, and hosting the agents online. The key takeaway is that by breaking down complex tasks into smaller, specialized agents, significant time savings and improved efficiency can be achieved. The video emphasizes the importance of taking action and building AI agents to experience the benefits of automation and stay ahead in the rapidly evolving AI landscape.

Chat with this Video

AI-Powered

Load the transcript when you're ready to chat so the initial page stays lighter.

Ready to summarize another video?

Summarize YouTube Video