.
OTHER SOLUTION BELOW:
memory = GPTIndexChatMemory(
index=index,
memory_key="chat_history",
query_kwargs={"response_mode": "compact",
"similarity_top_k": 3},
# return_source returns source nodes instead of querying index
return_source=True,
# return_messages returns context in message format
return_messages=True
)
llm = OpenAIChat(temperature=0)
# llm=OpenAI(temperature=0)
agent_chain = initialize_agent([], llm, agent="conversational-react-description", memory=memory)
agent_chain.run(input="hi, i am bob")
This works fine with that query ("hi, i am bob"), but when I ask for index content I got this error:
Out[21]: 'Agent stopped due to max iterations.'