Skip to content

Conversation

@deejay1
Copy link
Contributor

@deejay1 deejay1 commented Apr 9, 2025

This is the initial implementation of a stock MongoDB chat memory which doesn't require MongoDB Atlas

Closes #2688

@deejay1 deejay1 force-pushed the mongo-db-chat-memory branch from 2d88035 to 76752cf Compare April 10, 2025 12:47
@deejay1 deejay1 marked this pull request as ready for review April 10, 2025 12:48
@deejay1 deejay1 requested a review from xchopin April 11, 2025 08:42
@deejay1 deejay1 force-pushed the mongo-db-chat-memory branch from 8321e4d to 14375f0 Compare April 14, 2025 09:49
@deejay1 deejay1 requested review from eddumelendez and xchopin April 14, 2025 09:50
@deejay1 deejay1 force-pushed the mongo-db-chat-memory branch 2 times, most recently from 290cacf to 78ad992 Compare April 16, 2025 07:44
@Amine-Kadi
Copy link

I feel like it could be better to have only Mongo instead of MongoDb in all classes names.
For example : MongoDbChatMemoryProperties.java could be named MongoChatMemoryPropoerties.java.

It would follow the same logic as all classes in org.springframework.data.mongodb (MongoTemplate and not MongoDbTemplate)

@deejay1 deejay1 force-pushed the mongo-db-chat-memory branch 2 times, most recently from 249380d to e483254 Compare April 17, 2025 14:25
@deejay1
Copy link
Contributor Author

deejay1 commented Apr 17, 2025

I feel like it could be better to have only Mongo instead of MongoDb in all classes names. For example : MongoDbChatMemoryProperties.java could be named MongoChatMemoryPropoerties.java.

It would follow the same logic as all classes in org.springframework.data.mongodb (MongoTemplate and not MongoDbTemplate)

Good idea to keep it in sync. Implemented

@deejay1 deejay1 force-pushed the mongo-db-chat-memory branch from e483254 to 44d84c2 Compare April 17, 2025 14:26
@deejay1
Copy link
Contributor Author

deejay1 commented Apr 21, 2025

This will probably be reimplemented tomorrow atop of #2803

@ThomasVitale
Copy link
Contributor

@deejay1 thanks so much for your contribution! We have just delivered some changes to the ChatMemory API which include the introduction of a ChatMemoryRepository API to separate the two different concerns: memory management strategy and storage mechanism. For example, the JdbcChatMemory has now been superseded by JdbcChatMemoryRepository. It would be great if we could use the new approach directly for MongoDB. What do you think?

Upgrade Notes: https://docs.spring.io/spring-ai/reference/upgrade-notes.html#_chat_memory
New Chat Memory Docs: https://docs.spring.io/spring-ai/reference/api/chat-memory.html
PR with the change: #2890

@deejay1
Copy link
Contributor Author

deejay1 commented Apr 26, 2025

@ThomasVitale sure, I'll rewrite it of course!

@deejay1 deejay1 force-pushed the mongo-db-chat-memory branch 2 times, most recently from f3d3324 to 73ea405 Compare April 28, 2025 11:00
@deejay1
Copy link
Contributor Author

deejay1 commented Apr 28, 2025

@ThomasVitale ok, rewritten into a ChatMemoryRepository implementation

@deejay1 deejay1 requested a review from Amine-Kadi April 28, 2025 11:01
@deejay1 deejay1 force-pushed the mongo-db-chat-memory branch 2 times, most recently from 68c5cfc to 71e7584 Compare May 5, 2025 08:34
@deejay1
Copy link
Contributor Author

deejay1 commented May 5, 2025

@ThomasVitale any chances to get it in before 1.0.0?

@deejay1 deejay1 force-pushed the mongo-db-chat-memory branch 2 times, most recently from a5081dd to 451790f Compare May 12, 2025 09:42
@deejay1 deejay1 force-pushed the mongo-db-chat-memory branch 7 times, most recently from ebde7fa to d662788 Compare September 23, 2025 15:24
@ilayaperumalg ilayaperumalg added this to the 1.1.0.M3 milestone Sep 24, 2025
@deejay1 deejay1 force-pushed the mongo-db-chat-memory branch 2 times, most recently from 9275fb9 to dd5f08b Compare October 9, 2025 18:18
@deejay1
Copy link
Contributor Author

deejay1 commented Oct 10, 2025

@ilayaperumalg any chances this also gets merged? we're using it successfully in prod for a while now (since April to be exact ;)

@deejay1 deejay1 force-pushed the mongo-db-chat-memory branch 2 times, most recently from 55f7519 to 74a39de Compare October 13, 2025 17:49
@markpollack markpollack modified the milestones: 1.1.0.M3, 1.1.0.M4 Oct 20, 2025
@ilayaperumalg ilayaperumalg modified the milestones: 1.1.0.M4, 1.1.0.RC1 Oct 30, 2025
@deejay1 deejay1 force-pushed the mongo-db-chat-memory branch from 74a39de to 0223d3d Compare November 1, 2025 14:09
@imod
Copy link

imod commented Nov 3, 2025

This is great and would help a ton - any chance to get this in soon? @markpollack

@deejay1 deejay1 force-pushed the mongo-db-chat-memory branch from 0223d3d to 6421723 Compare November 6, 2025 13:28
@deejay1 deejay1 requested a review from ericbottard November 6, 2025 13:29
Signed-off-by: Łukasz Jernaś <lukasz.jernas@allegro.com>
@deejay1 deejay1 force-pushed the mongo-db-chat-memory branch from 6421723 to 0f19710 Compare November 6, 2025 15:58
@sobychacko
Copy link
Contributor

@deejay1 It seems like you write the metadata information, but doesn't seem to restore it upon read. Is that intentional? Also how about throwing an IllegalStateException for unsupported message types?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request mongo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create MongoDB chat memory