-
Notifications
You must be signed in to change notification settings - Fork 187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
llm.generate_str use_history is not working #38
Comments
@HuntZhaozq thanks for reporting this issue. This is an annoying thing about Streamlit, which reruns the script top-to-bottom, overwriting anything that is held in-memory. The solution is to save the messages into Streamlit session state ( So in that example application you linked, change:
to
I am working on proper session state management for Streamlit so you don't have to think about these problems (e.g. when But please let me know if my workaround above works for you. |
Yes, it works. Thank you! |
@saqadri, Should mcp-agent implement session management in close loop, instead of relying on Streamlit? And the readme file points out that "Memory -- adding support for long-term memory" is on the roadmap. I do believe Session management is part of the Memory. Btw: Memory is the most valuable feature on the list.
|
I use the example of strealit_mcp_basic_agent. And set the use_history=True in the llm.generate_str method like the above.
mcp-agent/examples/streamlit_mcp_basic_agent/main.py
Line 57 in af54d24
But it is not working. When I chat with the agent in the second round. The chat history of the first round is gone. How to solve this?
The text was updated successfully, but these errors were encountered: