Files
crewAI/lib/crewai-tools/src/crewai_tools/tools/rag
Greyson LaLonde 2025a26fc3
Some checks failed
Mark stale issues and pull requests / stale (push) Has been cancelled
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
Build uv cache / build-cache (3.10) (push) Has been cancelled
Build uv cache / build-cache (3.11) (push) Has been cancelled
Build uv cache / build-cache (3.12) (push) Has been cancelled
Build uv cache / build-cache (3.13) (push) Has been cancelled
fix: ensure parameters in RagTool.add, add typing, tests (#3979)
* fix: ensure parameters in RagTool.add, add typing, tests

* feat: substitute pymupdf for pypdf, better parsing performance

---------

Co-authored-by: Lorenze Jay <63378463+lorenzejay@users.noreply.github.com>
2025-11-26 22:32:43 -08:00
..
2025-11-24 16:51:28 -05:00
2025-10-20 14:10:19 -07:00

RagTool: A Dynamic Knowledge Base Tool

RagTool is designed to answer questions by leveraging the power of RAG by leveraging (EmbedChain). It integrates seamlessly with the CrewAI ecosystem, offering a versatile and powerful solution for information retrieval.

Overview

RagTool enables users to dynamically query a knowledge base, making it an ideal tool for applications requiring access to a vast array of information. Its flexible design allows for integration with various data sources, including files, directories, web pages, yoututbe videos and custom configurations.

Usage

RagTool can be instantiated with data from different sources, including:

  • 📰 PDF file
  • 📊 CSV file
  • 📃 JSON file
  • 📝 Text
  • 📁 Directory/ Folder
  • 🌐 HTML Web page
  • 📽️ Youtube Channel
  • 📺 Youtube Video
  • 📚 Docs website
  • 📝 MDX file
  • 📄 DOCX file
  • 🧾 XML file
  • 📬 Gmail
  • 📝 Github
  • 🐘 Postgres
  • 🐬 MySQL
  • 🤖 Slack
  • 💬 Discord
  • 🗨️ Discourse
  • 📝 Substack
  • 🐝 Beehiiv
  • 💾 Dropbox
  • 🖼️ Image
  • ⚙️ Custom

Creating an Instance

from crewai_tools.tools.rag_tool import RagTool

# Example: Loading from a file
rag_tool = RagTool().from_file('path/to/your/file.txt')

# Example: Loading from a directory
rag_tool = RagTool().from_directory('path/to/your/directory')

# Example: Loading from a web page
rag_tool = RagTool().from_web_page('https://example.com')

Contribution

Contributions to RagTool and the broader CrewAI tools ecosystem are welcome. To contribute, please follow the standard GitHub workflow for forking the repository, making changes, and submitting a pull request.

License

RagTool is open-source and available under the MIT license.

Thank you for considering RagTool for your knowledge base needs. Your contributions and feedback are invaluable to making RagTool even better.