Tired of Long YouTube Videos? Build Your Own AI Video Summariser!

Table of contents

Introduction
Ever find yourself staring at a lengthy YouTube video, wishing you could just get the gist? Well, what if I told you that you can build your own AI-powered video summariser in just a few steps?
So I recently embarked upon this exact journey using the awesome tools available on Relevance AI, and the results were very good!
TLDR; here’s a sneak peek into the process before we go into detail on how it was implemented:
Input: create a simple text input field in Relevance AI to input the YouTube video URL.
ID Extraction: create a JavaScript step to automatically extract the unique video ID from the provided URL.
Transcript Retrieval with Supadata’s API: The heart of the summarisation lies in the transcript. We leverage the supadata.ai API through an API step to fetch the complete transcript of the YouTube video. This API is just one of the many services you can use to access the transcript of YouTube videos.
From JSON to Text: The transcript from supadata.ai comes in a structured JSON format. Another JavaScript step is used to parse this data, extracting all the individual text segments and concatenating them into a single readable text of the whole transcript ready for the LLM to ingest.
Summarisation with a LLM: Finally, an LLM (Large Language Model) step is used to analyse the complete transcript and generate a concise and informative summary of the whole YouTube video and it does a pretty good job at that!
The beauty of this approach is its simplicity and the power it puts in your hands. By combining the intuitive interface of Relevance AI with the capabilities of supadata.ai and a powerful LLM, you can quickly build a tool to save yourself valuable time and effortlessly understand the essence of any YouTube video.
So keep reading if you’re interested in building this yourself!
Get Started
Let's dive into the step-by-step guide to creating your very own AI-powered YouTube video summariser using Relevance AI.
Follow these steps to set up your workflow in Relevance AI:
Create an account on Relevance AI and follow the steps to create your organisation etc. Once you’ve done that, you’ll be redirected to the dashboard where you can access all the different features of Relevance AI. Notably, you want to focus on the Workforce section where you have access to Agents and Tools.
Creating a Tool
Now click on the Tools tab on the left to access tools and you should see the following page:
Click on the New Tool button to create a new tool with the following information filled out within the Input node:
In this step here, we’re basically creating a text input that takes in the YouTube video URL and that will be automatically supplied by the LLM when it executes this tool as the user interacts with it and gives the LLM the video URL via the agent’s chat. We will see this later on.
The next step in the flow is to create a JavaScript step node which can extract the video ID from the URL provided as that is needed to interact with the Supadata API in the next step. Click on the plus button underneath the Input node and search for “Javascript Code” and select it:
Write down this piece of code inside the code editor shown above:
const urlObject = new URL(params["youtube_url"]);
const videoId = urlObject.searchParams.get('v');
return { data: videoId };
This code here essentially takes the provided URL and extracts the video ID from the URL via a query parameter. Query parameters are basically key value pairs in a URL which are denoted by ?key=value&another_key=value
. So let’s say you have the following YouTube video URL: https://www.youtube.com/watch?v=97xvcAMf888
, you can see query parameters start from the ?
symbol. So we only have a single query parameter which is the letter v
and the value for it is 97xvcAMf888
. This is how to get the YouTube video ID from a URL. So once we’ve extracted the query parameter successfully, we then send data back from this step node as JSON to the next node so it has a reference to the video ID.
The next step is the API node so click on the plus button under the previous JavaScript step node and search for “API Request” and select it:
Before we fill in this node, go to https://supadata.ai/ and create an account, you’ll have a free subscription with a limited number of requests every month to use the YouTube transcript API. Once you’ve created an account and you’re in the dashboard, choose the free subscription and you’re dashboard should look similar to this:
So now click on the free subscription and head to the “Access keys” section and click on the plus button to create a new API key:
Give the key a name and click the button to generate an access key.
Now your key should have been generated successfully. Now scroll down to the “Access keys” section and click on the “eye” icon to view your API key:
Copy that key and head back to Relevance AI. Now add the following info to the API node:
Method: GET
URL:
https://api.supadata.ai/v1/youtube/transcript?videoId={{ extract_youtube_video_id.transformed.data }}
. Make sure to type down the variable right after the=
sign as you should see a popup to help you auto-fill it. These variables allow you to obtain data from previous steps dynamically.Headers: enter
x-api-key
as a header and provide the API key you copied earlier from supadata.ai as the value for this header. The reason for this is that some APIs require authentication to verify who the user is. So by you creating an account and generating an access key, the platform will allow you to make requests to their API successfully limiting you to the number your subscription tier allows.
Once you’ve filled out the info, it should roughly look like this (I’ve hidden my API key within the screenshot):
Now create another step node and search for “Javascript Code” again and add it:
Copy the following code and paste it in the editor:
// Accessing the response body from the previous step
const fullTranscriptText = steps["youtube_transcript_api"].output["response_body"].content
.map((item) => item.text)
.join(" ");
return { data: fullTranscriptText };
So what we are doing here is that the supabase.ai API returns to us data in the form of JSON and the whole transcript is split into different segments. What we need to do is take all those segments and combine it into one piece of text so that it is easily ingestible by our LLM. We then return that data for the next node to use.
Now this is the last step in creating our tool. Add another step node and search for “LLM” and add it to the flow:
Copy and paste the following prompt for the LLM step node:
You are a highly skilled summarisation assistant. Your task is to read and analyse a full transcript from a YouTube video and produce a clear, concise, and accurate summary.
Please follow these guidelines:
1. Purpose: Provide a summary that captures the main ideas, arguments, and key takeaways from the video.
2. Tone: Maintain a neutral, informative tone. Avoid personal opinions, emotional language, or filler words.
3. Length: The summary should be between 500-1000 words, unless otherwise specified.
4. Format:
- Start with a one-sentence overview of the video's general topic or goal.
- Follow with a structured breakdown of major points, listed in the order they appeared in the video in a bullet pointed fashion.
- End with a brief conclusion or insight if the video offers one.
5. Details to include (when applicable):
- Names of people, organisations, or products mentioned
- Dates, statistics, or key facts
- Solutions, steps, or arguments presented
- Examples used to illustrate a point
6. Do not include:
- The speaker's verbal tics (e.g., "um," "you know")
- Repetitive content unless it's emphasised for effect
- Direct quotes unless they are essential
Use the following transcript: {{ extract_video_transcript_text.transformed.data }}
Now in the model dropdown, select the AI model of your choice. At the time of writing, I chose Gemini 2.5 Pro Experimental which is free to use so I didn’t need supply an API key for it. And that’s the last thing we needed to do to finish creating this tool. Click on the “Publish changes” button to publish your tool for use. Well done for getting to this point! 👍.
Now you can go to the “Use” tab on top of the page and test out your tool by entering any YouTube video URL to summarise it for you. Give it a go!
Creating an Agent
Now go back to the Relevance AI dashboard and click on the “Agents” tab on the left.
Click on the “New Agent” button and you will be taken to the following page:
Fill in the information for the Agent profile and then move onto the “Core instructions” tab:
Here we’ll enter the system prompt for our AI Agent so we can give it a persona and give it a role, as well as instruct it with a task and give it context into what its purpose is. With this kind of structure in place, you can get much better results with LLMs. Also make sure to select GPT 4o mini. At the time of writing, it’s the most cheapest option and doesn’t consume as many credits as the other models available.
So once you’ve done this, go to the “Tools” tab on the left and make sure to add/select the tool we created earlier on. If it’s not already there then add the tool by clicking on the button shown there:
Now all that’s left is to publish the changes and your AI Agent is complete.
When you go back to the agent, you should see the following:
Now you can click on the “Share” button and enable the option “Publicly available”. You can then copy the “Shareable link” to interact with your agent in a chat interface where you can test your Agent for real.
And now this brings us to the end of this tutorial. Thank you for taking the time to read through all this. I hope you enjoyed it and well done on reaching the end!
Conclusion
You can see the power of AI Agents and this tutorial here was only the tip of the iceberg. You can build even more powerful and sophisticated AI Agents that integrate with even more APIs and systems to build truly agentic experiences.
If you’d like to see more of this, let me know! Also don’t forget to follow me on hashnode for more content!
Subscribe to my newsletter
Read articles from Tanvir Ahmed directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

Tanvir Ahmed
Tanvir Ahmed
Hi, I'm a Senior Full-Stack Software Engineer from the UK with a passion for building impactful software. With 7+ years of experience working with companies across the UK (hybrid + remote) and the US (remote), I've had the opportunity to contribute to some fascinating projects. These include: Developing a digital eBMR platform to help scientists in Cell & Gene Therapy labs. Creating web applications for the exciting world of Web3, integrating with Ethereum and Algorand. Building APIs for the Renewable Energy sector that even helped generate around £3,000 per month in revenue. I also love contributing to open-source and working on different types of projects to learn new things and improve my skill-set as a Software Engineer.