Created Agent Tools (markdown)

João Moura
2023-11-14 12:37:20 -03:00
parent 7d36d1a710
commit 0f418f74b1

41
Agent-Tools.md Normal file

@@ -0,0 +1,41 @@
# What is a Tool?
A tool in CrewAI is a function or capability that an agent can utilize to perform actions, gather information, or interact with external systems, behind the scenes tools are [LangChain Tools](https://python.langchain.com/docs/modules/agents/tools/).
These tools can be as straightforward as a search function or as sophisticated as integrations with other chains or APIs.
## Key Characteristics of Tools
- **Utility**: Tools are designed to serve specific purposes, such as searching the web, analyzing data, or generating content.
- **Integration**: Tools can be integrated into agents to extend their capabilities beyond their basic functions.
- **Customizability**: Developers can create custom tools tailored to the specific needs of their agents or use pre-built LangChain ones available in the ecosystem.
## Implementing Tools
Implementing a tool involves integrating it with an agent so it can be used to carry out tasks. For example, you might integrate SerpAPI as a tool for an agent that needs to perform web searches.
# Creating and Assigning Tools
To assign a tool to an agent, you'd provide it as part of the agent's properties during initialization. Below is a conceptual example:
```python
from crewai import Agent
from langchain.tools import SerpAPI
# Instantiate the SerpAPI tool
serp_api_tool = SerpAPI(...)
# Create an agent and assign the SerpAPI tool
agent = Agent(
role='Researcher',
goal='Gather market data',
tools=[serp_api_tool]
)
```
# Tool Interaction
Tools enhance an agent's ability to perform tasks autonomously or in collaboration with other agents. For instance, an agent might use a search tool to gather information, then pass that data to another agent specialized in analysis.
# Conclusion
Tools are vital components that expand the functionality of agents within the CrewAI framework. They enable agents to perform a wide range of actions and collaborate effectively with one another. As you build with CrewAI, consider the array of tools you can leverage to empower your agents and how they can be interwoven to create a robust AI ecosystem.