REACT Agent Chat Message History with Zep - A long-term memory store for LLM applications.We'll demonstrate:Adding conversation history to the Zep memory store.Running an agent and having message automatically added to the store.Viewing the enriched messages.Vector search over the conversation history.from langchain.memory import ZepMemoryfrom langchain.retrievers import ZepRetrieverfrom langchain.llms import OpenAIfrom langchain.schema import HumanMessage, AIMessagefrom langchain.utilities import WikipediaAPIWrapperfrom langchain.agents import initialize_agent, AgentType, Toolfrom uuid import uuid4# Set this to your Zep server URLZEP_API_URL = "http://localhost:8000"session_id = str(uuid4())  # This is a unique identifier for the user# Provide your OpenAI keyimport getpassopenai_key = getpass.getpass()# Provide your Zep API key. Note that this is optional. See https://docs.getzep.com/deployment/authzep_api_key = getpass.getpass()Initialize the Zep Chat Message History Class and initialize the Agent‚Äãsearch = WikipediaAPIWrapper()tools = [    Tool(        name="Search",        func=search.run,        description="useful for when you need to search online for answers. You should ask targeted questions",    ),]# Set up Zep Chat Historymemory = ZepMemory(    session_id=session_id,    url=ZEP_API_URL,    api_key=zep_api_key,    memory_key="chat_history",)# Initialize the agentllm = OpenAI(temperature=0, openai_api_key=openai_key)agent_chain = initialize_agent(    tools,    llm,    agent=AgentType.CONVERSATIONAL_REACT_DESCRIPTION,    verbose=True,    memory=memory,)Add some history data‚Äã# Preload some messages into the memory. The default message window is 12 messages. We want to push beyond this to demonstrate auto-summarization.test_history = [    {"role": "human", "content": "Who was Octavia Butler?"},    {        "role": "ai",        "content": (            "Octavia Estelle Butler (June 22, 1947 ‚Äì February 24, 2006) was an American"            " science fiction
Zep is a long-term memory store for LLM applications.
Zep is a long-term memory store for LLM applications. ->: REACT Agent Chat Message History with Zep - A long-term memory store for LLM applications.We'll demonstrate:Adding conversation history to the Zep memory store.Running an agent and having message automatically added to the store.Viewing the enriched messages.Vector search over the conversation history.from langchain.memory import ZepMemoryfrom langchain.retrievers import ZepRetrieverfrom langchain.llms import OpenAIfrom langchain.schema import HumanMessage, AIMessagefrom langchain.utilities import WikipediaAPIWrapperfrom langchain.agents import initialize_agent, AgentType, Toolfrom uuid import uuid4# Set this to your Zep server URLZEP_API_URL = "http://localhost:8000"session_id = str(uuid4())  # This is a unique identifier for the user# Provide your OpenAI keyimport getpassopenai_key = getpass.getpass()# Provide your Zep API key. Note that this is optional. See https://docs.getzep.com/deployment/authzep_api_key = getpass.getpass()Initialize the Zep Chat Message History Class and initialize the Agent‚Äãsearch = WikipediaAPIWrapper()tools = [    Tool(        name="Search",        func=search.run,        description="useful for when you need to search online for answers. You should ask targeted questions",    ),]# Set up Zep Chat Historymemory = ZepMemory(    session_id=session_id,    url=ZEP_API_URL,    api_key=zep_api_key,    memory_key="chat_history",)# Initialize the agentllm = OpenAI(temperature=0, openai_api_key=openai_key)agent_chain = initialize_agent(    tools,    llm,    agent=AgentType.CONVERSATIONAL_REACT_DESCRIPTION,    verbose=True,    memory=memory,)Add some history data‚Äã# Preload some messages into the memory. The default message window is 12 messages. We want to push beyond this to demonstrate auto-summarization.test_history = [    {"role": "human", "content": "Who was Octavia Butler?"},    {        "role": "ai",        "content": (            "Octavia Estelle Butler (June 22, 1947 ‚Äì February 24, 2006) was an American"            " science fiction