text: hence increasing relevance and reducing hallucinations.We leverage the langchain library in this implementation, specifically Custom Agent Configuration and are inspired by BabyAGI architecture .Import Libraries and Set Up Your Environmentâ€‹import osimport re# import your OpenAI keyOPENAI_API_KEY = "sk-xx"os.environ["OPENAI_API_KEY"] = OPENAI_API_KEYfrom typing import Dict, List, Any, Union, Callablefrom pydantic import BaseModel, Fieldfrom langchain import LLMChain, PromptTemplatefrom langchain.llms import BaseLLMfrom langchain.chains.base import Chainfrom langchain.chat_models import ChatOpenAIfrom langchain.agents import Tool, LLMSingleActionAgent, AgentExecutorfrom langchain.text_splitter import CharacterTextSplitterfrom langchain.embeddings.openai import OpenAIEmbeddingsfrom langchain.chains import RetrievalQAfrom langchain.vectorstores import Chromafrom langchain.llms import OpenAIfrom langchain.prompts.base import StringPromptTemplatefrom langchain.agents.agent import AgentOutputParserfrom langchain.agents.conversational.prompt import FORMAT_INSTRUCTIONSfrom langchain.schema import AgentAction, AgentFinish# install aditional dependencies# ! pip install chromadb openai tiktokenSalesGPT architectureâ€‹Seed the SalesGPT agentRun Sales Agent to decide what to do:a) Use a tool, such as look up Product Information in a Knowledge Baseb) Output a response to a user Run Sales Stage Recognition Agent to recognize which stage is the sales agent at and adjust their behaviour accordingly.Here is the schematic of the architecture:Architecture diagramâ€‹Sales conversation stages.â€‹The agent employs an assistant who keeps it in check as in what stage of the conversation it is in. These stages were generated by ChatGPT and can be easily modified to fit other use cases or modes of conversation.Introduction: Start the conversation by introducing yourself and your company. Be polite and respectful