YoutubeChannelSearchTool
We are still working on improving tools, so there might be unexpected behavior or changes in the future.
Description
This tool is designed to perform semantic searches within a specific Youtube channel’s content. Leveraging the RAG (Retrieval-Augmented Generation) methodology, it provides relevant search results, making it invaluable for extracting information or finding specific content without the need to manually sift through videos. It streamlines the search process within Youtube channels, catering to researchers, content creators, and viewers seeking specific information or topics.Installation
To utilize the YoutubeChannelSearchTool, thecrewai_tools package must be installed. Execute the following command in your shell to install:
Example
The following example demonstrates how to use theYoutubeChannelSearchTool with a CrewAI agent:
Code
Code
Parameters
TheYoutubeChannelSearchTool accepts the following parameters:
- youtube_channel_handle: Optional. The handle of the YouTube channel to search within. If provided during initialization, the agent won’t need to specify it when using the tool. If the handle doesn’t start with ’@’, it will be automatically added.
- config: Optional. Configuration for the underlying RAG system, including LLM and embedder settings.
- summarize: Optional. Whether to summarize the retrieved content. Default is
False.
- search_query: Required. The search query to find relevant information in the channel content.
- youtube_channel_handle: Required only if not provided during initialization. The handle of the YouTube channel to search within.
Custom Model and Embeddings
By default, the tool uses OpenAI for both embeddings and summarization. To customize the model, you can use a config dictionary as follows:Code
Agent Integration Example
Here’s a more detailed example of how to integrate theYoutubeChannelSearchTool with a CrewAI agent:
Code
Implementation Details
TheYoutubeChannelSearchTool is implemented as a subclass of RagTool, which provides the base functionality for Retrieval-Augmented Generation:
Code
Conclusion
TheYoutubeChannelSearchTool provides a powerful way to search and extract information from YouTube channel content using RAG techniques. By enabling agents to search across an entire channel’s videos, it facilitates information extraction and analysis tasks that would otherwise be difficult to perform. This tool is particularly useful for research, content analysis, and knowledge extraction from YouTube channels.