This Python script is implementation of BabyAGI and LangChain's BabyAGI with Tools. This leverages FAISS for vector database and SerperAPI for easy searching engine scraping. This code base is inspired by BabyAGI and LangChain see Acknowledgements section below.
This script is designed to be run continuously as part of a task management system. Running this script continuously can result in high API usage, so please use it responsibly. Additionally, the script requires the OpenAI and SerpAPI APIs to be set up correctly, so make sure you have set up the APIs before running the script.
You need OpenAI and SerpAPI API key for the LLM and Search feature.
To use the script, you will need to follow these steps:
- Clone the repository via
git clone https://github.com/realminchoi/babyagi-langchain.git
andcd
into the cloned repository. - Install the required packages:
pip install -r requirements.txt
- Copy the .env.example file to .env:
cp .env.example .env
. This is where you will set the following variables. - Set your OpenAI and SerperAPI API keys in the OPENAI_API_KEY, and SERPAPI_API_KEY variables.
- Set additional variables such as MAX_ITERATIONS, OBJECTIVE, FIRST_TASK
Run BabyAGI.
python babyagi.py
I would like to express my gratitude to the developers whose code I referenced in creating this repo.
Special thanks go to
@yoheinakajima (https://github.com/yoheinakajima/babyagi)
@hinthornw (langchain-ai/langchain#2559)