File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
packages/components/nodes/memory/MongoDBMemory Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -155,7 +155,10 @@ class BufferMemoryExtended extends FlowiseMemory implements MemoryMethods {
155155
156156 if ( input ) {
157157 const newInputMessage = new HumanMessage ( input . text )
158- const messageToAdd = [ newInputMessage ] . map ( ( msg ) => msg . toDict ( ) )
158+ const messageToAdd = [ newInputMessage ] . map ( ( msg ) => ( {
159+ ...msg . toDict ( ) ,
160+ timestamp : new Date ( ) // Add timestamp to the message
161+ } ) )
159162 await collection . updateOne (
160163 { sessionId : id } ,
161164 {
@@ -167,7 +170,10 @@ class BufferMemoryExtended extends FlowiseMemory implements MemoryMethods {
167170
168171 if ( output ) {
169172 const newOutputMessage = new AIMessage ( output . text )
170- const messageToAdd = [ newOutputMessage ] . map ( ( msg ) => msg . toDict ( ) )
173+ const messageToAdd = [ newOutputMessage ] . map ( ( msg ) => ( {
174+ ...msg . toDict ( ) ,
175+ timestamp : new Date ( ) // Add timestamp to the message
176+ } ) )
171177 await collection . updateOne (
172178 { sessionId : id } ,
173179 {
You can’t perform that action at this time.
0 commit comments