- Tubelator AI
- >
- Videos
- >
- Science & Technology
- >
- Step-by-Step AI Agent Tutorial for Automating Real World Tasks from Scratch
Step-by-Step AI Agent Tutorial for Automating Real World Tasks from Scratch
Learn how to automate real-world tasks using crew AI Agent, native and custom tools with Lightning.AI IDE in the cloud. Build and collaborate with others on tasks efficiently. Step-by-step guidance included in this tutorial.
Video Summary & Chapters
1. Building with Crew AI 🛠️
Setting up teams to accomplish tasks together using Crew AI.
2. Accessing Tools in Crew AI 🧰
Exploring native and custom tools in Crew AI for automation.
3. Installing Crew AI and Documentation 📚
Step-by-step installation of Crew AI and referencing documentation.
4. Powering Models with Lightning AI ⚡
Utilizing Lightning AI to power models and connect to applications.
5. Adjusting Crew AI Installation 🔄
Correcting installation mistakes and updating to the desired version.
6. Creating Real-World Crew Agent 🌐
Designing a Summarizer agent for collecting and summarizing AI news links.
7. Customizing Agent Roles 🧑💼
Modifying agent roles and functions within the code editor.
8. Setting Up Task Workflow 🛠️
Configuring agents and tasks for web scraping and content summarization.
9. Defining Task Objectives 📋
Clarifying the objectives for conducting AI content analysis and summarization.
10. Agent Roles and Responsibilities 🕵️♂️
Assigning roles to the scraper and writer agents for efficient task execution.
11. Implementing Data Input 📊
Addressing the need to input a list of URLs for web scraping and content extraction.
12. Troubleshooting and Tool Integration 🔧
Resolving errors and integrating necessary tools for successful automation.
13. Setting up Website Search Tool
Naming and setting up the Website Search Tool
14. Troubleshooting Task Initialization
Encountering errors and adjusting task format
15. Analyzing Stock Data
Exploring the code for stock analysis
16. Defining Stock for Analysis
Investigating where the stock to analyze is defined
17. Setting up Financial Analysis Task
Copying and adjusting code for financial analysis task
18. Configuring Newsletter Analysis
Setting up the newsletter analysis process
19. Modular Code Structure
Appreciating the modular code structure for tasks
20. Wrapping Code in Class
Understanding the class structure for organizing code
21. Defining Agents and Tasks
Defining agents and tasks within the class structure
22. Setting up Scraper Functionality
Configuring the scraper function for data extraction.
23. Passing URLs to Agents
Exploring how to pass URLs to the agents for processing.
24. Inputting and Summarizing URLs
Entering URLs for summarization and processing.
25. Troubleshooting Attribute Errors
Identifying and resolving attribute errors in the code.
26. Debugging the Processing Flow
Analyzing the flow of processing and debugging the code for issues.
27. Setting up the Task
Troubleshooting and verifying task execution.
28. URLs Passing Issue
Encountering problems with passing URLs for task continuation.
29. Agents' Roles
Defining the roles of the scraper and writer agents.
30. Resolving Scraping Challenge
Addressing challenges in scraping website content.
31. Interpolating URLs
Implementing URL interpolation for task execution.
32. Tool Selection Discussion
Exploring website search tool functionality for scraping.
33. Creating Custom Scraping Tool
Considering options for developing a custom scraping tool.
34. Introduction 🤖
Initial setup and discussions on building a custom tool for website scraping.
35. Creating a Custom Tool 🧰
Guided steps to create a custom scraper tool from scratch for website content extraction.
36. Implementing the Scraper Tool 🌐
Incorporating code snippets and dependencies to create a functional website scraping tool.
37. Debugging and Testing 🛠️
Addressing issues and refining the scraping tool for accurate text extraction from websites.
38. Setting Up Import Tools
Importing and instantiating scraper tools in mean.py for automation.
39. Live Coding Collaboration
Engaging in real-time coding assistance and feedback using cloud editing.
40. Web Scraping Challenges
Encountering issues with website blocking requests and seeking alternative scraping methods.
41. Optimizing Scraping Process
Implementing header mimicry to retrieve webpage content successfully.
42. Successful Scraping
Confirming successful website scraping process and validation.
43. Initial Website Scraping Challenges 🤖
Encountering obstacles in website scraping and exploring solutions.
44. Exploring Alternative URLs 🌐
Switching to a different URL to overcome scraping blockers.
45. Handling Open AI Issue 🤔
Addressing error related to model's token length limit.
46. Identifying Article Content 📄
Seeking methods to extract specific article text from homepage.
47. Distinguishing Top Article 🥇
Understanding HTML structure to extract top article content.
48. Implementing Code Changes 💻
Modifying code to target and retrieve specific article text.
49. Testing the Scraping Process 🧪
Executing code to scrape and summarize targeted article text.
50. Achieving Successful Summary 🎉
Successfully summarizing website content using scraping tool.
51. Finalizing Outcome 🏁
Reviewing and acknowledging successful scraping result.
52. Introduction 🌟
Overview of using Lightning AI to automate tasks
53. Exploring Lightning AI Features ⚡
Capabilities of Lightning AI for loading, fine-tuning, and running models in the cloud
54. Acknowledgement & Sponsor 🙏
Acknowledging and thanking Lightning AI for their support and sponsorship
55. Closure & Call to Action 🎬
Encouragement to check out Lightning AI and subscribe for more content
Video Transcript
Let's build something with crew AI.
I'm going to set up teams and we're going to accomplish tasks together.
And this is going to be a slower-paced video because I'm just going to build it all with you live.
And we're going to be especially focusing on tools because I really want to extract the most
amount of value from allowing agents to use tools. And I'm going to show you how to access the
edge version of crew AI, which has a bunch of native tools installed in addition to
chain which we can use and then custom tools which we can build ourselves. So I'm going to show you how to do that also.
And we're going to be using lightning.ai as the IDE in the cloud. So everything I want to do is going to be coded in the cloud.
And then I'm going to share the code with you at the end of the video. And lightning is also the sponsor of this video.
So thank you to lightning. Let's get into it. So I am literally starting from nothing. You are going to watch me install it.
You're going to watch me set up all the agents line by line. So the nice thing about lightning AI is it is a cloud environment.
IDE and it's also so much more and I'll get to that in a bit but it's essentially VS Code
completely in the cloud and you could collaborate with other people on the code. So right now this
is from within my browser which is really cool and I opened up the terminal same thing as VS Code
so everything should feel super familiar to you. I opened up the terminal right here and let's get
started. I can see we're on Python 3.10.10 right there and if I click on it I can select another
version, but we don't need another version. So what we're going to do is pip install
crew AI and that's it. Let's see if it goes. Okay, downloading everything. That should be good.
Okay, it's done. Awesome. I'm also going to have the crew AI documentation open just so I can
reference it whenever I need. And so now that I have crew AI installed, that actually
should be to get started defining our agents. So I'm switching over to the documentation.
I'm going to copy the code from the documentation. I'm going to switch back and I'm just going
to print it all in here and we're going to adjust it as we need. So let's delete this
comment. We're going to import OS which will allow us to handle our API key. And we're
going to be using chatchipt initially. But we may end up using a local model later.
Now, the good thing about Lightning AI is it's not only a cloud IDE, but you can actually
power models.
You can spin up GPUs and power open source models and directly connect them to whatever
application you're building.
Lightning is really made for AI applications.
So I switched over to create new keys and open AI.
Let's hit create new key and I'm going to type through YT2 because I already started
one and I'm starting another one.
Create secret key.
copy, I'm going to revoke this key before publishing the video of course.
And right here on line 4, I'm going to double click and enter my API key.
And I'm realizing that by habit, I'm hitting save often and I probably don't need to do
that with lightning because it saves automatically as I'm going.
So I'm going to right click on main.py right over here and I'm going to go down to rename
and I'm going to call it crew.py.
Okay, and I realize I already made a mistake
because if we just do pip install crew AI,
it's going to install the latest stable release.
But what we want to do is actually hit equals equals
and then insert 0.14.0 RC.
So what we're going to do first is pip uninstall crew AI.
And so now you can see, I make mistakes all the time.
And then we're going to do pip install crew AI equals equals and then 0.14 dot zero RC.
And then we hit enter.
Okay, so it's installing the newest version.