text: Skip to main contentğŸ¦œï¸�ğŸ”— LangChainDocsUse casesIntegrationsAPILangSmithJS/TS DocsCTRLKUse casesQA and Chat over DocumentsAnalyzing structured dataExtractionInteracting with APIsChatbotsSummarizationCode UnderstandingAgent simulationsAgentsBabyAGI User GuideBabyAGI with ToolsCAMEL Role-Playing Autonomous Cooperative AgentsCustom Agent with PlugIn RetrievalPlug-and-Plaimulti_modal_output_agentSalesGPT - Your Context-Aware AI Sales Assistant With Knowledge BaseWikibase AgentAutonomous (long-running) agentsMulti-modalUse casesAgentsBabyAGI User GuideOn this pageBabyAGI User GuideThis notebook demonstrates how to implement BabyAGI by Yohei Nakajima. BabyAGI is an AI agent that can generate and pretend to execute tasks based on a given objective.This guide will help you understand the components to create your own recursive agents.Although BabyAGI uses specific vectorstores/model providers (Pinecone, OpenAI), one of the benefits of implementing it with LangChain is that you can easily swap those out for different options. In this implementation we use a FAISS vectorstore (because it runs locally and is free).Install and Import Required Modulesâ€‹import osfrom collections import dequefrom typing import Dict, List, Optional, Anyfrom langchain import LLMChain, OpenAI, PromptTemplatefrom langchain.embeddings import OpenAIEmbeddingsfrom langchain.llms import BaseLLMfrom langchain.vectorstores.base import VectorStorefrom pydantic import BaseModel, Fieldfrom langchain.chains.base import ChainConnect to the Vector Storeâ€‹Depending on what vectorstore you use, this step may look different.from langchain.vectorstores import FAISSfrom langchain.docstore import InMemoryDocstore# Define your embedding modelembeddings_model = OpenAIEmbeddings()# Initialize the vectorstore as emptyimport faissembedding_size