Alchemist | Documentation
Agent Tools

Agent Tools

Alchemist provides a set of tools that can be used by agents to perform specific tasks. These tools are designed to enhance the capabilities of the agents and allow them to interact with external systems to perform more complex operations.

For an agent to be able to use the tools, it needs to be configured with the specific Agent Type. The agent types that support tool execution are:

  • ReAct - Agent with iterative prompt structure supporting internal monologue (thoughts) and tool execution.
  • PlanReAct - ReAct strategy with internal planning.
  • ConvPlanReAct - PlanReAct strategy with ability to pass the conversation to another agent.

Initial Tool Selection

When creating a new agent, you can select which tools should be included in the agent's toolbox. This is done by selecting the desired tools from the list of available tools. The selected tools will be included in the agent's toolbox and will be available for execution during the agent's workflow.

Initial Selection of Tools during Agent Creation
Select desired tools from the list during the agent creation.

Add/Remove Tools

At any point in time you can add or remove tools from the agent's toolbox. This is done by selecting the agent in the Agent Team panel and clicking on the Add/Remove Tool button. This will open a dialog where you can select which tools should be included in the agent's toolbox.

Add/Remove Tools Button
Click Add/Remove Tool to modify the list of tools for a selected agent in the team.

In the dialog you can see the list of available tools together with their description. The tools that are already included in the agent's toolbox are marked with a checkmark. You can add or remove tools by checking or unchecking the checkbox next to the tool name. Once you are done, click on the Save button to apply the changes.

Note that this list will also include any tools that are provided by the User.

Add/Remove Tools to an Agent
Add/Remove tools from selected agent in an agent team. Check the tools from the list that should be included in the agent.

Tool Execution in the Agent Flow

Alchemist allows you to build agents and agent teams that are capable of executing tools. This means that the agents can perform specific tasks or actions based on the user's input or the context of the conversation. The tool execution is an integral part of the agent's workflow and can be used to enhance the capabilities of the agent.

One needs to note that the tool execution is not a simple function call. The agent needs to understand the context and the parameters of the tool before executing it. This is where the power of language models comes into play. The agent can use its understanding of the language and the context to determine the best way to proceed with its response. In this sense the tool execution is automated process and the agent is in control which tool from its toolbox will be executed.

To make sure that the agent is able to execute tools that agent needs to be configures as ReAct, PlanReAct or ConvPlanReAct. This type represents the prompting strategy that will determine how the agent is structuring its responses.

In the simple example below, the agent is configured to use the ReAct prompting strategy. The agent is able to execute the CurrentTime tool and return the result to the user. It is worth to notice that the tool execution is not visible from the final response. To see which tools have been executed, you need to open Messages panel to view complete internal monologue of the agent.

Enabling embedding model in Ollama
Example of simple tool execution. The agent asked about the current time executed CurrentTime tool using default parameters. Tool invocation is marked in Messages panel in red and its result as a following message marked in orange.

In the example above tool execution is highlighted in red and the result of the tool execution is marked in orange. The agent is able to execute the tool and return the result to the user without any additional input.

Comment on NoAction Tool

Alchemist provides a special tool called NoAction. This tool is used to indicate that the agent does not need to perform any action or execute any tool. This can be useful in situations where the agent needs to provide a response without executing any tools. The NoAction tool is a placeholder and does not perform any actions.

Adding NoAction to agent's toolbox is not mandatory but it will allow the agent to provide responses based on its internal knowledge if at a given step no tool execution is needed (or no tool is appropriate for execution at that moment).

Using NoAction tool requires the agent to justify its decision to not execute any tools. This is done by providing a parameter with the reason why execution is skipped and this decision is reported in the same way as execution of any other tool.

Included tools

Alchemist comes with a set of pre-defined tools that can be used by the agents. These tools are designed to perform specific tasks and can be easily integrated into your agent's workflow. Below is the list of tools included in Alchemist.

The tool selection will be expanded in the future to support broader range of applications. Alchemist is designed to be extensible and allows you to add your own tools. For more information on how to add your own tools, please refer to the Bring your own tools section.

Tool Description
AbbreviationsResolver Provides the full form of an abbreviation using a local file or a service.
ArXivSearch Search for a term on arXiv and return a list of papers with titles, summaries, publication dates and PDF URLs.
Calculator Performs basic arithmetic. Only supports numbers, operators and functions.
CurrencyConversion Converts values between different currencies using the latest exchange rates. Currency codes are based on ISO 4217.
CurrentTime Get the current date and time.
DownloadFile Downloads a file from a URL and saves it to a specified path.
PythonRunner Run Python code in a stateless Docker container. Files are copied to the empty container, requirements installed and your command is run. The standard output is returned. Any created files need to be copied as output files to keep them. Container is then removed.
GoogleSearch Search Google and return results with titles, snippets and URLs.
KnowledgeBaseSearch Search internal Knowledge Base for the specific topic or query. You have access to specific collections that include data on selected topic.
ListFiles Lists files in a directory.
NoAction Tool selection for taking no action. To be used if no tool is applicable or no action is required.
ReadFiles Reads plain text files from the current directory and provides their content.
ReadFilesAsMarkdown List of file paths to read. Files can be in PDF/PowerPoint/Word/Excel/HTML/CSV/JSON/XML/ZIP format. Content will be converted to Markdown.
UnitConversion Converts values between metric and imperial units of measurement.
ScrapeURL Scrape text content from a webpage and return it in Markdown format.
UnpackArchive Unpacks archive files (ZIP, tar.gz) to a specified directory.
WikipediaSearch Search for a term on Wikipedia and return the whole text content.
WriteFile Writes file to local disk. Specify the file path and content to write. The file will be overwritten if it already exists.

Tool dependencies

Tools are Agent's component to bring the ability to bring external information or provide external actions. Some of the tools may require additional dependencies or configuration to work properly. Below is the list of tools provided in Alchemist that require User's action before they can be used.

PythonRunner

PythonRunner brings the ability for an agent to run Python code. To make sure that the execution of agent generated code is safe and does not impact your system, the code is executed in a Docker container. This process is stateless and the container is always removed after the execution. This allows us to provide always consistent environment for the code to execute and to minimize the risk agent written code to impact your system.

To enable the PythonRunner tool, you need to install Docker on your system. The installation process is different for each operating system. Please refer to the official Docker documentation for detailed instructions.

GoogleSearch

GoogleSearch tool allows the agent to search the web using Google. To enable this tool, you need to create a Google Custom Search Engine (CSE) and obtain an API key. Follow these steps:

  1. Go to the Google CSE page.
  2. Click on "Add" to create a new search engine.
  3. Fill in the required details and click "Create".
  4. Once created, go to the "Control Panel" of your search engine.
  5. Enable "Image Search" and "Search the entire web" options.
  6. Copy the Search Engine ID and API key from the Control Panel.
  7. In Alchemist, go to the Settings / Agent Tools and in Google Search Tool Parameters add the generated API key and Search Engine ID.
Enabling embedding model in Ollama
GoogleSearch tool requires Google Search API key and Google Search Engine ID to be included in the Settings before the tool can be executed.

For more information on how to create a Google CSE, refer to the Google Custom Search documentation.

WikipediaSearch

WikipediaSearch tool allows the agent to search Wikipedia. To use Wikipedia programmatically, you will need to enter Wikipedia User Agent name in the Settings. This is a simple string that will be used to identify your application when making requests to the Wikipedia API.

To set up the Wikipedia User Agent, follow these steps:

  1. Settings / Agent Tools / Wikipedia Access
  2. Enter your Wikipedia User Agent name in the provided field.
  3. Click "Save Changes" button to apply the changes.
Enabling embedding model in Ollama
WikipediaSearch tool requires Wikipedia User Agent to be included in the Settings before the tool can be executed.

For more information on how to create a Wikipedia User Agent, refer to the Wikipedia API documentation.