Sunday, October 12, 2025

Constructing an AI Agent Tutorial – Half 1

Using the time period “AI Agent” has elevated by 10x within the final 1 12 months, as per knowledge from Google Traits. This surge displays a broader shift: folks and organizations more and more need AI Methods that not solely reply questions, but in addition take actions on their behalf. From simplifying mundane duties to streamlining enterprise operations, the promise of Agentic AI is capturing international consideration.

AI Agents trend
Development for AI Agent over time (Picture: Google Traits)

So, what does this actually imply in follow? Let’s begin with a relatable situation of how AI Brokers can rework on a regular basis duties within the close to future. Think about planning for a trip, which entails reserving resorts, flights, and rental vehicles. Right this moment, this course of is fragmented and time-consuming. In an Agentic AI world, nonetheless, we might merely present a easy immediate that may generate tailor-made journey packages, full with itineraries, eating places, and bookings.

Right here is an instance immediate that might work in such a situation:

“I wish to e-book a household journey with 2 youngsters within the months of June/July for a weekend plus 2 days. Don’t embrace the 2nd week and third week of June. I’d simply want to hold two cabin luggage, and like tasting the perfect native meals. Plan for an itinerary not longer than 2-3 hours drive from town.”

On this article, we are going to transcend the buzzword that’s AI Brokers. You’ll first perceive the basics of AI Brokers after which discover the platforms that make them doable. Lastly, we are going to construct a hands-on challenge: a YouTube Summarizer Agent utilizing the Phidata framework. By the tip, you’ll know what Agentic AI is and the best way to begin constructing one with the SOTA instruments.

Observe: That is the primary article in a two-part sequence on constructing AI Brokers from the bottom up. On this article, we are going to discover the worth of AI Brokers, introduce in style Agentic AI platforms, and stroll by means of a hands-on tutorial for constructing a easy AI Agent. The subsequent a part of the sequence will dive deeper with a hands-on tutorial. There, we are going to construct Brokers that may automate duties and work together with exterior instruments and APIs.

Fundamentals of AI Brokers

In easy phrases, AI Brokers are techniques that may carry out duties autonomously by decoding the information from the surroundings. AI brokers could make choices based mostly on that knowledge to attain the objectives. Consider them as orchestrators, connecting varied instruments, utilizing Giant Language Fashions (LLM) to motive, plan, and execute duties. For an in depth introduction to LLMs, you possibly can check with this text.

Let’s break down this definition utilizing the above trip planning instance:

  • Carry out duties autonomously: Ebook flight, lodge, and rental automotive reservations by means of the respective distributors.
  • Deciphering the information: Account for elements like climate, visitors, and native occasions to counsel the perfect actions that match the tempo.
  • Making choices: Think about there are dozens of eating places obtainable, Brokers can present suggestions based mostly on the indicated choice and previous critiques.
  • Obtain objectives: Put collectively a journey plan that matches the necessities – dates, period, preferences, and household wants.

Agentic AI Platforms

An Agentic AI framework is a toolkit that permits the creation of AI techniques able to reasoning, planning, and taking actions autonomously or semi-autonomously by means of instrument use and reminiscence. In brief, these frameworks present the construction wanted to create brokers.

There are a number of in style Agentic AI platforms, similar to LangChain, CrewAI, and Phidata. For this tutorial, we are going to use Phidata – a light-weight and developer-friendly platform. Phidata comes with built-in entry to a wide range of instruments and LLMs. This enables us to construct and deploy AI Brokers inside only a few strains of code.

built-in Tools and Model wrappers in Phidata
Fashionable built-in Instruments and Mannequin wrappers in Phidata (For a full listing, hyperlinks right here – Fashions, Instruments.)

Construct a YouTube summarizer Agent

The YouTube Summarizer Agent is designed to extract key insights and details from any YouTube video. It saves time by offering concise summaries while not having to look at your entire content material. For the aim of the tutorial, we are going to use Google Colab pocket book to jot down and execute the code and Phidata Agentic AI Platform to energy the Agent.

Mannequin: Inside Phidata, we are going to leverage the Groq mannequin internet hosting platform. It’s an inference service that runs LLMs on a devoted GPU infrastructure. Observe that it’s totally different from Grok, which is an LLM from xAI. Since LLMs are resource-intensive, utilizing Groq helps to dump computation from the native {hardware} or Colab-provided {hardware}. This ensures sooner and extra environment friendly execution. Groq has entry to a number of fashions from totally different LLM suppliers. (see full listing right here)

Instruments: To retrieve YouTube video knowledge, we are going to use the built-in Instrument from the Phidata framework (known as YouTube Instruments). This instrument helps us entry video metadata and captions. The agent then passes these to the chosen LLM to generate correct and insightful summaries.

Right here is the code for a YouTube summarizer agent:

from phi.agent import Agent from phi.mannequin.groq import Groq from phi.mannequin.openai import OpenAIChat from phi.instruments.youtube_tools import YouTubeTools agent = Agent(     # mannequin=Groq(id="llama3-8b-8192"),     mannequin=Groq(id="llama-3.3-70b-versatile"),  ## Toggle with totally different LLM mannequin     instruments=[YouTubeTools()],     show_tool_calls=True,     # debug_mode=True,     description="You're a YouTube agent. Get hold of the captions of a YouTube video and reply questions.", ) agent.print_response("Summarize this video https://www.youtube.com/watch?v=vStJoetOxJg", markdown=True, stream=True)

Following is the output generated by the YouTube Summarizer agent (above code). The YouTube hyperlink within the above code is a video of Andrew Ng on the Machine Studying specialization. As proven under, it precisely summarizes the video content material. Observe that the response could differ for every run due to the probabilistic nature of LLMs.

YouTube Summarizer Output

Detailed Tutorial

Listed below are the step-by-step directions for creating the YouTube Summarizer agent.

1. Clone Pocket book

  • Clone Colab pocket book right here (it requires a Google account)
  • Set up dependencies (first cell with code)

2. Get API key for Groq

As a way to run the Agent, on condition that we use the Groq mannequin internet hosting platform, we want an account with Groq. Observe the steps under to enroll / log in to Groq and get an API key.

– Go to the Groq Developer Portal: Open your browser and go to: https://console.groq.com

– Signal Up or Log In

  • If you have already got an account, click on Log In.
  • If you happen to’re new, click on Signal Up and observe the prompts to create an account (chances are you’ll must confirm your e-mail).

– Entry the API Part

  • As soon as logged in, you’ll land on the Groq Console.
  • Navigate to the API Keys part from the sidebar or dashboard.

– Generate a New API Key

  • Click on the “Create API Key” button.
  • Give your key a reputation (e.g., “workshop-key”).
  • Click on Create or Generate.

– Copy and Retailer the Key Securely

  • Your API key might be proven solely as soon as — copy it instantly and retailer it in a safe location.
  • By no means expose your API key in client-side code or public repositories.

3. Add the API key within the Secret Supervisor

  • Click on on Secrets and techniques (Key signal) on the left pane of Colab
  • Present the identify as GROQ_API_KEY and the Worth because the API Key copied in Step 5 above
  • Toggle “ON” the pocket book entry.

Conclusion

On this article, we explored the rising demand for an AI Agent and walked by means of a real-world instance of how they will simplify on a regular basis duties. We broke down the basics of AI Brokers and a few in style Agentic AI Frameworks. We additionally constructed a hands-on challenge: a YouTube Summarizer Agent powered by Phidata.

That is only the start. Within the second article of this sequence, we are going to go deeper by constructing a examine planner agent that doesn’t simply generate plans but in addition takes actions. It is going to create duties in Jira, ship calendar invitations, and exhibit how AI Brokers can seamlessly combine with exterior instruments and APIs to automate real-world workflows.

Take a look at the half 2 of this sequence right here – Constructing Research Planner Agent: AI Agent Tutorial Half 2

Co-Writer for the article: Abhishek Agrawal

Praveen is a seasoned Information Scientist, with over a decade of expertise in analytics. He has tackled complicated enterprise challenges and pushed innovation by means of data-driven resolution making. His experience spans throughout areas similar to Machine Studying, Statistics, and Scalable Analytics, serving to to launch a number of revolutionary merchandise.

Login to proceed studying and revel in expert-curated content material.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles