Tools Overview
Learn about the custom tools used by the Newsletter AI Agent
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’s BaseTool
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 in src/tools/base.py
that handles the interaction with Apify actors:
This base class provides a standardized way to call Apify actors and process their results.
Available Tools
The Newsletter AI Agent includes the following tools:
- Google Scraper Tool: Uses the
apify/google-search-scraper
actor 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-lite
actor 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-result
actor 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
_run
method to call the appropriate Apify actor
Here’s a general pattern for tool implementation:
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:
The Apify actors provide powerful web scraping and data extraction capabilities without requiring complex infrastructure setup.
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
Or learn about the agents that use these tools to generate newsletters.