FeaturesTools

Introduction to Tools

In AgentForge, most agents rely on tools to perform their tasks effectively. The underlying mechanism that allows agents to utilize these tools is known as Function Calling. This feature is supported by most platforms, making them compatible with running Agents in various environments.

Supported Tools

Tavily Search Tool

Currently, AgentForge integrates the Tavily search tool for browsing the internet. Tavily provides powerful search capabilities that enhance the functionality of your agents by allowing them to retrieve and utilize information from the web.

Adding More Tools

While Tavily is a default tool, you can easily add support for other tools as described in the LangChainJS Tools Documentation. This flexibility allows you to customize and extend the capabilities of your agents to meet specific needs.

Using Tools with Agents

To use a tool in AgentForge, you simply need to pass it to the createAgent function. Below is an example of how to integrate the Tavily search tool with an agent.

Example: Using the Tavily Search Tool

ai/agents/researcher.ts

1import { TavilySearchResults } from '@langchain/community/tools/tavily_search';
2import { Agent, createAgent } from './base';
3import llm from './llm';
4
5const tavilyTool = new TavilySearchResults();
6
7const researcherAgent = await createAgent(
8    llm,
9    [tavilyTool],
10    'Your system prompt goes here'
11);

Steps:

  1. Import the Tool: Import the Tavily search tool from the LangChain community tools.
  1. Initialize the Tool: Create an instance of the Tavily search tool.
  1. Create the Agent: Pass the initialized tool to the createAgent function along with your chosen LLM and any additional configuration options.
This setup allows your agent to utilize the Tavily search tool for internet browsing and information retrieval.

Conclusion

Tools are essential for enhancing the functionality of agents in AgentForge. By leveraging Function Calling, agents can perform a wide range of tasks using various integrated tools. The Tavily search tool is a powerful default option, but you can easily add and configure additional tools to suit your specific requirements.
Explore the LangChainJS Tools Documentation to discover more tools and extend the capabilities of your agents.