-
I am attempting to implement BufferWindowMemory with an Agent. I'm following https://js.langchain.com/docs/modules/memory/how_to/buffer_window_memory and https://api.js.langchain.com/classes/memory.BufferWindowMemory.html#inputKey but I'm not successfully using memory. I put in 2 logs below (reference
What does "not_implemented" mean, and if this isn't the right approach, what should I do to implement memory with an Agent? here is a snippet of the code:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 8 replies
-
🤖 Hi @scottsuhy! Great to see you back around here. Hope you're doing well. Based on the code snippet and logs you've provided, it seems like you're trying to use the However, there are a few things that might be causing issues with your implementation:
memory = new BufferWindowMemory({
k: 5,
memoryKey: "chat_history"
});
await memory.saveContext(
{[memory.inputKey]: combinedInput},
{[memory.outputKey]: result.output},
{[memory.memoryKey]: "chat_history"}
); Please try these modifications and let me know if it helps. If you're still facing issues, could you please provide more details about the agent you're using and the context in which the "not_implemented" message is logged? This would help in providing a more accurate solution. For more information, you can refer to these similar issues in the langchainjs repository:
You can also refer to the BufferWindowMemory class in the langchainjs repository: I hope this helps! Let me know if you have any other questions. Sources
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot. |
Beta Was this translation helpful? Give feedback.
-
hint. answer is actually here: https://js.langchain.com/docs/modules/agents/agent_types/openai_tools_agent#adding-memory |
Beta Was this translation helpful? Give feedback.
hint. answer is actually here: https://js.langchain.com/docs/modules/agents/agent_types/openai_tools_agent#adding-memory