import CodeBlock from "@theme/CodeBlock";

# BabyAGI

:::info
Original Repo: https://github.com/yoheinakajima/babyagi
:::

BabyAGI is made up of 3 components:

- A chain responsible for creating tasks
- A chain responsible for prioritising tasks
- A chain responsible for executing tasks

These chains are executed in sequence until the task list is empty or the maximum number of iterations is reached.

## Simple Example

import SimpleExample from "@examples/experimental/babyagi/weather.ts";

In this example we use BabyAGI directly without any tools. You'll see this results in successfully creating a list of tasks but when it comes to executing the tasks we do not get concrete results. This is because we have not provided any tools to the BabyAGI. We'll see how to do that in the next example.

<CodeBlock language="typescript">{SimpleExample}</CodeBlock>

## Example with Tools

import ToolsExample from "@examples/experimental/babyagi/weather_with_tools.ts";

In this next example we replace the execution chain with a custom agent with a Search tool. This gives BabyAGI the ability to use real-world data when executing tasks, which makes it much more powerful. You can add additional tools to give it more capabilities.

<CodeBlock language="typescript">{ToolsExample}</CodeBlock>
