Tools Overview
The Newsletter AI Agent uses a set of custom tools powered by Apify actors to gather information from various sources. These tools are primarily used by the Researcher Agent to collect comprehensive data about the specified topic.Tool Architecture
The tools are implemented using CrewAI’sBaseTool class and Apify’s actor system. Each tool is designed to interact with a specific Apify actor to gather information from a particular source, such as Google Search, Reddit, Twitter, YouTube, or Google News.
Base Implementation
All tools share a common base implementation insrc/tools/base.py that handles the interaction with Apify actors:
Available Tools
The Newsletter AI Agent includes the following tools:- Google Scraper Tool: Uses the
apify/google-search-scraperactor to search the web for relevant information - Reddit Scraper Tool: Uses a Reddit scraper actor to gather discussions from relevant subreddits
- Twitter Scraper Tool: Uses the
apidojo/twitter-scraper-liteactor to collect tweets related to the topic - YouTube Scraper Tool: Uses a YouTube scraper actor to find relevant video content
- Google News Scraper Tool: Uses the
aymorato/super-fast-google-news-scraper-pay-per-resultactor to gather the latest news articles
Tool Implementation
Each tool follows a similar pattern:- Define an input schema using Pydantic models
- Create a tool class that inherits from
BaseTool - Implement the
_runmethod to call the appropriate Apify actor
Apify Integration
The tools use the Apify Python SDK to interact with Apify actors. This requires an Apify API key, which should be set in the.env file:
Tool Usage
Tools are assigned to the Researcher Agent during agent creation:Next Steps
Explore each tool in detail:- Google Scraper Tool
- Reddit Scraper Tool
- Twitter Scraper Tool
- YouTube Scraper Tool
- Google News Scraper Tool