Skip to main content

How It Works

The GPT Agent Toolkit is adopted from BabyAGI. In a nutshell, the Agents works by running an infinite loop that does the following steps:

  1. Pulls the first task from the task list.
  2. Sends the task to the execution agent, which uses OpenAI's API to complete the task based on the context.
  3. Enriches the result and stores it in the scratchpad.
  4. Creates new tasks and reprioritizes the task list based on the objective and the result of the previous task.
  • The TaskExecutorAgent uses the provided AI model, tasks, tools, and memory to decide on the appropriate action to take for each task. This is done by creating a custom prompt for the AI model, calling the model, and passes the the result as the action to be taken as well as the task that was used.

  • The TaskCreatorAgent component uses the provided AI model, tasks, tools, and memory to decide on the appropriate action to take for each task. This is done by creating a custom prompt for the AI model, then calling the model. The output is a list of new tasks generated by the AI model. Each task is represented as a dictionary with a task id and task name.

  • The TaskPrioritizerAgent that uses an AI model to prioritize tasks. It takes in a list of tasks, sends it to a language model for processing, and then returns the prioritized list of tasks.

We've also implemented a few memory components to store and retrieve task results for context. Currently Vecto, Pinecone and Numpy are supported. They are used to store the results of the task in the collection, along with the task name and any additional metadata.

Toolkit

In order to perform tasks, we have created a handful of tools for the agent to use, namely:

  • SqliteTool
  • BrowserTool
  • NlpTool
  • ExecutePythonTool
  • PromptUserTool
  • ScratchPadTool

You can see the prompts for each tool in the prompts section. You can also modify or use your own prompts too!