zep icon indicating copy to clipboard operation
zep copied to clipboard

[FEAT] LangGraph support via Zep checkpointer

Open elvenking opened this issue 1 year ago • 9 comments

I am implementing a multi-agent AI backend using LangChain, LangServe and LangGraph. I would like to store graph state in Zep with similar DX as is currently for chat message history

I would like to have support for a LangGraph state persistence in Zep and have Zep implementation of a LangGraph's checkpointer (ZepSaver) class

https://langchain-ai.github.io/langgraph/reference/checkpoints/

Since LangGraph is a recommended way how to build chat agents in LangChain, i believe this functionality would be helpful to many.

elvenking avatar Jun 09 '24 19:06 elvenking

Did you manage to implement this?

albeiroespitia avatar Jul 18 '24 21:07 albeiroespitia

If you try to pass the ZepChatMessageHistory, you get an error

instance of BaseCheckpointSaver expected (type=type_error.arbitrary_type; expected_arbitrary_type=BaseCheckpointSaver)

Seems like we need a ZepCheckpointSaver

TechNickAI avatar Jul 19 '24 07:07 TechNickAI

@albeiroespitia No, i am migrating to LangGraph Cloud when it become available.

elvenking avatar Jul 19 '24 08:07 elvenking

Thanks, all. We'd love to support LangGraph. LG checkpoints contain both chat history and the graph's state. Would you expect Zep to maintain state for the entire graph?

How should Zep's more advanced features - Facts, Dialog Classification, Structured Data Extraction - feature in a LangGraph integration?

danielchalef avatar Jul 19 '24 15:07 danielchalef

@danielchalef I really wanted to try the facts feature in my langgraph app, I ended up extracting the facts myself with a custom llm, it would be great to have a zep checkpointer in the future that supports all of these features.

albeiroespitia avatar Jul 19 '24 15:07 albeiroespitia

@danielchalef At this point LangGraph Cloud trying to be one stop shop for all your LangGraph needs (deployment + persistent state storage).

What i would ideally like to have is an option to choose Zep (imagined with LangGraph capabilities) to store my graph state and use LangGraph Cloud only for deployment, advanced observability and evaluation. I hope community will push them in that direction, so we could use Zep with LangGraph Cloud. This would be true for any other popular data storage in AI field i would say.

Maybe ping @hwchase17 about that ?

elvenking avatar Jul 20 '24 10:07 elvenking

@elvenking I expect LangChain to continue rapidly evolving and enhancing the LangGraph framework and cloud service in the coming year, with changes to APIs and the Checkpoint format inevitable. I want to avoid replicating the great work LangChain is doing (and not get caught chasing API changes). We're considering how we can best add value to the ecosystem. I've reached out to you on email. Hope to learn more about your use case & challenges.

danielchalef avatar Jul 21 '24 21:07 danielchalef

I'm interested in this enhancement as well. After using Zep and following its development for a while now, I've come to think it's the best solution for memory so far. Making it compatible with LangGraph would be very useful.

Meanwhile, perhaps there's a workaround: Would it be possible to use ZepMemory as a part of the state instead of being itself the state? Any thoughts?, @elvenking @danielchalef @albeiroespitia

joaomorossini avatar Sep 12 '24 13:09 joaomorossini

Hi all - thanks for raising this again. At this time, we won't be developing a LangGraph Checkpointer. We recently published an example of using Zep's Facts alongside chat history stored in LangGraph state for context: https://github.com/getzep/zep-python/blob/main/examples/langgraph-agent/agent.ipynb

Hopefully, this offers a path to you all.

danielchalef avatar Oct 04 '24 17:10 danielchalef