RagTool
Description
TheRagTool
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:Code
Supported Data Sources
TheRagTool
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
TheRagTool
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 theadd
method:
Code
Agent Integration Example
Here’s how to integrate theRagTool
with a CrewAI agent:
Code
Advanced Configuration
You can customize the behavior of theRagTool
by providing a configuration dictionary:
Code
Conclusion
TheRagTool
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.