Ajinkya Indulkar
Ajinkya Indulkar
@crj1998 I agree. The above solution is more efficient. I suggest you open a PR for the author.
@Jflick58 already added here: https://github.com/hwchase17/langchain/pull/3575
I see! apologies for the confusion.
For the moment, I am able to make it work with this quick hack: ``` from langchain.chains.conversation.memory import \ ConversationBufferWindowMemory as LangChainConversationBufferWindowMemory class ConversationBufferWindowMemory(LangChainConversationBufferWindowMemory): """Custom ConversationBufferWindowMemory class. Overrides the `save_context`...
It does! Awesome. Thanks for the quick response. Is this already documented somewhere? If not, it might be useful to do so. 😄
@amirsaffari See if the following works: ``` agent = initialize_agent( tools, llm, agent="conversational-react-description", memory=ConversationBufferWindowMemory(memory_key="chat_history", output_key="output"), verbose=True, return_intermediate_steps=True, ) ```
@amirsaffari Hmm... can you open a new issue for this? Might be a bug in the recent versions. I suggest to also dump the traceback error log and langchain version...
You could check out https://python.langchain.com/en/latest/modules/agents/toolkits.html# for inspiration. Related blog: https://blog.langchain.dev/agent-toolkits/
I can take a shot at this if you want. I would like to contribute.