Creating an LLM Agent with Tools

LLM Agents in Cotera can go beyond their pre-trained knowledge by using tools. By giving an agent access to a tool like Google Jobs, you can empower it to fetch real-time, external data and bring it directly into your dataset for analysis. This approach is ideal when you need to enrich your data with live information from the internet.


Creating an LLM Agent with Tools tutorial

Getting Started

First, navigate to the dataset you want to enrich.

  1. Click the + button to create a new column.
  2. From the "New Column" menu, select LLM. This will open the LLM Column configuration interface.

Defining the Agent's Task

The System Message is where you give the AI its core instructions. Tell the agent what its role is and what you want it to accomplish.

For example, to create a job-finding agent, you could use the following prompt:

You are a job-finder agent. Your job is to help me find jobs posted in the last 3 days in the US for the role that I am about to give you.

If you test this prompt without any tools, the agent will respond that it cannot access real-time job postings from the internet, as its knowledge is static.


Providing the Agent with Tools

To solve this, you can grant the agent access to external tools.

  1. Under the System Message, click on Tools to open the tool provider menu.
  2. Browse and select the tool you need. For this example, we select Google Jobs.
  3. Select the specific function the agent should use, such as Job Search. You can expand the tool to see its documentation, including the required inputs and expected outputs.
  4. Update the System Message to instruct the agent to use the new tool. For instance, add the line:

    Please use the google jobs tool to be able to find the data.


Testing and Structuring the Output

Before running the agent on your entire dataset, you can test its behavior and structure its output.

Testing the Tool Call

In the chat preview pane, enter a sample query like "Backend Engineer". The agent will generate a Tool Call. You may need to manually approve the tool call by clicking the play button to execute it. The agent will then perform the search and return the live data it found.

Structuring the Output

To ensure the agent returns data in a clean, usable format, you can define a structured output.

  1. Click the icon to define a structured output format.
  2. Add fields for each piece of data you want to extract, such as job_title, location, salary, and link_to_apply.
  3. Modify the system prompt to instruct the agent to return its findings in the specified format.

Running the Agent on Your Dataset

Once you are satisfied with the agent's performance, you can run it across all rows in your dataset.

  1. In the Prompt section, link the agent's input to the relevant column in your data. In this case, we connect it to the Job Titles column.
  2. Click Save and give your new column a descriptive name, like "Job Finder".
  3. Click Run Now to start the process.

The agent will now iterate through each job title, call the Google Jobs tool, and populate the new "Job Finder" column with the structured data it retrieves.