BambooAI icon indicating copy to clipboard operation
BambooAI copied to clipboard

Issue in having a Conversation. (Conversational Memory not enabled)

Open Murtuza-Chawala opened this issue 1 year ago • 1 comments

Hi @pgalko,

Whenever I ask another question it seems to not take in the context of the previous question and answer and gives me a fresh new response.

I'd like to have memory enabled so that I can have a conversation with it.

Note - I am running the Bamboo AI Agent in a for-loop to enable memory And also have set max_conversations=2.

This is my configuration bamboo = BambooAI(df,llm='gpt-3.5-turbo-0613',max_conversations=2, debug=False, vector_db=False, exploratory=False, llm_switch=False, search_tool=False)

for _ in range(0,2): user_input = input("Dear User Please Enter your query: ") #How many rows are present from the dataset bamboo.pd_agent_converse(user_input)

I am sure you have some solution, am I missing something? Thank you.

Murtuza-Chawala avatar Sep 11 '23 09:09 Murtuza-Chawala

The bamboo ai can run in a while loop with memory enabled natively, you should not need to enclose it in a for loop. Basically, if you run it with prompt like this bamboo.pd_agent_converse("How many rows are present from the dataset ?") it will do a single execution and stop (no memory). But if you run it without prompt bamboo.pd_agent_converse() it will start a while loop and prompt you to type in your questions. The loop is broken when you type "exit". So, to run it in the loop with memory enabled all you need to do is this:

from bambooai import BambooAI

bamboo = BambooAI(df,llm='gpt-3.5-turbo-0613',max_conversations=2, debug=False, vector_db=False, exploratory=False, llm_switch=False, search_tool=False)

bamboo.pd_agent_converse()

The output would look similar to the below:

Enter your question or type 'exit' to quit: What is the average age of female survivors ? <<Response 1>>

Enter your question or type 'exit' to quit: And male ? <<Response 2>>

I hope it helps :-)

pgalko avatar Sep 12 '23 06:09 pgalko