bracesproul/gen-ui-python

Adding memory to the LangGraph agent

lakshyaag opened this issue · 0 comments

How would you add memory to the LangGraph agent?

I suspect it would involve removing the chatHistory and updating the state of the graph to more closely reflect MessageGraph. I tried implementing it myself, but I keep running into issues around the invoke_tools_or_return conditional edge since it checks for result first and then for tool_call.

I tried doing it myself here (quite quick and dirty): https://github.com/lakshyaag/gen-ui-python/tree/agent-memory
Sample LangSmith trace: https://smith.langchain.com/public/dc9803f2-f677-42c7-8e2d-95e3e78d2780/r/cb678d05-d97e-4a85-a116-e0958fc3eac6


I feel I'm missing a key idea on conditional edges, appreciate any help/feedback!