Gen-AI Developer Classroom notes 11/Nov/2025

Memory in langgraph

  • While building graphs, we have two types of memories
    • short term memory: thread specific
    • long term memory: user specific
  • Refer Here for official docs.

  • Short term memory with checkpointer will add all the previous conversations to the messages, increasing cost and at some point will break due to token length restrictions.

    • Deleting Messages (only 5 recent)
    • Restrict based on token count.
    • Summarize to restrict

Longterm memory using langgraph

  • Lets setup postgres on your system.
  • Install docker desktop

    • winget winget install -e --id Docker.DockerDesktop
    • homebrew brew install --cask docker
  • Linux

docker run -d \
  --name postgres15 \
  -e POSTGRES_USER=postgres \
  -e POSTGRES_PASSWORD=password \
  -p 5432:5432 \
  postgres:15

  • Windows
  • Linux
docker run -d `
  --name postgres15 `
  -e POSTGRES_USER=postgres `
  -e POSTGRES_PASSWORD=password `
  -p 5432:5432 `
  postgres:15

  • To connect to postgres lets use Azure DataStudio

  • In the virtual environment add uv add langgraph-checkpoint-postgres

  • Refer Here for memory

Langmem

  • Langmem is opensource library by langchain for memory based opeartions

By continuous learner

enthusiastic technology learner

Leave a Reply

Discover more from Direct AI Powered By Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading