i have this lines to create the Langchain csv agent with the memory or a chat history added to itiwan to make the agent have access to the user questions and the responses and consider them in the actions but the agent doesn't recognize the memory at all here is my code >>
memory_x = ConversationBufferMemory(memory_key="chat_history", return_messages=True)
agent = create_csv_agent(OpenAI(temperature=0, openai_api_key=os.environ["OPENAI_API_KEY"]),filepath,agent_type=AgentType.ZERO_SHOT_REACT_DESCRIPTION, verbose=True)
`
# and here is the post function in the route that handles the the user input -----
if request.method == 'POST':
question = request.form['question']
response = agent.run(question) # Use user input from the web page
could someone plese help me do it
i have tried al the ways for adding the memory but i can't make this correct
This is one way you can do it