RAG Tool
The RagTool
is a dynamic knowledge base tool for answering questions using Retrieval-Augmented Generation.
RagTool
Description
The RagTool
is designed to answer questions by leveraging the power of Retrieval-Augmented Generation (RAG) through EmbedChain.
It provides a dynamic knowledge base that can be queried to retrieve relevant information from various data sources.
This tool is particularly useful for applications that require access to a vast array of information and need to provide contextually relevant answers.
Example
The following example demonstrates how to initialize the tool and use it with different data sources:
Supported Data Sources
The RagTool
can be used with a wide variety of data sources, including:
- π° PDF files
- π CSV files
- π JSON files
- π Text
- π Directories/Folders
- π HTML Web pages
- π½οΈ YouTube Channels
- πΊ YouTube Videos
- π Documentation websites
- π MDX files
- π DOCX files
- π§Ύ XML files
- π¬ Gmail
- π GitHub repositories
- π PostgreSQL databases
- π¬ MySQL databases
- π€ Slack conversations
- π¬ Discord messages
- π¨οΈ Discourse forums
- π Substack newsletters
- π Beehiiv content
- πΎ Dropbox files
- πΌοΈ Images
- βοΈ Custom data sources
Parameters
The RagTool
accepts the following parameters:
- summarize: Optional. Whether to summarize the retrieved content. Default is
False
. - adapter: Optional. A custom adapter for the knowledge base. If not provided, an EmbedchainAdapter will be used.
- config: Optional. Configuration for the underlying EmbedChain App.
Adding Content
You can add content to the knowledge base using the add
method:
Agent Integration Example
Hereβs how to integrate the RagTool
with a CrewAI agent:
Advanced Configuration
You can customize the behavior of the RagTool
by providing a configuration dictionary:
The internal RAG tool utilizes the Embedchain adapter, allowing you to pass any configuration options that are supported by Embedchain. You can refer to the Embedchain documentation for details. Make sure to review the configuration options available in the .yaml file.
Conclusion
The RagTool
provides a powerful way to create and query knowledge bases from various data sources. By leveraging Retrieval-Augmented Generation, it enables agents to access and retrieve relevant information efficiently, enhancing their ability to provide accurate and contextually appropriate responses.