In today’s tutorial, we’re going to add PostgreSQL long-term memory to the LangGraph ReAct agent using the Tavily tool to get a web connection and an Anthropic LLM that we built in the previous LangChain tutorial. We’ll use LangGraph’s AsyncPostgresSaver class to implement a PostgreSQL checkpointer, which is a way to add persistent storage to a LangGraph agent using PostgreSQL database. LangGraph is a specialized framework within the LangChain ecosystem. I’ll show you an example in Python.
🔗 Links 🔗
⦁ Read more about ReAct: https://arxiv.org/abs/2210.03629
⭐ Code ⭐
⦁ GitHub repository: https://github.com/rokbenko/ai-playgr...
⦁ Code for this tutorial: https://github.com/rokbenko/ai-playgr...
🙌 Support 🙌
⦁ Subscribe: / @rokbenko
⦁ Keep tutorials brewing: https://buymeacoffee.com/rokbenko
🌐 Profiles 🌐
⦁ GitHub: https://github.com/rokbenko
⦁ LinkedIn: / rokbenko
⦁ X: https://x.com/rokbenko
🎞️ Timestamps 🎞️
00:00 – Intro
00:24 – Code for this tutorial
00:38 – Previous tutorial
01:01 – LangGraph PostgreSQL checkpointer introduced
01:30 – Example of a LangGraph agent with in-memory implementation
04:35 – Install Python dependencies
05:17 – Create an .env file to set up environment variables
05:51 – Persistent memory implementation using PostgreSQL
08:28 – Example of a LangGraph agent with persistent memory implementation using PostgreSQL
10:07 – pgAdmin overview
10:35 – Outro
#AI #AIagents #LangChain #LangGraph #Tavily #Anthropic #PostgreSQL