mirror of
https://github.com/crewAIInc/crewAI.git
synced 2025-12-16 04:18:35 +00:00
docs: update RagTool references from EmbedChain to CrewAI native RAG (#3537)
* docs: update RagTool references from EmbedChain to CrewAI native RAG * change ref to qdrant * docs: update RAGTool to use Qdrant and add embedding_model example
This commit is contained in:
@@ -9,7 +9,7 @@ mode: "wide"
|
|||||||
|
|
||||||
## Description
|
## Description
|
||||||
|
|
||||||
The `RagTool` is designed to answer questions by leveraging the power of Retrieval-Augmented Generation (RAG) through EmbedChain.
|
The `RagTool` is designed to answer questions by leveraging the power of Retrieval-Augmented Generation (RAG) through CrewAI's native RAG system.
|
||||||
It provides a dynamic knowledge base that can be queried to retrieve relevant information from various data sources.
|
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.
|
This tool is particularly useful for applications that require access to a vast array of information and need to provide contextually relevant answers.
|
||||||
|
|
||||||
@@ -76,8 +76,8 @@ The `RagTool` can be used with a wide variety of data sources, including:
|
|||||||
The `RagTool` accepts the following parameters:
|
The `RagTool` accepts the following parameters:
|
||||||
|
|
||||||
- **summarize**: Optional. Whether to summarize the retrieved content. Default is `False`.
|
- **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.
|
- **adapter**: Optional. A custom adapter for the knowledge base. If not provided, a CrewAIRagAdapter will be used.
|
||||||
- **config**: Optional. Configuration for the underlying EmbedChain App.
|
- **config**: Optional. Configuration for the underlying CrewAI RAG system.
|
||||||
|
|
||||||
## Adding Content
|
## Adding Content
|
||||||
|
|
||||||
@@ -130,44 +130,23 @@ from crewai_tools import RagTool
|
|||||||
|
|
||||||
# Create a RAG tool with custom configuration
|
# Create a RAG tool with custom configuration
|
||||||
config = {
|
config = {
|
||||||
"app": {
|
"vectordb": {
|
||||||
"name": "custom_app",
|
"provider": "qdrant",
|
||||||
},
|
|
||||||
"llm": {
|
|
||||||
"provider": "openai",
|
|
||||||
"config": {
|
"config": {
|
||||||
"model": "gpt-4",
|
"collection_name": "my-collection"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"embedding_model": {
|
"embedding_model": {
|
||||||
"provider": "openai",
|
"provider": "openai",
|
||||||
"config": {
|
"config": {
|
||||||
"model": "text-embedding-ada-002"
|
"model": "text-embedding-3-small"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"vectordb": {
|
|
||||||
"provider": "elasticsearch",
|
|
||||||
"config": {
|
|
||||||
"collection_name": "my-collection",
|
|
||||||
"cloud_id": "deployment-name:xxxx",
|
|
||||||
"api_key": "your-key",
|
|
||||||
"verify_certs": False
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"chunker": {
|
|
||||||
"chunk_size": 400,
|
|
||||||
"chunk_overlap": 100,
|
|
||||||
"length_function": "len",
|
|
||||||
"min_chunk_size": 0
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rag_tool = RagTool(config=config, summarize=True)
|
rag_tool = RagTool(config=config, summarize=True)
|
||||||
```
|
```
|
||||||
|
|
||||||
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](https://docs.embedchain.ai/components/introduction) for details.
|
|
||||||
Make sure to review the configuration options available in the .yaml file.
|
|
||||||
|
|
||||||
## Conclusion
|
## 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.
|
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.
|
||||||
|
|||||||
Reference in New Issue
Block a user