The community member is asking if there is a way to add metadata, such as timestamp, to the HumanMessage and AIMessage blocks that are persisted to memory when using agent_chain.run() in LangChain. The comments suggest that while there are additional kwargs on the message class, the community members are unsure if adding metadata there would cause errors. They also mention that having access to a message UUID could help amend the stored messages with metadata after the agent finishes generation. However, the community members note that when calling the agent, they cannot explicitly define the memory, as it has to be accessed again, and suggest creating a parallel memory as a potential solution.
For a single inference, using agent_chain.run( ... ) in langchain, for the HumanMessage + AIMessage message blocks being persisted to memory, is there a way to add metadata to those?
Lol. Doesn’t help. I tried where these kwargs go, or even the metadata param on the ‘run’ method, but no luck. They should provide a way to add metadata to each (Human + AI) message pair when storing to memory. Could help a lot.