JsonPlusSerializer compatibility between LangGraph Python and LangGraph JS #2934
afnan-davia
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Dear all, I hope you are doing well. I wanted to ask if there could be a possibility to have a SerializerProtocol for PostgresSaver that would be compatible for both Python and JavaScript.
I am currently implementing a complete Python back-end with LangGraph because it is very powerful and the Data Scientists are more familiar with Python. To save checkpoints, I use the PostgresSaver with a Supabase db. On the front-end, I am using Vercel's AI SDK and I implemented their stream protocol to be able to send streams from the back-end to the front-end. Everything is working great in this direction.
The problem arises when I want to retrieve chat history on the frontend. I wanted to rely on the channel_values available in the postgres checkpoints from the last "getTuple" result but I am having issues because of the use of msgpack since Python's JsonPlusSerializer uses that (or pickles for LangGraph api) whereas JS's JsonPlusSerializer only uses json serialization.
Having a SerializerProtocol that would bring compatibility could be absolutely amazing for startups using LangGraph Python and Vercel's AI SDK.
Of course, a workaround would be to independently save messages on the front end on each message received but that would just duplicate information across the database.
Thank you very much for all the great work!
Beta Was this translation helpful? Give feedback.
All reactions