Find answers from the community

Updated 2 months ago

Including Chat History in ReAct Agent Context

Is there some way to include the chat history into the context of a ReAct agent? I'm playing around with the ReAct agent with tools in the docs, but the context of the previous questions and answers are not included in the context of following questions. For instance:

Agent Dingus
what is 4 * 3

The result of 4 * 3 is 12.

Multiply that by 3

I apologize, but I don't have enough information to answer your question. Could you please provide more context? What specific number or value would you like me to multiply by 3?
L
R
5 comments
My app is using streamlit, do you have to do something in there to maintain the chat history?
Yeah this is a streamlit issue, the bare agent does preserve memory/history
Yea, you can put the chat history in session_state maybe? You can pass in the chat history at runtime

Plain Text
agent.chat("Hello!", chat_history=chat_history)
Thats what I'm thinkin!
Add a reply
Sign up and join the conversation on Discord