Agents

Agents use LLMs to call external tools and call back into themselves to perform complex tasks that involve multiple steps. There are various types of agents, which might be better suited for one task or another. The types of agents currently supported by Prompt Store are:

Plan & Execute Agent

The Plan & Execute Agent, given a goal, will first devise a strategy and break the goal down into a series of steps that must be performed. For example, given the goal:

Who is Olivia Wilde's boyfriend? What is his current age raised to the 0.23 power?

The agent will devise an action plan:

Plan:
1. Search for information about Olivia Wilde's boyfriend.
2. Once the boyfriend's name is found, search for his current age.
3. Use a calculator or programming code to calculate the boyfriend's current age raised to the power of 0.23.
4. Combine the information obtained in steps 2 and 3 to provide the answer to the user's question.
5. Given the above steps taken, please respond to the user's original question.

Although this is a trivial example of an information request, it has elements that are impossible for an LLM to solve on its own.

Firstly, information about Olivia’s current boyfriend required information (I believe) more current than what many of the foundation models have been trained on. Even if the models could be retrained daily, the model would still not have access to live information or information that is not in the public domain.

Secondly, models don’t perform reliably on mathematical or precise calculations unless it is lucky to have seen the answer to the same question elsewhere. (Bullshit precision is more dangerous than no result because it gives the impression of being factual when in reality it might just be a string of numbers.)

In both cases, the model needs to consult an external tool to provide the answer. The role of the agent is to coordinate this process - prompting the model to identify when it needs an external consult, calling the external tool, and injecting the answer back into the model so it can continue.

In the example above, Step 2 could be satisfied by executing a search with an external search engine. Step 3 should be answered using an external calculator, or by writing and running code to perform the calculation.

Running the agent in this example results in a series of external function calls and internal observations made by the model as it completes its task.

The original user request.

Goal:
Who is Olivia Wilde's boyfriend? What is his current age raised to the 0.23 power?

The execution plan that the model has determined given the goal.

Plan:
1. Search for information about Olivia Wilde's boyfriend.
2. Once the boyfriend's name is found, search for his current age.
3. Use a calculator or programming code to calculate the boyfriend's current age raised to the power of 0.23.
4. Combine the information obtained in steps 2 and 3 to provide the answer to the user's question.
5. Given the above steps taken, please respond to the user's original question.

Step 1 involves a call out to the Google Search API. The model has determined which tool it needs based on metadata provided by the agent.

Step 1. Search for information about Olivia Wilde's boyfriend.

Call External Tool: serpapi

The results from the Search API are injected back into the model and leads the model in making the following internal observation. Think of this as like a thought bubble in the metaphorical head of the AI.

Observation:

Olivia Wilde's boyfriend is Harry Styles.

Step 2 - rinse and repeat.

Step 2. Once the boyfriend's name is found, search for his current age.

Call External Tool: serpapi

Observation:

Harry Styles is currently 29 years old.

Now we need to employ a different tool. This time, the agent calls out to an external calculator. No need to ask the model to guess - pull out a calculator :)

Step 3. Use a calculator or programming code to calculate the boyfriend's current age raised to the power of 0.23.

Call External Tool: calculator

Observation:

Harry Styles' current age raised to the power of 0.23 is approximately 2.1694.

Right, we have all the information we need now. We’ll ask the model to pull it together into a readable response.

Step 4. Combine the information obtained in steps 2 and 3 to provide the answer to the user's question.

Response:
Olivia Wilde's boyfriend is Harry Styles. Harry Styles is currently 29 years old. If we raise his current age, which is 29, to the power of 0.23, we get approximately 2.1694.

The last step is to notify the user or users. If we had configured the agent with a tool for email or Microsoft Teams, the agent would let the users know through that channel.

Step 5. Given the above steps taken, please respond to the user's original question.

Response:

Olivia Wilde's boyfriend is Harry Styles. His current age raised to the power of 0.23 is approximately 2.1694.

By default, the response is returned to the client that initiated the agent.


ReAct Zero-shot Learning Agent

This agent type usually achieves the same outcome. The main difference is that instead of devising a plan upfront and then following that plan through to the end, the ReAct agent will determine the next best step at each turn.

Question: Who is Olivia Wilde's boyfriend? What is his current age raised to the 0.23 power?

Thought: I need to find out who Olivia Wilde's boyfriend is first. Then I can calculate his current age raised to the 0.23 power.

Action: serpapi
Action Input: "Olivia Wilde boyfriend"

Observation: Harry Styles And Olivia Wilde Were Having Problems. Olivia Wilde and Harry Styles started dating during the filming of Don't Worry Darling. Olivia Wilde started dating Harry Styles after ending her years-long engagement to Jason Sudeikis — see their relationship timeline. Ready for love! Olivia Wilde is officially back on the dating scene following her split from her ex-boyfriend, Harry Styles. The two started dating after Wilde split up with actor Jason Sudeikisin 2020. However, their relationship came to an end last November. Here's what we know so far about Harry Styles and Olivia Wilde's relationship. Olivia and the Grammy winner kept their romance out of the spotlight as their relationship began just two months after her split from ex-fiancé ... Looks like Olivia Wilde and Jason Sudeikis are starting 2023 on good terms. Amid their highly publicized custody battle – and the actress' ... First linked in November 2011, Wilde and Sudeikis got engaged in January 2013. They later became parents, welcoming son Otis in 2014 and daughter Daisy in 2016. Harry Styles and Olivia Wilde first met on the set of Don't Worry Darling and stepped out as a couple in January 2021. Relive all their biggest relationship ...

Thought: Olivia Wilde's boyfriend is Harry Styles. Now I can calculate his current age raised to the 0.23 power.

Action: calculator
Action Input: his current age ^ 0.23

Observation: I don't know how to do that.

Thought: I'll need to find out Harry Styles' current age first before I can calculate his current age raised to the 0.23 power.

Action: serpapi
Action Input: "Harry Styles current age"

Observation: Who is Harry Styles? ; Age: 28 Yrs ; Gender: Male ; Height: 1.83 m (6′ 0″) ; Weight: 70 Kg (154 lbs) ; Profession: English Singer-Songwriter. Harry Styles ; Harry Edward Styles. (1994-02-01) 1 February 1994 (age 29). Redditch, Worcestershire, England · Singer; songwriter; actor · 2010–present · Solo ... Harry Styles ; Birthday February 1 ; Birth Sign Aquarius ; Birthplace Redditch ; Age 29 years old. February 1, 2024 ... Harry Styles, born on February 1, 1994, is an English musician, songwriter, and actor. He began his career as a contestant on “The X Factor,” ... Harry Styles was born on Feb 1st 1994. Harry Styles is 29 years old. What is the exact age of Harry Styles's in days ? Harry Styles is 29 ... Born on 1 February 1994, Harry Styles's age is 29 years old as of 2023. He was born and brought up in Redditch, United Kingdom. He currently balances his time ... Career. Singer-songwriter ; Birthday. February 01, 1994 Aquarius · Who was born on this day? ; Age. 29 year ; Birthplace. Redditch, Worcestershire, England ; Height. Styles was raised in Holmes Chapel, Cheshire, England, by his parents, Anne Twist and Desmond Styles. His parents divorced when he was seven years old; ... Personal Life ; Date of Birth, 1 February 1994 ; Age (as of 2023), 29 Years ; Birthplace, Redditch, Worcestershire, England, UK.

Thought: Harry Styles was born on February 1, 1994, which means his current age would depend on the current date. Since I don't have access to the current date, I won't be able to calculate his exact age in days. However, I can still calculate his age raised to the 0.23 power using his birth year.

Action: calculator
Action Input: (2023 - 1994) ^ 0.23

Observation: 2.169459462491557

Thought: Now I know that Harry Styles' age raised to the 0.23 power is approximately 2.169459462491557.

Final Answer: Harry Styles' current age raised to the 0.23 power is approximately 2.169459462491557.

Depending on the use case, the ReAct agent can be more adaptive to information it receives along the way. On the other hand, it has a higher risk of getting off track and continuing until agent guardrails are activated to stop the process.

Create Agents

To view the list of agents or create a new agent, click on “Agents” in the left side menu.

Agents

To create a new agent, enter the details in the empty form and click “Create”.

To open an existing agent, select it from the left side bar.

Agent Form

Testing Agents

Agents can be run in the user interface to test their operation. For an AI Application, agents will be scheduled or triggered to run in the background, sending notifications to users or updating databases and knowledge stores in the background.

Agent Form