BabyAGI: Initial Thoughts

BabyAGI: Initial Thoughts

Some initial thoughts on the BabyAGI project that is gaining a lot of traction, from the perspective of one developer.

BabyAGI is a project created by Yohei Nakajima, based on the idea of autonomous goal-seeking agents.

At its heart, it’s a very simple idea (which is why it’s so powerful).

How it works

It is creating a loop that feeds an initial prompt to OpenAI’s GPT APIs (or Llama.cpp if you want to build it) and uses the loop mechanism to decide what to do next.

This is a goal-seeking mechanism at work, and the reason it’s interesting is that it actually takes very little code to make it work.

Read through the main Python script and you’ll see that it’s mostly either boilerplate code or prompts to organize this workflow:


The biggest caveat to using this, as the developer makes very clear, is that because it is a loop sending a stream of prompts to OpenAI (if you go that route), things could get expensive very quickly.

Make SURE that you have usage limits enabled on both the OpenAI API console and in Pinecone (more on Pinecone below).

Pinecone’s pricing is based on how you have your infrastructure deployed, so as long as you have a handle on managing those costs, you’ll be good.

My main takeaways at this point:

1. It’s definitely worth building it and playing around with it.

2. Manage your costs

3. Use it as an opportunity to learn about how you can apply this to whatever tools / APIs you work with

4. Read Yohei Nakajima’s original paper / thread.

5. You’ll note in the thread that there appear to be some differences in the paper to the LangChain framework but LC doesn’t appear in the BabyAGI repo itself (unless I’m totally missing something).

6. It is clear, however, that many of these concepts were developed early on in the LangChain project and it is definitely worth ramping up on if you haven’t yet.

Rank Tracking & Competitor Insights Delivered Daily


For me personally, I lean hard toward self-hosting and not building too many dependencies on cloud systems and APIs.

It is unavoidable in certain situations, of course, but going forward, when you think about budgets, intellectual property, privacy, and security, any AI strategist should think long and hard about simply shipping a bunch of data off to cloud providers.

Since this framework already works with Llama.cpp (and I’m sure others are coming), there are some immediate workarounds.

On the data side, there is still the Pinecone dependency. I reallllly don’t like cloud database dependencies.

Question is, what are the options?

More about Pinecone and vector databases

Pinecone is a vector database. Anyone who has done research on or works in the NLP or other ML fields will be familiar with the concept of vector embeddings. (Here’s a great overview on this concept in the NLP world.)

Pinecone’s docs have a good overview on the usefulness of vector databases for this type of work.

But, if you’re like me, what are the options for self-hosting and are, ideally, open source?

In the Postgres world (my favorite database), there is pgvector. Pgvector is an extension that you can add to provide support for exact nearest neighbor search out of the box and you can add indexes to use approximate nearest neighbor search.

Supabase has a great writeup on using pgvector for this purpose.

As far as I am aware, nobody has yet submitted a pull request or created a fork of BabyAGI that supports the use of pgvector / postgres for this (not sure I’ll have the time either) but it seems like this would be a natural next step.

There are many other possibilities as well.


In conclusion, I think BabyAGI is a very interesting project and that we’ll see a lot more come from this iteration in AI development.

Some good comments can be found at Hacker News on this topic, with the top comment noting that BabyAGI is not even remotely close to “true AGI.” It’s a fair observation but probably beside the point.

From a marketing perspective, it’s a genius name.